smart_budget_guard
Purpose: Team token budget check, count, or usage record. When to use: action=check or count before expensive tools; action=record after token-consuming work. When NOT to use: General chat, reasoning, or as a substitute for the host model. Returns: JSON string with allowance, usage, or record confirmation. Composes with: before smart_fetch/smart_context_gate on large jobs. Omit team_id to use API key tenant.
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": {
"action": "<action>"
},
"name": "smart_budget_guard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text for count action. | |
| model | No | Model name for token counting. | deepseek-chat |
| action | Yes | One of: check (allowance), count (estimate tokens), record (log usage). | |
| tokens | No | Tokens to record when action=record. | |
| team_id | No | Optional team override; leave empty to use the API key tenant. | |
| messages | No | Chat messages for count action. | |
| monthly_limit | No | Optional monthly cap override for check. | |
| completion_tokens | No | Completion tokens for record action. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |