/** * Shared tool-call error handling: used by BOTH the stdio transport * (index.ts) and the HTTP transport (http-server.ts) so error mapping can * never silently drift between them (same motivation as the transport-parity * test for tool dispatch). */ import { McpError } from '@modelcontextprotocol/sdk/types.js'; /** * Strips stack-trace frames, absolute filesystem paths, and loopback/private * network hosts from an error string before it's returned through an MCP * tool response. Tool responses are read directly by the calling model/agent * (and often relayed to an end user). Leaking a Node stack trace or a * server-local file path is an information-disclosure smell, not just noise. * * Public product references (e.g. "https://virtualsms.io/dashboard") are * intentionally left untouched: only stack-trace shapes, filesystem paths, * and loopback/private-network hosts are redacted. */ export declare function sanitizeErrorMessage(raw: string | undefined | null): string; /** * Maps whatever a tool handler threw into a well-formed McpError, running * the message through sanitizeErrorMessage() first. Extracted from the * (previously duplicated, one copy per transport) catch-block tail in * index.ts and http-server.ts. */ export declare function mapToolCallError(err: unknown): McpError; //# sourceMappingURL=error-utils.d.ts.map