PromptResponse

The outcome of a prompts/get call: either the final GetPromptResult, or — on a stateless (MRTR) draft request — a set of InputRequests the client must satisfy and resubmit. This mirrors ToolResponse for the prompts path: the draft schema types GetPromptResultResponse.result as GetPromptResult | InputRequiredResult, so a prompt handler that needs more input ends the request with inputRequired(...) and the client opens a fresh prompts/get carrying the matching inputResponses (and any requestState).

Members

Functions

forVersion
PromptResponse forVersion(ProtocolVersion v)

Project the final GetPromptResult to the negotiated protocol version so version-gated message content (audio/resource_link/tool_use/tool_result plus content-level _meta/lastModified) is not emitted to peers that do not understand it. Mirrors ToolResponse.forVersion: an InputRequiredResult is draft-only (MRTR) and carries no version-gated content, so it is returned unchanged.

Static functions

complete
PromptResponse complete(GetPromptResult r)

The handler is done; r is the final prompt result.

Mixed In Members

From mixin InputRequiredPart

inputRequired
typeof(this) inputRequired(InputRequest[] requests)

The handler needs input; the client must gather it and resubmit with the matching inputResponses.

inputRequired
typeof(this) inputRequired(InputRequest[] requests, string requestState)

As inputRequired, but also attaches an opaque requestState (SEP-2322): a stateless draft server encodes whatever context it needs to resume the call into this blob, which the client echoes verbatim on the retry and the handler reads back via RequestContext.requestState.

needsInput
bool needsInput()

Whether this outcome asks the client for more input.

inputRequests
const(InputRequest)[] inputRequests()

The MRTR inputRequests this outcome carries (empty unless needsInput). Read by the dispatch path so it can drop requests whose kind the client never declared.

requestState
string requestState()

The opaque MRTR requestState this outcome carries (empty unless set).

withInputRequests
typeof(this) withInputRequests(InputRequest[] reqs)

Return a copy of this input-required outcome with its inputRequests replaced by reqs (preserving requestState). Used by the dispatch path after filtering out unsupported request kinds.

toJson
Json toJson()

The JSON-RPC result payload (the final result, or an InputRequiredResult).