Skip to main content
Glama
wn01011

llm-token-tracker

clear_usage

Remove user-specific token usage data from the LLM token tracker to reset tracking metrics and manage data retention.

Instructions

Clear usage data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesUser ID to clear

Implementation Reference

  • Registration of the 'clear_usage' tool in the ListTools response, including name, description, and input schema.
    { name: 'clear_usage', description: 'Clear usage data', inputSchema: { type: 'object', properties: { user_id: { type: 'string', description: 'User ID to clear' } }, required: ['user_id'] } },
  • The main handler function for the 'clear_usage' tool. It clears the usage data for the specified user_id using the tracker and returns a confirmation message.
    private clearUsage(args: any) { const { user_id } = args; this.tracker.clearUserUsage(user_id); return { content: [ { type: 'text', text: `✅ Cleared usage data for ${user_id}` } ] }; }
  • Input schema definition for the 'clear_usage' tool, requiring a 'user_id' string.
    inputSchema: { type: 'object', properties: { user_id: { type: 'string', description: 'User ID to clear' } }, required: ['user_id'] }
  • Dispatch case in the CallToolRequest handler that routes 'clear_usage' calls to the clearUsage method.
    case 'clear_usage': return this.clearUsage(request.params.arguments);

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/wn01011/llm-token-tracker'

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