Skip to content

Function: resultOf() ​

resultOf(outcome): object

Defined in: packages/mcp/src/mcp.ts:101

An Outcome as a tool result: ok is one text block, failed is the reason marked as an error. A tool result needs some text, so no data says "ok" where the CLI prints nothing.

Parameters ​

outcome ​

Outcome

Returns ​

object

_meta? ​

optional _meta?: object

Index Signature ​

[key: string]: unknown

optional io.modelcontextprotocol/related-task?: object

If specified, this request is related to the provided task.

taskId: string

_meta.progressToken? ​

optional progressToken?: string | number

If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

content ​

content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: string]: unknown; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: string]: unknown; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; })[]

isError? ​

optional isError?: boolean

structuredContent? ​

optional structuredContent?: object

Index Signature ​

[key: string]: unknown