Frontmatter
| id | 7946 |
| title | Feat: Implement Client-Side Tool Validation in MCP Client |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Nov 30, 2025, 11:59 AM |
| updatedAt | Nov 30, 2025, 2:40 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7946 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 7931 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 30, 2025, 2:40 PM |
Feat: Implement Client-Side Tool Validation in MCP Client
tobiu added parent issue #7931 on Nov 30, 2025, 12:00 PM
tobiu assigned to @tobiu on Nov 30, 2025, 12:03 PM
tobiu cross-referenced by #7947 on Nov 30, 2025, 1:24 PM

tobiu
Nov 30, 2025, 2:40 PM
Input from Gemini 2.5 pro:
✦ I have successfully implemented client-side tool validation in
Neo.ai.mcp.client.Client.Verification of Necessity
I confirmed that the
@modelcontextprotocol/sdkclient does not perform schema validation on tool arguments before sending requests. It only validates the JSON-RPC protocol structure. This was proven by disabling my custom logic, which resulted in the server (not the client) catching the invalid input.Implementation
- Schema Caching:
Client.mjsnow caches tool schemas during initialization.- Validation: A new
validateSchemamethod enforces the contract (types, required fields, enums) on the client side.- Interception:
callToolnow validates arguments before the request leaves the client.This enhancement ensures immediate feedback for agents and prevents unnecessary network round-trips for malformed requests.
tobiu closed this issue on Nov 30, 2025, 2:40 PM
tobiu cross-referenced by #7949 on Nov 30, 2025, 2:50 PM
Goal
Implement client-side validation for tool calls in
Neo.ai.mcp.client.Client.Context
Our MCP servers already validate tool shapes using Open API specs (
ai/mcp/server/toolService.mjs). However, the currentNeo.ai.mcp.client.Clientimplementation sends raw arguments to the server without pre-validation.Requirement
The
Clientshould:listTools().callTool(), validate the arguments against the schema.Value