Skip to content

toolmark-monorepo / @toolmark/mcp / toMcpResult

Function: toMcpResult() ​

toMcpResult(r, o?): McpToolResult

Defined in: packages/mcp/src/server/tool-mapping.ts:190

Maps a Toolmark ToolResult to an MCP tool result. isError is true for every status except ok; the text block is the JSON-encoded result, prefixed with UNTRUSTED_RESULT_PREFIX when untrusted.

Parameters ​

r ​

ToolResult<unknown>

The tool result.

o? ​

untrusted: the tool is marked untrustedContent.

untrusted? ​

boolean

Returns ​

McpToolResult

The MCP CallToolResult.