session_stats
Track and report usage statistics for web data collection activities performed during the current session, including requests made and data retrieved.
Instructions
Tell the user about the tool usage during this session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:268-274 (handler)The execute handler for the 'session_stats' tool. It iterates over debug_stats.tool_calls to generate a markdown list of tool usage counts in the current session.execute: tool_fn('session_stats', async()=>{ let used_tools = Object.entries(debug_stats.tool_calls); let lines = ['Tool calls this session:']; for (let [name, calls] of used_tools) lines.push(`- ${name} tool: called ${calls} times`); return lines.join('\n'); }),
- server.js:264-275 (registration)Registration of the 'session_stats' tool using addTool, including name, description, empty parameter schema, and inline handler.addTool({ name: 'session_stats', description: 'Tell the user about the tool usage during this session', parameters: z.object({}), execute: tool_fn('session_stats', async()=>{ let used_tools = Object.entries(debug_stats.tool_calls); let lines = ['Tool calls this session:']; for (let [name, calls] of used_tools) lines.push(`- ${name} tool: called ${calls} times`); return lines.join('\n'); }), });
- server.js:267-267 (schema)Zod schema for session_stats inputs: empty object, no parameters required.parameters: z.object({}),
- server.js:123-123 (helper)Global debug_stats object that tracks tool_calls count per tool name, used by the session_stats handler to report usage.let debug_stats = {tool_calls: {}, session_calls: 0, call_timestamps: []};