Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

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

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