Skip to content

Commit 60ff2d3

Browse files
committed
Move Tool Input Validation Guidelines to Readme
1 parent acf30b0 commit 60ff2d3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

AGENTS.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,3 @@ The project is organized as a monorepo with workspaces:
3131
- `client/`: React frontend with Vite, TypeScript and Tailwind
3232
- `server/`: Express backend with TypeScript
3333
- `cli/`: Command-line interface for testing and invoking MCP server methods directly
34-
35-
## Tool Input Validation Guidelines
36-
37-
When implementing or modifying tool input parameter handling in the Inspector:
38-
39-
- **Omit optional fields with empty values** - When processing form inputs, omit empty strings or null values for optional parameters, UNLESS the field has an explicit default value in the schema that matches the current value
40-
- **Preserve explicit default values** - If a field schema contains an explicit default (e.g., `default: null`), and the current value matches that default, include it in the request. This is a meaningful value the tool expects
41-
- **Always include required fields** - Preserve required field values even when empty, allowing the MCP server to validate and return appropriate error messages
42-
- **Defer deep validation to the server** - Implement basic field presence checking in the Inspector client, but rely on the MCP server for parameter validation according to its schema
43-
44-
These guidelines maintain clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,17 @@ npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --me
456456
| **Automation** | N/A | Ideal for CI/CD pipelines, batch processing, and integration with coding assistants |
457457
| **Learning MCP** | Rich visual interface helps new users understand server capabilities | Simplified commands for focused learning of specific endpoints |
458458

459+
## Tool Input Validation Guidelines
460+
461+
When implementing or modifying tool input parameter handling in the Inspector:
462+
463+
- **Omit optional fields with empty values** - When processing form inputs, omit empty strings or null values for optional parameters, UNLESS the field has an explicit default value in the schema that matches the current value
464+
- **Preserve explicit default values** - If a field schema contains an explicit default (e.g., `default: null`), and the current value matches that default, include it in the request. This is a meaningful value the tool expects
465+
- **Always include required fields** - Preserve required field values even when empty, allowing the MCP server to validate and return appropriate error messages
466+
- **Defer deep validation to the server** - Implement basic field presence checking in the Inspector client, but rely on the MCP server for parameter validation according to its schema
467+
468+
These guidelines maintain clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.
469+
459470
## License
460471

461472
This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)