- 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()
Type Parameters
T
T
R
R
Parameters
ctx
MiddlewareContext<T>
next
Next<R>
Returns
Promise<R>
Implementation of
Middleware.onCallTool
onRequest()
Type Parameters
T
T
R
R
Parameters
ctx
MiddlewareContext<T>
next
Next<R>
Returns
Promise<R>
Implementation of
Middleware.onRequest