McpCallOutput
Type, in @jr2/orchestrator/src/effector-wire.ts. It is an export of @jr2/orchestrator, in the Effects group of the Authoring surface page.
ts
type McpCallOutput =
| { outcome: "returned"; isError: boolean; text: string; structured?: unknown; truncated?: boolean }
| McpNotReturned;The output of an mcp.call Effect: what the onDone of its state gets as event.output. Every outcome is output. Route on outcome:
returned: the server answered the call.isErroris the tool's ownisError: the tool ran and says that it failed.textjoins the text of the result's content; a part that is not text is one line that names its type.structuredis the result'sstructuredContent, when it has one.textandstructuredeach have the byte bound of the Effect'smaxBody: past it, jr2 cutstext, dropsstructured, and setstruncated.refused: the request did not run. The server answered an HTTP 3xx or 4xx status (a 401 or a 403 included) at any step, the handshake too; it refused the handshake; or it answered the request with the JSON-RPC error-32700,-32600,-32601or-32602: a request that it could not read, an unknown method, an unknown tool, or bad arguments; or it answered a read with-32002: the resource does not exist. It is also the Effector's own refusal, with nothing sent: the server or its secret is not in itseffector.json.unreachable: nothing of the request was sent: the name did not resolve, or the connection, TLS or the handshake failed otherwise (a 5xx, the timeout, an answer that is not MCP's, a revision of MCP that jr2 does not speak).input-required: the server asked for input, which jr2 does not give. After the error-32042, the tool did not run. After anelicitation/createrequest, which comes while the tool runs, the tool may have begun. jr2 does not send the request again: a Machine that invokes the Effect again after a Gate can run a part of the tool two times.unknown: the request was sent and no answer came (the timeout, a reset, a stream that ended first), or the server answered with a 5xx or another JSON-RPC error. The tool may have acted. jr2 does not send it again unless it is markedidempotent.
jr2 replaces each value of an Effect secret that the Effector holds with [secret:<name>], in every string of the output. The union is open (LaterOutcome): give the rest a last arm with no guard.
Forms: it is one of these objects.
Form 1:
outcome,isError,text,structured,truncatedoutcome:"returned"isError:booleantext:stringstructured(optional):unknowntruncated(optional):boolean
Form 2:
outcome,reasonoutcome:"refused"reason:string
Form 3:
outcome,reasonoutcome:"unreachable"reason:string
Form 4:
outcome,reasonoutcome:"input-required"reason:string
Form 5:
outcome,reasonoutcome:"unknown"reason:string
Form 6:
outcome,reasonoutcome:"(a later outcome)"reason(optional):string
See also