get_budget
The CodePanel MCP tool that reads your monthly budget and a repository's cap: own-key spend, holds, what is left and what the next round meets.
On this page›
get_budget says how much of your monthly budget is spent and, given a repository, how much of that repository's cap, and what the next review round on it would meet. Call it before a push when you want to know whether a round will run, or after wait_for_review reports a refusal. It only reads, and it needs the read scope.
When to call it
- Before you push: with
repo,repo.reviewsays whether the next round is open or refused, and which limit would refuse it. - After a refused round: the
refusaltext is the one the review comment would carry. If a person has to act, pass it on. - Before
set_budget: read the current limits first, so you can undo your change.
Both limits count spend on your own provider keys only. Credits and the per-pull-request limit are not here (Budgets and spending limits).
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
repo |
string | no | Repository as owner/name |
It only reads: the server marks it readOnlyHint: true, so clients that ask before a write can run it without asking.
Leave repo out for the account budget alone. With it, the answer adds the repository's cap and the review outlook.
What it returns
month(UTC,YYYY-MM) andenforced, alwaystrue.account:limitUsd(nullfor no budget),source(default,customornone),spentUsdacross every repository,heldUsd(estimates held by running rounds),remainingUsdandstatus.repo, withrepo: the same counts for that repository, pluscapUsd(nullfor no cap), andreview:status,remainingUsd,limitedBy(repooraccount) and therefusalthe next round would get, ornull.
status is unlimited, open, reached, or uncountable when the account has too many repositories or running rounds to count. A round is refused once recorded spend plus holds reaches the limit, so the last admitted round can overshoot by its own cost.
Examples
These responses come from a test account on a local backend. The default budget, spend and repository are seed data.
{ "repo": "codepanel-dev/web-app" }
{
"account": {
"heldUsd": 0,
"limitUsd": 25,
"remainingUsd": 23.250275,
"source": "default",
"spentUsd": 1.7497250000000002,
"status": "open"
},
"enforced": true,
"month": "2026-11",
"repo": {
"capUsd": null,
"heldUsd": 0,
"remainingUsd": null,
"repo": "codepanel-dev/web-app",
"review": {
"limitedBy": "account",
"refusal": null,
"remainingUsd": 23.250275,
"status": "open"
},
"spentUsd": 0.9393375000000003,
"status": "unlimited"
}
}
source: "default" means the account never chose a budget. The repository has no cap (status: "unlimited"), so the next round is limited by the account, with $23.25 left.
The same step without MCP
| Surface | Form |
|---|---|
| CLI | codepanel budget owner/name (CLI) |
| HTTP API | GET /budget?repo=owner/name |
What the server tells your agent
The description your agent reads when it lists the tools:
The account's monthly budget (limitUsd, source default|custom|none) and, with repo, the repository's own cap (capUsd, null for none), each with this month's own-key spentUsd, heldUsd (running rounds) and remainingUsd, and status unlimited|open|reached|uncountable. repo.review says what the next round on it meets: status, remainingUsd, limitedBy (repo or account) and the refusal it would get.
Related
set_budget: change the account budget or a repository's cap.get_spend: where this month's money went.wait_for_review: reports a refused round.- Budgets and spending limits: the refusal messages.
- MCP server: install, sign-in and every other tool.