Skip to content

[Server] Allow configuring the schema validator - #509

Open
steffans wants to merge 1 commit into
modelcontextprotocol:mainfrom
steffans:main
Open

[Server] Allow configuring the schema validator#509
steffans wants to merge 1 commit into
modelcontextprotocol:mainfrom
steffans:main

Conversation

@steffans

Copy link
Copy Markdown

Adds Builder::setSchemaValidator() to configure the validator used for tools/call input-schema validation. The
configured validator is passed to CallToolHandler; without configuration, the existing default validator behavior
remains unchanged.

Motivation and Context

Custom schema resolver configuration, such as:

$resolver->registerPrefix('http://example.com/', '/path/to/dir');

allows schemas to resolve from local directories.

How Has This Been Tested?

Added a unit test that configures a custom SchemaValidator, performs a tool call, and verifies that the supplied
validator is invoked.

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant