Skip to content

Commit 89dc57c

Browse files
committed
Add tool input validation guidelines to AGENTS.md
1 parent 8367ef2 commit 89dc57c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ 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 handling tool input parameters and form fields:
38+
39+
- **Optional fields with empty values should be omitted entirely** - Do not send 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+
- **Fields with explicit defaults should preserve their default values** - If a field has an explicit default in its schema (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+
- **Required fields should preserve their values even when empty** - This allows the server to properly validate and return appropriate error messages
42+
- **Deeper validation should be handled by the server** - Inspector should focus on basic field presence, while the MCP server handles parameter validation according to its schema
43+
44+
These guidelines ensure clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.

0 commit comments

Comments
 (0)