Skip to main content
Glama

cache

Manage cache operations for Android development, including clearing data, viewing statistics, and configuring settings to optimize performance.

Instructions

Manage the cache. See rtfm for details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
keyNoKey to clear (optional)
configNo

Implementation Reference

  • The handleCacheTool function processes the cache operation requests by delegating to the CacheManager instance.
    export async function handleCacheTool(
      input: CacheInput,
      cache: CacheManager
    ): Promise<Record<string, unknown>> {
      switch (input.operation) {
        case "get-stats":
          return { stats: cache.getStats() };
    
        case "clear":
          if (input.key) {
            cache.clear(input.key);
            return { cleared: input.key };
          } else {
            cache.clearAll();
            return { cleared: "all" };
          }
    
        case "get-config":
          return { config: cache.getConfig() };
    
        case "set-config":
          if (input.config) {
            cache.setConfig(input.config);
          }
          return { config: cache.getConfig() };
    
        default:
          throw new ReplicantError(
            ErrorCode.INVALID_OPERATION,
            `Unknown operation: ${input.operation}`,
            "Valid operations: get-stats, clear, get-config, set-config",
          );
      }
    }
  • Zod schema for validating the cache tool input.
    export const cacheInputSchema = z.object({
      operation: z.enum(["get-stats", "clear", "get-config", "set-config"]),
      key: z.string().optional(),
      config: z.object({
        maxEntries: z.number().optional(),
        maxEntrySizeBytes: z.number().optional(),
        defaultTtlMs: z.number().optional(),
      }).optional(),
    });
  • Definition of the 'cache' tool for MCP registration.
    export const cacheToolDefinition = {
      name: "cache",
      description: "Manage the cache. See rtfm for details.",
      inputSchema: {
        type: "object",
        properties: {
          operation: {
            type: "string",
            enum: ["get-stats", "clear", "get-config", "set-config"],
          },
          key: { type: "string", description: "Key to clear (optional)" },
          config: {
            type: "object",
            properties: {
              maxEntries: { type: "number" },
              maxEntrySizeBytes: { type: "number" },
              defaultTtlMs: { type: "number" },
            },
          },
        },
        required: ["operation"],
      },
      annotations: {
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: false,
        openWorldHint: false,
      },
    };
Behavior1/5

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

No annotations are provided, yet the description fails to disclose critical behavioral traits: the 'clear' operation is destructive, 'set-config' modifies persistent state, and the tool likely requires specific permissions. The description does not mention side effects, idempotency, or what cache system is targeted.

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

Conciseness2/5

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

While brief (two sentences), the description is not effectively front-loaded. The second sentence ('See rtfm for details') wastes space by offloading documentation responsibility, and the first lacks the specificity needed for a tool with destructive operations.

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

Completeness1/5

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

Given the tool supports destructive operations (clear), configuration mutations, and has nested configuration objects with no output schema, the description is grossly incomplete. It fails to explain return values, warn about the 'clear' operation's impact, or clarify the cache's scope.

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

Parameters1/5

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

With only 33% schema description coverage, the description adds no explanatory value for the undocumented 'operation' enum values (what do 'get-stats' or 'set-config' specifically do?) or the nested 'config' object fields (what are valid ranges for maxEntries?). It merely restates the tool's purpose without parameter context.

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

Purpose2/5

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

The description states a generic action ('Manage') and resource ('the cache'), but fails to specify which cache (Gradle, ADB, or emulator) given the Android development context of sibling tools. It borders on tautology with the tool name 'cache' and lacks specificity about the management scope.

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

Usage Guidelines1/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, nor any prerequisites or warnings. The phrase 'See rtfm for details' defers documentation to another tool rather than offering actual usage guidance within the 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/thecombatwombat/replicant-mcp'

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