Skip to main content
Glama

clear_cache

Remove cached documentation from the CodeWiki MCP Server to refresh repository information and ensure up-to-date content access.

Instructions

Clear the documentation cache

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerNoSpecific repository to clear (optional)
repoNoRepository name when clearing specific repo

Implementation Reference

  • src/server.ts:108-124 (registration)
    Registration of the 'clear_cache' tool in the listTools handler, including its input schema.
    {
      name: 'clear_cache',
      description: 'Clear the documentation cache',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Specific repository to clear (optional)',
          },
          repo: {
            type: 'string',
            description: 'Repository name when clearing specific repo',
          },
        },
      },
    },
  • The MCP tool handler for 'clear_cache' that conditionally clears a specific repository cache or all caches via CacheManager.
    case 'clear_cache': {
      const { owner, repo } = args as any;
      if (owner && repo) {
        await cacheManager.clearRepository(owner, repo);
        return {
          content: [
            {
              type: 'text',
              text: `Cleared cache for ${owner}/${repo}`,
            },
          ],
        };
      } else {
        await cacheManager.clearAll();
        return {
          content: [
            {
              type: 'text',
              text: 'Cleared all cached documentation',
            },
          ],
        };
      }
    }
  • Helper method to clear a specific repository's cache from both memory and disk.
    async clearRepository(owner: string, repo: string): Promise<void> {
      const key = this.getCacheKey(owner, repo);
      
      // Remove from memory cache
      this.memoryCache.delete(key);
    
      // Remove from disk cache
      try {
        const filePath = this.getCacheFilePath(owner, repo);
        await fs.unlink(filePath);
      } catch {
        // File doesn't exist or can't be deleted
      }
    }
  • Helper method to clear all cached repositories from both memory and disk storage.
    async clearAll(): Promise<void> {
      // Clear memory cache
      this.memoryCache.clear();
    
      // Clear disk cache
      try {
        const files = await fs.readdir(this.cacheDir);
        await Promise.all(
          files.map(file => 
            fs.unlink(path.join(this.cacheDir, file)).catch(() => {})
          )
        );
      } catch {
        // Cache directory doesn't exist or can't be read
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Clear' implies a destructive operation that removes cached data, but the description doesn't specify what 'clear' entails (e.g., complete wipe, selective removal, irreversible action), whether it requires permissions, or what happens after clearing. It lacks details on side effects or operational constraints.

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 sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. No unnecessary words or structural issues detract from clarity.

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 operation with optional targeting) and lack of annotations or output schema, the description is incomplete. It doesn't explain the outcome (e.g., success confirmation, error handling), the scope of clearing (all vs. specific), or behavioral nuances. For a mutation tool with zero annotation coverage, more context is needed to guide safe and effective use.

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%, so the schema already documents both parameters (owner and repo) as optional strings for targeting specific repositories. The description doesn't add any parameter semantics beyond what the schema provides, such as explaining when to use these parameters or the effect of omitting them. Baseline 3 is appropriate when schema does the heavy lifting.

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 the documentation cache' clearly states the action (clear) and target (documentation cache). It's specific about what resource is affected, though it doesn't differentiate from sibling tools like 'list_cached_repositories' or 'search_documentation' which have different purposes.

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. There's no mention of prerequisites, when clearing is appropriate, or how this differs from related operations like refreshing or searching documentation. Users must infer usage from the name alone.

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/cbuntingde/codewiki-mcp-server'

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