agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
15 lines (14 loc) • 882 B
TypeScript
/** MCP result decoding; default text is unchanged, structured data is opt-in. */
import type { McpCallToolResult, McpClientOptions } from './types.js';
type ResultMode = NonNullable<McpClientOptions['resultMode']>;
/** Validate before opening a transport; a misspelled opt-in must not disappear. */
export declare function resultModeOf(value: unknown, name: string): ResultMode;
/**
* Whether a `tools/call` answer is the tool's own error (`isError: true`, an
* own data property). Read once, never throwing: anything it cannot read is
* not a tool error — the decoder refuses it on its own.
*/
export declare function isToolError(result: unknown): boolean;
/** Internal shared decoder for the real connection and curated mock. */
export declare function readToolResult(result: McpCallToolResult, toolName: string, serverName: string, mode?: ResultMode): unknown;
export {};