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

A forge's admin reads their own forge's plan through MCP, in the same words as the settings row #11424

Merged opened this

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

Merged

The `here` tool now carries `plan` for this forge's admin. For anyone else, and for a forge with no plan notice, there is no `plan` key. The new test, `test/mcp-size.test.ts` and the neighbouring `here`/MCP-table tests pass locally, and so do `bun scripts/gate.ts` and `tsc`. I did not run the full suite.

shipped production is serving it deploy eb2664b

opened this

The here tool now carries plan for this forge's admin. For anyone else, and for a forge with no plan notice, there is no plan key. The new test, test/mcp-size.test.ts and the neighbouring here/MCP-table tests pass locally, and so do bun scripts/gate.ts and tsc. I did not run the full suite.

  • What it returns: on / or /settings, or with no url, an admin gets plan: { text, manage? }. text is what planLine returns, the same words as the settings row. manage is the manage-billing address, left out when none is set. here stays the right tool, so whoami_can is unused.
  • No url: here's url is now optional and defaults to /. It was required before, so this is a small schema change.
  • manage source: it comes from the forge's plan notice (noticeOf(...).portalUrl), not getPortalUrl. That is what the settings row shows, and the notice sets it only when this forge pays through the provider. getPortalUrl is the host's own setting and would show a link the row doesn't.
  • Docs: one line under the argument notes in docs/MCP.md, plus the regenerated tool table.
  • Tests: test/mcp-here-plan.test.ts covers the admin, the non-admin, a forge with no notice, a notice with no portal address, and a page that isn't / or /settings. test/mcp-size.test.ts passes and no ceiling moved.
  • Left out: plan appears only on those two forge pages. It does not appear on repository or account pages.

To try it, call here with no url as an admin of a forge that has a plan.

Closes #11411

commented

The here tool now carries plan for this forge's admin. For anyone else, and for a forge with no plan notice, there is no plan key. The new test, test/mcp-size.test.ts and the neighbouring here/MCP-table tests pass locally, and so do bun scripts/gate.ts and tsc. I did not run the full suite.

  • What it returns: on / or /settings, or with no url, an admin gets plan: { text, manage? }. text is what planLine returns, the same words as the settings row. manage is the manage-billing address, left out when none is set. here stays the right tool, so whoami_can is unused.
  • No url: here's url is now optional and defaults to /. It was required before, so this is a small schema change.
  • manage source: it comes from the forge's plan notice (noticeOf(...).portalUrl), not getPortalUrl. That is what the settings row shows, and the notice sets it only when this forge pays through the provider. getPortalUrl is the host's own setting and would show a link the row doesn't.
  • Docs: one line under the argument notes in docs/MCP.md, plus the regenerated tool table.
  • Tests: test/mcp-here-plan.test.ts covers the admin, the non-admin, a forge with no notice, a notice with no portal address, and a page that isn't / or /settings. test/mcp-size.test.ts passes and no ceiling moved.
  • Left out: plan appears only on those two forge pages. It does not appear on repository or account pages.

To try it, call here with no url as an admin of a forge that has a plan.

Approved

Clean, small change in the existing here tool: admin-only, gated on user.isAdmin, text from planLine, no plan key otherwise. Tests cover admin, non-admin, no notice, no portal, and a non-settings page. No new tool, no dependency, no ceiling moved. Note: manage comes from the plan notice rather than getPortalUrl, which matches what the settings row shows; the pull says why.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs