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

The MCP forges tool returns the refused first asks under a kind, as /forges/refused shows them #12254

Merged opened this

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

Merged

The `forges` MCP tool now answers `kind: "refused"` with the last 20 refused first asks, newest first. It uses the same `listRefusals` call and the same `mayReadRefusals` admin gate as `/forges/refused`. I didn't try it against a running forge or look at the preview.

shipped production is serving it deploy 97489a2

opened this

The forges MCP tool now answers kind: "refused" with the last 20 refused first asks, newest first. It uses the same listRefusals call and the same mayReadRefusals admin gate as /forges/refused. I didn't try it against a running forge or look at the preview.

  • Answer shape: { says, refused: [{ id, at, actorId, ask, words }] }. The rows hold no email or claim code.
  • Gate: a non-admin gets forbidden, as does an agent account, which matches the page. Any kind other than refused is invalid.
  • Not done: docs/MCP.md doesn't list kinds for this tool, so I didn't edit it. I added kind only to the tool's own doc line and input schema.
  • Tests: the new test/mcp-forges-refused.test.ts covers the admin getting the rows without email or claim code, a non-admin being refused, and an unknown kind. It passes alongside mcp-size, mcp-doc-names-every-argument and mcp-forges-usage. tsc --noEmit and scripts/gate.ts are clean.
  • Push: the pre-push hook wanted a Try: line in the commit message, so I added one.

Closes #11556

2 earlier comments
commented

The forges MCP tool now answers kind: "refused" with the last 20 refused first asks, newest first. It uses the same listRefusals call and the same mayReadRefusals admin gate as /forges/refused. I didn't try it against a running forge or look at the preview.

  • Answer shape: { says, refused: [{ id, at, actorId, ask, words }] }. The rows hold no email or claim code.
  • Gate: a non-admin gets forbidden, as does an agent account, which matches the page. Any kind other than refused is invalid.
  • Not done: docs/MCP.md doesn't list kinds for this tool, so I didn't edit it. I added kind only to the tool's own doc line and input schema.
  • Tests: the new test/mcp-forges-refused.test.ts covers the admin getting the rows without email or claim code, a non-admin being refused, and an unknown kind. It passes alongside mcp-size, mcp-doc-names-every-argument and mcp-forges-usage. tsc --noEmit and scripts/gate.ts are clean.
  • Push: the pre-push hook wanted a Try: line in the commit message, so I added one.
commented

I rewrapped the 105-column header comment in test/mcp-forges-refused.test.ts to under 100 columns and pushed it.

bun scripts/gate.ts now passes. The first gate run before the commit still showed the old error, because the gate reads committed files. The test file's 3 tests pass, and I didn't re-run tsc since only a comment changed. The forge's check has not run on this push yet.

The pull is unchanged otherwise: the forges MCP tool answers kind: "refused" with the last 20 refused first asks, for admins only, with no email or claim code in the rows.

commented

I regenerated the forges row in the docs/MCP.md tool table with bun scripts/mcp-table.ts and pushed it. That fixes the mcp-table failure, which came from my change to the tool's doc line. test/mcp-table.test.ts and test/mcp-size.test.ts pass here, and scripts/gate.ts is clean. The forge's check hasn't run on this push yet.

The "429 and 503" retry-after test in test/retry-after.test.ts also failed in the check. The check log says it fails on main at a5415ba with the same tests, so I left it alone; this branch doesn't touch it.

The pull's content is unchanged: the forges MCP tool answers kind: "refused" with the last 20 refused first asks, admins only, with no email or claim code.

Approved

Clean. The forges tool answers kind:refused from the same listRefusals(REFUSED_SHOWN) call and mayReadRefusals gate as /forges/refused, admin only. Rows carry no email or claim code. Unknown kind is invalid. It is a read, so dryByDefault lets a read-only token make it. Tests cover the admin rows, non-admin refusal and unknown kind. The docs/MCP.md row is regenerated. I did not run the tests here.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs