log_usage
Record token and cost usage for tasks or agents, saving structured records to the Usage/ folder and optionally appending a summary to the task's Agent Log.
Instructions
Record token/cost usage for a task or agent. Stores structured usage records in the Usage/ folder. Optionally appends usage summary to the task's Agent Log.
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>",
"input_tokens": "<input_tokens>",
"output_tokens": "<output_tokens>"
},
"name": "log_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | LLM model used. | |
| notes | No | Free-text notes about this usage record. | |
| task_id | No | Task this usage is for. | |
| agent_id | Yes | Which agent is reporting usage. | |
| cost_usd | No | Estimated cost in USD. | |
| project_id | No | Project this usage is for. | |
| input_tokens | Yes | Input tokens consumed. | |
| output_tokens | Yes | Output tokens consumed. | |
| duration_seconds | No | How long the operation took in seconds. |