cortex_log_tokens
Logs input and output tokens for a session to track API usage after each tool call.
Instructions
Log token usage for the current action. Call after every tool call.
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": {
"session_id": "<session_id>",
"input_tokens": "<input_tokens>",
"output_tokens": "<output_tokens>"
},
"name": "cortex_log_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session ID | |
| input_tokens | Yes | Input tokens used | |
| output_tokens | Yes | Output tokens generated |