Skip to main content
Glama

clear-cache

Clear cached data on the CCXT MCP Server to ensure up-to-date cryptocurrency exchange integration and optimal performance.

Instructions

Clear CCXT cache

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'clear-cache'. Calls clearCache() from utils/cache and returns a success message.
    server.tool("clear-cache", "Clear CCXT cache", {}, async () => {
      clearCache();
      return {
        content: [{
          type: "text",
          text: "Cache cleared successfully."
        }]
      };
    });
  • Core implementation of cache clearing logic. When called without arguments (as in the tool handler), clears the entire LRU cache, resets statistics, and logs the action.
    export function clearCache(keyPattern?: string): void {
      if (keyPattern) {
        // Clear all keys matching specific pattern
        const keys = [];
        for (const key of dataCache.keys()) {
          if (typeof key === 'string' && key.includes(keyPattern)) {
            keys.push(key);
          }
        }
        
        // Delete all matching keys from cache
        keys.forEach(key => dataCache.delete(key));
        log(LogLevel.INFO, `Cleared ${keys.length} cache items matching "${keyPattern}"`);
      } else {
        // Clear entire cache
        const size = dataCache.size;
        dataCache.clear();
        log(LogLevel.INFO, `Cleared all ${size} cache items`);
      }
      
      // Update cache statistics
      cacheStats.size = dataCache.size;
      cacheStats.lastCleared = new Date().toISOString();
      cacheStats.hits = 0;
      cacheStats.misses = 0;
    }
  • src/index.ts:163-171 (registration)
    Registers the 'clear-cache' tool on the MCP server with empty schema and description 'Clear CCXT cache'.
    server.tool("clear-cache", "Clear CCXT cache", {}, async () => {
      clearCache();
      return {
        content: [{
          type: "text",
          text: "Cache cleared successfully."
        }]
      };
    });
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 CCXT cache' implies a destructive operation but doesn't specify what gets cleared (e.g., all cache, specific data), whether it's reversible, permission requirements, or side effects. This is inadequate for a mutation tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient phrase with no wasted words. It's front-loaded and directly states the tool's function, making it highly concise and well-structured for quick comprehension.

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 no annotations, no output schema, and a destructive-sounding operation, the description is incomplete. It lacks details on behavior, outcomes, or error conditions, which are crucial for an agent to use this tool safely and effectively in context with sibling tools.

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

Parameters4/5

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

With 0 parameters and 100% schema description coverage, the baseline is high. The description doesn't need to explain parameters, and it doesn't add or detract from the schema. A score of 4 reflects that the description is appropriate for a parameterless tool.

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

Purpose4/5

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

The description 'Clear CCXT cache' clearly states the action (clear) and target resource (CCXT cache), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'clear-exchange-cache', which appears to serve a similar function, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'clear-exchange-cache' or when cache clearing is appropriate. It lacks context about prerequisites, timing, or comparison with sibling tools, leaving the agent without usage direction.

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

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/doggybee/mcp-server-ccxt'

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