diff --git a/AGENTS.md b/AGENTS.md index ec826b1f..1e6a37c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,3 +31,14 @@ The project is organized as a monorepo with workspaces: - `client/`: React frontend with Vite, TypeScript and Tailwind - `server/`: Express backend with TypeScript - `cli/`: Command-line interface for testing and invoking MCP server methods directly + +## Tool Input Validation Guidelines + +When handling tool input parameters and form fields: + +- **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 +- **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 +- **Required fields should preserve their values even when empty** - This allows the server to properly validate and return appropriate error messages +- **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 + +These guidelines ensure clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.