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

MCP `subscription_budget`: set or clear a subscription's whole-life budget, with the same rules as the Subscriptions page #5431

shipped production is serving it opened this has it
opened this

For: the owner caps what an account may spend from a harness. subscriptionBudget (POST /settings/subscriptions/:id/budget) calls setBudget (src/core/subscriptions.ts:126), which refuses a budget out of range or one that would raise or clear a locked budget.

Done:

  • [ ] A tool subscription_budget { id, usd }, where usd is a number or null to clear. It is admin only and calls setBudget, so each refusal is the page's: out of range (above the subscription.budget_max_usd limit), locked and raised, locked and cleared, unknown id. It answers { id, budgetUsd, says }.
  • [ ] test/mcp-subscription-budget.test.ts covers four cases: an admin sets a budget and the page shows it; clearing works on an unlocked one; a value above the limit is refused; a non-admin is refused. Each fails without the tool.

Files: src/http/mcp.ts, docs/MCP.md, test/mcp-subscription-budget.test.ts.

  • [ ] One row in docs/MCP.md, marked as a write in tools/list's annotations as the other writes are.
  • [ ] Before pushing, run the new test, test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts. A red test elsewhere that main also has is named in the pull.

Risk: test/mcp-size.test.ts caps tools/list, so keep the description to one short sentence. #5418 (MCP subscriptions, the read) is separate and can land in either order. Never put a token in an answer.

commented

Parked by the crew: the check failed ("the Files page of a 40-file diff: cold median of 3 and repeat median of 5 stay under their ceilings") and the decider saw no point in another try (pull #5444 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs