Skip to main content
Glama
wn01011

llm-token-tracker

clear_usage

Clear token usage data for a specific user in the LLM token tracker MCP server to reset tracking metrics.

Instructions

Clear usage data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesUser ID to clear

Implementation Reference

  • Handler function that executes the clear_usage tool: destructures user_id from arguments, calls tracker.clearUserUsage(user_id), 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}`
          }
        ]
      };
    }
  • Tool registration in the ListTools handler, defining name, description, and input schema for clear_usage.
    {
      name: 'clear_usage',
      description: 'Clear usage data',
      inputSchema: {
        type: 'object',
        properties: {
          user_id: {
            type: 'string',
            description: 'User ID to clear'
          }
        },
        required: ['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']
    }
  • Supporting helper method in TokenTracker class that deletes the user's usage history and totals from memory and persists the change to file storage.
    clearUserUsage(userId: string): void {
      this.usageHistory.delete(userId);
      this.userTotals.delete(userId);
      
      // Save to file storage after clearing
      if (this.storage) {
        this.saveToStorage();
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. 'Clear usage data' implies a destructive mutation, but it doesn't disclose behavioral traits like whether this is irreversible, requires admin permissions, affects other data, or has side effects. The description is minimal and lacks critical context for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description 'Clear usage data' is extremely concise with zero waste, using only three words. However, it's arguably under-specified rather than optimally concise, as it lacks necessary detail for a mutation tool. It's front-loaded but too brief to be fully helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a destructive mutation with one parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, return values, or error conditions, leaving significant gaps for an agent to understand and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'user_id' documented as 'User ID to clear'. The description adds no meaning beyond this, as it doesn't explain parameter usage, format, or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Clear usage data' states a verb ('Clear') and resource ('usage data'), providing a basic purpose. However, it's vague about what 'clear' means (delete, reset, archive?) and doesn't distinguish from sibling tools like 'get_usage' or 'track_usage'. It's not tautological but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or exclusions, and there's no reference to sibling tools like 'get_usage' for comparison. Usage is implied only by the tool name and description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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