Public: anyone can read this; the crew can change it.

Every MCP tool's doc names each argument its inputSchema takes, and a test refuses a tool whose doc leaves one out #9149

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Each MCP tool's doc now names every argument its `inputSchema` takes, and a test fails when one is missing. The previous pull (#9119) went red because #9109 landed on main in the meantime, and I've fixed that here.

shipped production is serving it deploy fc82d1a

opened this

Each MCP tool's doc now names every argument its inputSchema takes, and a test fails when one is missing. The previous pull (#9119) went red because #9109 landed on main in the meantime, and I've fixed that here.

The 16 tool modules under src/http/mcp/tools/ list their arguments in backticks, in the house form "{ a, b? }: …", with ? on the optional ones. Behaviour is unchanged.

test/mcp-doc-names-every-argument.test.ts reads the tool list. It fails with "doc of <tool> omits argument <arg>" when a schema property is missing from that tool's doc. A second test fails when a tool in the owed set no longer breaches, so the set can only shrink.

Why #9119 went red: the test still listed following and follow_mode as owed until #9109 landed. #9109 has now landed and fixed both, so that second test failed. I emptied the owed set. This fix is in eec3aac2.

I merged origin/main into the branch instead of rebasing, because the branch cannot be force-pushed.

No MCP contract snapshot pins these docs, so none changed.

I did not touch following, follow_mode or their family.

Checks I ran:

  • The new test passes: 2 pass, 0 fail.
  • tsc --noEmit is clean on the pushed merge.
  • The gate was clean when I ran it just before the final empty-owed-set edit, but I did not re-run it afterwards.
  • On the rebased tree, 788 tests in the MCP-related files passed. The one failure was the owed-set test, which this change fixes. Some snapshot-mirror tests log network-blocked errors in the sandbox.
  • I did not re-run those MCP suites on the merged tree.

To try it, call tools/list on the preview's /mcp and read each tool's description for its arguments.

🤖 Generated with Claude Code

Closes #9110

commented

Each MCP tool's doc now names every argument its inputSchema takes, and a test fails when one is missing. The previous pull (#9119) went red because #9109 landed on main in the meantime, and I've fixed that here.

The 16 tool modules under src/http/mcp/tools/ list their arguments in backticks, in the house form "{ a, b? }: …", with ? on the optional ones. Behaviour is unchanged.

test/mcp-doc-names-every-argument.test.ts reads the tool list. It fails with "doc of <tool> omits argument <arg>" when a schema property is missing from that tool's doc. A second test fails when a tool in the owed set no longer breaches, so the set can only shrink.

Why #9119 went red: the test still listed following and follow_mode as owed until #9109 landed. #9109 has now landed and fixed both, so that second test failed. I emptied the owed set. This fix is in eec3aac2.

I merged origin/main into the branch instead of rebasing, because the branch cannot be force-pushed.

No MCP contract snapshot pins these docs, so none changed.

I did not touch following, follow_mode or their family.

Checks I ran:

  • The new test passes: 2 pass, 0 fail.
  • tsc --noEmit is clean on the pushed merge.
  • The gate was clean when I ran it just before the final empty-owed-set edit, but I did not re-run it afterwards.
  • On the rebased tree, 788 tests in the MCP-related files passed. The one failure was the owed-set test, which this change fixes. Some snapshot-mirror tests log network-blocked errors in the sandbox.
  • I did not re-run those MCP suites on the merged tree.

To try it, call tools/list on the preview's /mcp and read each tool's description for its arguments.

🤖 Generated with Claude Code

commented

The check failed because the OpenAPI routes index was stale after I merged main into the branch. I regenerated it with bun scripts/openapi-routes.ts, which changed only src/contract/openapi/routes/index.ts. I've pushed that as b154a167.

After the regeneration, test/openapi-routes.test.ts passes (341 tests). tsc --noEmit and scripts/gate.ts both ran with no output. I did not re-run the full suite here, since the forge does that on the push.

The rest of the pull is unchanged:

  • Docs: each of the 16 MCP tools names every argument its inputSchema takes, in backticks.
  • Test: test/mcp-doc-names-every-argument.test.ts fails when a tool's doc omits an argument. Its owed set is now empty, since #9109 has landed.
  • Left alone: I did not touch following or follow_mode.
  • Try it: call tools/list on the preview's /mcp and read each tool's description for its arguments.

🤖 Generated with Claude Code

Changes requested — before the latest push

The docs and the test do what the issue asks, but two docs mark an optional argument as required, which breaks the house form (? on every optional one). Fix both in one round.

  1. asks_act: the schema requires only action, so items should be items?.
  2. limb: the schema requires app and action, so issue should be issue?.

The test checks only that an argument is named, not whether ? matches required. Consider asserting that too, so these two can't regress.

commented

Both docs now mark the optional argument with ?, and a new test keeps them that way. I pushed this as 0566103f.

  • asks_act: the doc now reads { action, items?, repo?, reason?, dryRun? }, since the schema requires only action.
  • limb: the doc now reads { app, issue?, action, … }, since the schema requires app and action.
  • New test: it checks that the { a, b? } form in a doc puts ? on exactly the arguments the schema doesn't require. It fails with a line like "asks_act.items is optional but the doc writes items".
  • Checks: that test file passes (3 tests), test/mcp-tools.test.ts and test/mcp-card.test.ts pass (189 tests), and tsc --noEmit and scripts/gate.ts are clean.

I limited the new test to the 16 tools this issue covers, and I disagree with applying it to every tool. Run over all tools, it also flags 14 arguments on 10 older tools. Examples are hooks.url, secrets.action, crew.repo and seal.sealed. Their docs write them as required, but their schemas don't list a required array, and their handlers enforce the requirement instead. Changing those means deciding whether the schema or the doc is right, which is a different change from this one.

🤖 Generated with Claude Code

Approved

Both earlier asks are met: asks_act and limb now mark their optional arguments with ?, and a test holds the { a, b? } form for the 16 tools. I checked the asks_act doc against its schema (the listen action and repo exist). Scoping the ? test to those 16 tools is reasonable. Non-blocking: open an issue for the 14 older-tool arguments whose schemas lack a required array.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs