MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toPassthroughResult

Function toPassthroughResult

packages/hosts/mcp/src/tool-server.ts:723–739  ·  view source on GitHub ↗
(outcome: FormattedExecuteInput)

Source from the content-addressed store, hash-verified

721 * (sandbox error, emitted output) keeps the codemode rendering.
722 */
723const toPassthroughResult = (outcome: FormattedExecuteInput): McpToolResult => {
724 const value = outcome.result;
725 if (outcome.error || !isToolResult(value)) return toMcpResult(outcome);
726 if (value.ok) {
727 return toMcpResult({ ...outcome, result: value.data });
728 }
729 const message = `${value.error.code}: ${value.error.message}`;
730 return {
731 content: [{ type: "text", text: `Error: ${message}` }],
732 structuredContent: {
733 status: "error",
734 error: value.error,
735 logs: outcome.logs ?? [],
736 },
737 isError: true,
738 };
739};
740
741/**
742 * A passthrough tool asked the user for something and the connected client

Callers 1

executePassthroughCallFunction · 0.85

Calls 2

isToolResultFunction · 0.90
toMcpResultFunction · 0.85

Tested by

no test coverage detected