Skip to content

basalt / mcp/src / ToolErrorOptions

Interface: ToolErrorOptions ​

Defined in: mcp/src/tools.ts:135

How a tool call's failure is shaped for the model and reported to the operator. The trust boundary: a thrown error reaches the MCP client — a language model, and whoever can read or steer its context — as the same { code, message, details? } an HTTP client gets, so details passes through redactErrorDetails on the way out, and internalDetails never leaves: it goes to reportError only.

Extended by ​

Properties ​

redactErrorDetails? ​

> optional redactErrorDetails?: false | ErrorDetailsRedactor

Defined in: mcp/src/tools.ts:144

Filters an error's public details before they enter a tool result. Default: redactSensitiveDetails from @basaltkit/http — the value of every key that names a secret (password, token, apiKey, secret, sessionId, …) becomes '[REDACTED]'. Pass your own, or false to send the details exactly as an HTTP client receives them. A route can override it with meta.mcp: { redactErrorDetails }.


reportError? ​

> optional reportError?: false | HttpErrorReporter

Defined in: mcp/src/tools.ts:151

Receives every error a tool call throws, with the error object untouched (its log-only internalDetails included) — the same contract as the adapters' onError. Default: httpErrorReporter() (5xx to console.error, 4xx to console.warn). false reports nothing.

Released under the MIT License.