Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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'); }), });
  • Zod schema for parameters: empty object since no inputs required.
    parameters: z.object({}),
  • 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: []};

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dsouza-anush/brightdata-mcp-heroku'

If you have feedback or need assistance with the MCP directory API, please join our Discord server