Skip to content

Documentation / @agentick/mcp / safeToolHandler

Function: safeToolHandler()

safeToolHandler<T>(handler): T

Defined in: protocol/errors.ts:97

Wrap a tool handler to catch errors and return safe isError results. Prevents stack traces and internal details from reaching the client.

Type Parameters

T

T extends (...args) => Promise<{[key: string]: unknown; }>

Parameters

handler

T

Returns

T

Released under the ISC License.