Skip to content

Add typed MCP tool input schemas - #401

Closed
shanselman with Copilot wants to merge 3 commits into
masterfrom
copilot/deep-review-a2-mcp-tools-list-input-schema
Closed

shanselman with Copilot wants to merge 3 commits into
masterfrom
copilot/deep-review-a2-mcp-tools-list-input-schema

Conversation

Copilot AI commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

tools/list advertised every MCP tool with the same permissive schema, forcing clients to infer argument shape from prose. This adds declarative per-tool schemas so MCP clients can surface types, required fields, enums, and bounds directly.

  • Schema advertising

    • Added inline JSON schema metadata for known MCP commands.
    • tools/list now returns command-specific inputSchema objects instead of { additionalProperties: true }.
  • Opt-in validation

    • Added OPENCLAW_MCP_VALIDATE_INPUT=1 to validate tools/call arguments against the schema before capability dispatch.
    • Unknown tools or commands without schema metadata preserve existing behavior.
  • Coverage and docs

    • Added focused MCP bridge tests for typed schema output and validation behavior.
    • Updated MCP mode docs to describe typed schemas and the validation toggle.

Example schema shape:

{
  "name": "tts.speak",
  "inputSchema": {
    "type": "object",
    "additionalProperties": false,
    "required": ["text"],
    "properties": {
      "text": { "type": "string", "minLength": 1, "maxLength": 5000 },
      "provider": { "type": "string", "enum": ["piper", "windows", "elevenlabs"] },
      "interrupt": { "type": "boolean", "default": false }
    }
  }
}

Copilot AI and others added 2 commits May 14, 2026 21:34
Copilot AI changed the title [WIP] Enhance input schema for MCP tools in list Add typed MCP tool input schemas May 14, 2026
Copilot AI requested a review from shanselman May 14, 2026 21:39
@shanselman

Copy link
Copy Markdown
Collaborator

Closing this automation implementation as stale/superseded after the post-refactor triage. The underlying signal is preserved in #355 and the tracker update in #372: MCP input schema validation remains open, but this draft needs fresh review/implementation.

@shanselman shanselman closed this May 18, 2026
@shanselman
shanselman deleted the copilot/deep-review-a2-mcp-tools-list-input-schema branch September 7, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-review] A2: MCP tools/list ships permissive inputSchema for every tool

2 participants