session_stats
Retrieve usage statistics for the current session to monitor web data requests and track activity within the Bright Data Web MCP server.
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 session_stats tool. It uses debug_stats.tool_calls to generate a report of tool usage 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 server.addTool via the addTool helper function.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 parameters: empty object since no inputs required.parameters: z.object({}),
- server.js:123-123 (helper)Global debug_stats object that tracks tool calls per session, used by the session_stats handler.let debug_stats = {tool_calls: {}, session_calls: 0, call_timestamps: []};