Namespace Nexus\Mcp\Server\Exception

Exceptions
DuplicateServerMetadataException

Thrown when more than one registered source declares a class-level #[AsServer].

InvalidCursorException

Thrown when a paginated list request supplies a cursor that the store does not recognise.

MissingDiscoveryAttributeException

Thrown when a source passed to ServerBuilder::register() carries no discoverable attribute.

PromptNotFoundException

Thrown when a prompts/get references a prompt that is not registered with the store.

ReservedMethodException

Thrown when a handler is added for a method already reserved by the MCP specification.

ResourceNotFoundException

Thrown when a resources/read references a URI that the store cannot resolve.

SchemaGenerationException

Thrown when a handler parameter's input schema cannot be generated.

ToolNotFoundException

Thrown when a tools/call invokes a tool that is not registered with the store.

ToolOutputValidationException

Thrown when a tool's structuredContent does not conform to its declared outputSchema.

UnreservedMethodException

Thrown when a built-in handler is replaced for a method the MCP specification does not reserve.

UnsupportedNestedParameterException

Thrown when an expanded DTO declares a constructor parameter that is itself a class the binder cannot construct from a value map.

UnsupportedParameterTypeException

Thrown when a discovered prompt, resource, or resource-template method declares a parameter whose type cannot be satisfied by a string.

UnsupportedReturnValueException

Thrown when a discovered handler returns a value the adapter cannot map to its result type.

UnsupportedSchemaTypeException

Thrown when a PHP type cannot be mapped to a JSON Schema fragment.

UnsupportedVariadicParameterException

Thrown when a discovered prompt, resource, or resource-template method declares a variadic parameter.