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

Function extractMcpErrorMessage

packages/plugins/mcp/src/sdk/plugin.ts:569–577  ·  view source on GitHub ↗
(content: unknown)

Source from the content-addressed store, hash-verified

567const decodeMcpToolCallEnvelope = Schema.decodeUnknownOption(McpToolCallEnvelope);
568
569const extractMcpErrorMessage = (content: unknown): string => {
570 if (Array.isArray(content)) {
571 for (const item of content) {
572 const decoded = Option.getOrUndefined(decodeMcpTextContent(item));
573 if (decoded !== undefined && decoded.text.length > 0) return decoded.text;
574 }
575 }
576 return "MCP tool returned an error";
577};
578
579// The server no longer advertises this tool — the persisted catalog drifted.
580// Answered after marking the connection stale so the next tools read re-lists;

Callers 1

plugin.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected