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

MCP `map` takes `first: <number>` so an agent or a person can put a ready issue first #8226

Merged opened this

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

Merged

The MCP `map` tool now takes `first: <number>`, and the answer lists that issue first among ready. The new test, the `mcp-size` test, `tsc`, `scripts/gate.ts` and the 18 test files `scripts/fast.ts` named all pass. The forge's full check hasn't run yet.

shipped production is serving it deploy 1f09d72

opened this

The MCP map tool now takes first: <number>, and the answer lists that issue first among ready. The new test, the mcp-size test, tsc, scripts/gate.ts and the 18 test files scripts/fast.ts named all pass. The forge's full check hasn't run yet.

  • Writer: first: N goes through the same putIssueFirst action as the map page and the terminal. An issue the caller can't see counts as not found.
  • Reader: a reader with an rw token gets forbidden. An agent caller is refused too, because the core rule only lets people rank.
  • Closed or blocked: a closed or blocked issue gets invalid.
  • Missing: a missing issue number gets no_such_issue.
  • Read-only tokens: map is now marked as a writing tool, but a call without first is still a plain read. A ro token can read the plan and is refused only when it passes first.
  • Tool descriptions: the one-line description in src/http/mcp/tools/map.ts is trimmed to fit mcp-size's 120-byte limit. The first detail is in the doc line, so it appears in docs/MCP.md, regenerated with bun scripts/mcp-tools.ts.
  • Test: test/mcp-map-first.test.ts calls the tool as a writer and as a reader, and covers blocked, closed and missing issues.

The argument is app, as map already has it, not repo as the issue wrote it. Renaming it would break existing callers, so I didn't.

To try it, call map with { app: "owner/name", first: 3 } and ready[0] is issue 3.

Closes #7807

commented

The MCP map tool now takes first: <number>, and the answer lists that issue first among ready. The new test, the mcp-size test, tsc, scripts/gate.ts and the 18 test files scripts/fast.ts named all pass. The forge's full check hasn't run yet.

  • Writer: first: N goes through the same putIssueFirst action as the map page and the terminal. An issue the caller can't see counts as not found.
  • Reader: a reader with an rw token gets forbidden. An agent caller is refused too, because the core rule only lets people rank.
  • Closed or blocked: a closed or blocked issue gets invalid.
  • Missing: a missing issue number gets no_such_issue.
  • Read-only tokens: map is now marked as a writing tool, but a call without first is still a plain read. A ro token can read the plan and is refused only when it passes first.
  • Tool descriptions: the one-line description in src/http/mcp/tools/map.ts is trimmed to fit mcp-size's 120-byte limit. The first detail is in the doc line, so it appears in docs/MCP.md, regenerated with bun scripts/mcp-tools.ts.
  • Test: test/mcp-map-first.test.ts calls the tool as a writer and as a reader, and covers blocked, closed and missing issues.

The argument is app, as map already has it, not repo as the issue wrote it. Renaming it would break existing callers, so I didn't.

To try it, call map with { app: "owner/name", first: 3 } and ready[0] is issue 3.

Approved

Clean. map with first: N goes through the same putIssueFirst action the page and terminal use, so the writer gate and refusal wording are shared. The issue lookup applies mayView, so a sealed issue reads as not found. A ro token can still read the plan (readsWithout: "first") and is refused only when it passes first. The tests cover writer, reader, blocked, closed and missing issues, and the doc line is updated. No new dependency, no dead code.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs