Commit 8e11fa82 authored by Anurag Pant's avatar Anurag Pant Committed by Christian Tzolov
Browse files

feat(client): add client tool output schema validation and caching (#302)



- Add JSON schema validation for tool call results against output schemas
- Implement automatic tool output schema caching during initialization
- Add `enableCallToolSchemaCaching` configuration option to enable/disable
  schema caching
- Add `JsonSchemaValidator` integration to McpClient builder APIs
- Introduce post-initialization hook mechanism for performing operations
  after successful client initialization
- Cache tool output schemas during `listTools` operations when caching
  is enabled
- Validate tool results against cached schemas in `callTool` operations
- Return error CallToolResult when validation fails
- Add test coverage
- Convert validateToolResult from Mono to synchronous method
- Throw IllegalArgumentException on validation errors

Signed-off-by: default avatarChristian Tzolov <christian.tzolov@broadcom.com>

Co-authored-by: default avatarAnurag Pant <pantanurag555@github>
Co-authored-by: default avatarChristian Tzolov <christian.tzolov@broadcom.com>
Co-authored-by: default avatarDaniel Garnier-Moiroux <git@garnier.wf>
Co-authored-by: default avatarDariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
parent 3f7578b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment