Skip to main content
Glama

get_usage_stats

Retrieve session-specific usage statistics to monitor data interactions and insights generated on the Healthcare MCP Server for AI-driven healthcare tools.

Instructions

Get usage statistics for the current session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the logic for get_usage_stats, returning session-specific usage statistics including total calls and tool usage breakdown.
    getSessionUsage(sessionId) {
      return {
        status: 'success',
        session_id: sessionId,
        session_start: this.usageStats.session_start,
        total_calls: this.usageStats.total_calls,
        tool_usage: { ...this.usageStats.tool_usage }
      };
    }
  • Tool metadata and input schema definition (empty input schema as it takes no parameters) in the ListTools response.
    {
      name: "get_usage_stats",
      description: "Get usage statistics for the current session",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Dispatch/registration of the tool handler in the MCP CallToolRequestHandler switch statement.
    case "get_usage_stats":
      result = usageService.getSessionUsage(sessionId);
      break;
  • Dispatch/registration of the tool handler in the HTTP server's handleCallTool switch statement for the /mcp/call-tool endpoint.
    case 'get_usage_stats':
      return usageService.getSessionUsage(sessionId);
  • Supporting helper method recordUsage that updates the usage stats, called before tool execution.
    recordUsage(sessionId, toolName) {
      this.usageStats.total_calls++;
      
      if (!this.usageStats.tool_usage[toolName]) {
        this.usageStats.tool_usage[toolName] = 0;
      }
      this.usageStats.tool_usage[toolName]++;
      
      console.error(`Usage recorded: ${toolName} (session: ${sessionId})`);
    }
Install Server

Other Tools

Related 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/Cicatriiz/healthcare-mcp-public'

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