Skip to main content

Overview

Validation errors are thrown when input parameters fail schema validation, when tool output doesn’t match the expected schema, when an HTTP method doesn’t match, or when a required prompt argument is missing.

Error Reference

InvalidInputError

Thrown when input parameters fail Zod schema validation. This is a public error — validation details are included in the response to help clients fix their requests.
Example:

InvalidOutputError

Thrown when a tool’s output does not match the declared output schema. This is an internal error — schema details are not exposed to clients.
If a custom errorId (e.g., a request ID) is provided, it is included in the public message for correlation. Otherwise, a generic message is returned. Example:

InvalidMethodError

Thrown when a request uses the wrong HTTP method (e.g., GET instead of POST).
Example:

MissingPromptArgumentError

Thrown when a required prompt argument is not provided by the caller.
Example: