Set Agent Budget
ledger_set_budgetSet spending and token caps for an agent, warning at 80% and rejecting any ledger_track call that would exceed the cap.
Instructions
Set spending caps for an agent. Warns at 80%, blocks spend when exceeded — enforced: a ledger_track call that would cross the cap is rejected.
Dollar caps (monthly_cents/daily_cents) and token caps (monthly_tokens/ daily_tokens) are independent dimensions: dollar caps only cover non-"tokens" rails, token caps only cover rail="tokens" bookkeeping rows (tokens_in/tokens_out). Set both if the agent uses both.
Monthly cap is required; the rest are optional (0 = no limit). Overwrites any existing budget for the agent — with one rule: raising or removing an existing cap requires the workspace_key. An agent_secret can tighten its own caps but never loosen them; to grow an allowance the agent asks its owner (see ledger_request_approval). Claiming a brand-new agent_id requires your workspace_key; that first call mints an agent_secret (returned once — save it); later calls for that agent_id must pass the agent_secret back (no workspace_key needed again).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent_id": "<agent_id>",
"monthly_cents": "<monthly_cents>"
},
"name": "ledger_set_budget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | unique agent identifier | |
| daily_cents | No | daily spending cap in cents (0 = no daily cap) | |
| agent_secret | No | required for every call after the first for this agent_id | |
| daily_tokens | No | daily token-burn cap (0 = no cap) | |
| monthly_cents | Yes | monthly spending cap in cents | |
| workspace_key | No | required when claiming a brand-new agent_id; not needed once the agent_id has been claimed | |
| monthly_tokens | No | monthly token-burn cap (0 = no cap) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||