Type: refactor · Difficulty: medium
retrieve_file enforces per-operation required fields with runtime throw inside dispatch (packages/mcp/src/retrieveFileTool.ts:111,119,122,133) rather than in the Zod schema (:39). So MCP clients get no schema-level signal that metadata needs relativePaths, content needs relativePath, bulk_search needs paths+search.
Do: model the input as a Zod discriminated union keyed on operation (or superRefine) so required fields per operation are declared in the schema.
Done when: invalid operation payloads are rejected by the schema; the runtime throws become redundant.
Type: refactor · Difficulty: medium
retrieve_fileenforces per-operation required fields with runtimethrowinside dispatch (packages/mcp/src/retrieveFileTool.ts:111,119,122,133) rather than in the Zod schema (:39). So MCP clients get no schema-level signal thatmetadataneedsrelativePaths,contentneedsrelativePath,bulk_searchneedspaths+search.Do: model the input as a Zod discriminated union keyed on
operation(orsuperRefine) so required fields per operation are declared in the schema.Done when: invalid operation payloads are rejected by the schema; the runtime throws become redundant.