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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server/usage-service.js:30-38 (handler)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 } }; }
- server/index.js:255-262 (schema)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: {}, }, },
- server/index.js:322-324 (registration)Dispatch/registration of the tool handler in the MCP CallToolRequestHandler switch statement.case "get_usage_stats": result = usageService.getSessionUsage(sessionId); break;
- server/http-server.js:67-68 (registration)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);
- server/usage-service.js:16-25 (helper)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})`); }