get_usage
Monitor agent resource usage by retrieving API call count and compute consumption. Supply the agent ID to receive usage statistics.
Instructions
查看 Agent 的用量统计。返回 API 调用次数、算力消耗等。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID |
Implementation Reference
- src/acap-client.ts:193-195 (handler)The actual HTTP client method that executes the get_usage tool. It performs a GET request to '/acap/v1/agents/{agentId}/usage' to retrieve usage statistics for an agent.
async getUsage(agentId: string) { return this.request('GET', `/acap/v1/agents/${agentId}/usage`); } - src/index.ts:276-285 (schema)The input schema definition for the 'get_usage' tool. It declares a required 'agent_id' string parameter and provides a Chinese description: 'View Agent usage statistics. Returns API call count, compute consumption, etc.'
name: 'get_usage', description: '查看 Agent 的用量统计。返回 API 调用次数、算力消耗等。', inputSchema: { type: 'object' as const, properties: { agent_id: { type: 'string', description: 'Agent ID' }, }, required: ['agent_id'], }, }, - src/index.ts:849-853 (registration)The case handler in the main tool dispatch switch statement that calls client.getUsage(agent_id) when the tool name is 'get_usage'.
case 'get_usage': { const { agent_id } = args as { agent_id: string }; result = await client.getUsage(agent_id); break; } - src/index.ts:120-120 (registration)Registration of 'get_usage' in the 'identity' feature group, alongside other identity-related tools like register_agent, get_profile, etc.
'get_usage', 'rotate_api_key',