- tools/call plain errors → { isError: true, content: […] } (per MCP spec)
- tools/call McpError → re-thrown as a protocol-level error
- all other methods → McpError(InternalError, message)
Implements
Constructors
Constructor
Returns
ErrorNormalizationMiddleware
Methods
onCallTool()
Parameters
ctx
MiddlewareContext
next
Next
Returns
Promise<unknown>
Implementation of
Middleware.onCallTool
onRequest()
Parameters
ctx
MiddlewareContext
next
Next
Returns
Promise<unknown>
Implementation of
Middleware.onRequest