[Repo Assist] feat(mcp): add per-command JSON Schema to tools/list#262
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Draft
Conversation
Every command advertised by McpToolBridge now returns a curated JSON Schema in the inputSchema field of tools/list instead of the generic permissive fallback (additionalProperties:true). Changes: - McpToolBridge.CommandSchemas: new static dict with full JSON Schema for all 26 known commands (22 original + location.get, device.info, device.status, browser.proxy which were missing from CommandDescriptions). - McpToolBridge.KnownSchemas: new public property exposing the dict for tests and documentation drift-checking. - HandleToolsList: uses per-command schema when available, falls back to the permissive schema for unknown/future commands. - McpToolBridgeTests: 15 new tests verifying required fields, enum constraints, schema coverage, and that unknown commands still get the permissive fallback. - docs/MCP_MODE.md: mark the deferred per-tool-schema item as implemented. This is the implementation of the first deferred item in MCP_MODE.md. MCP clients (Cursor, Claude Desktop, etc.) now receive accurate parameter types, required-field lists, and enum constraints — without needing to infer arg shapes from descriptions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated pull request from Repo Assist.
Summary
Every tool advertised via
tools/listnow carries a curated JSON Schema in itsinputSchemafield instead of the generic permissive fallback (additionalProperties: true). This was the first deferred item indocs/MCP_MODE.md.MCP clients (Cursor, Claude Desktop, etc.) will now receive accurate parameter types, required-field lists, and enum constraints — without having to infer argument shapes from descriptions and trial-and-error.
What changed
McpToolBridge.csCommandSchemas— static dictionary mapping every known command to its full JSON Schema, built once at startup from raw JSON literals.KnownSchemas— public property exposing the dict for tests and documentation drift-checking.HandleToolsList: looks up per-command schema; unknown/future commands still fall back to the permissive schema, so newly-added capabilities continue to render without a code change here.CommandDescriptions:location.get,device.info,device.status,browser.proxy.Highlights from the schemas
system.run/system.run.preparecommandcommandacceptsstringorstring[]viaoneOfsystem.whichbinsminItems: 1system.execApprovals.setrulespattern+action;actionisenumscreen.recorddurationMsmaximum: 300000,fpsbounded 1–60camera.clipdurationMsmaximum: 60000tts.speaktextproviderrestricted to["windows","elevenlabs"]canvas.navigateurlcanvas.a2ui.pushJSONLjsonlPathbrowser.proxypathmethodrestricted to["GET","POST","DELETE"]McpToolBridgeTests.cs— 15 new testsToolsList_KnownCommands_SchemaIncludesRequiredField— theory (9 cases) verifying required arrays for commands that have mandatory args.ToolsList_UnknownCommand_GetsPermissiveSchema— unknown commands still receiveadditionalProperties:true.ToolsList_KnownCommand_DoesNotHaveAdditionalPropertiesTrue— known commands do not have the permissive flag.KnownSchemas_ContainsAllKnownCommands— drift guard: every command inKnownCommandsmust have a curated schema.KnownSchemas_SystemRun_HasPropertiesForAllDocumentedArgs— spot-checkssystem.runproperties.KnownSchemas_TtsSpeak_ProviderEnumMatchesDocumentation— verifies provider enum values.KnownSchemas_ExecApprovalsSet_RuleItemsHaveRequiredPatternAndAction— verifies rule-item required fields.docs/MCP_MODE.mdTrade-offs
McpToolBridge(same approach asCommandDescriptions) rather than onINodeCapability. This avoids an interface change that would require updating all capability implementations. The doc comment inMCP_MODE.mdmentioned both approaches; the static dict approach is simpler and consistent with the existing pattern.Test Status
OpenClaw.Shared.TestsOpenClaw.Tray.TestsThe 2 Shared.Tests failures (
CanvasCapabilityTests.A2UIPush_WithJsonlPath_ReadsFile,A2UICapabilitySecurityTests.A2UIPush_FileJsonl_OverCap_ReturnsError) are pre-existing and unrelated to this change.Closes: n/a (implements deferred item from
docs/MCP_MODE.md)