Skip to main content
Glama

manage_cache

Manipulate QIT cache data by getting, setting, or deleting key-value pairs with optional expiration control for WordPress/WooCommerce testing workflows.

Instructions

Low-level QIT cache manipulation. For refreshing cache data, use sync_cache instead.

⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:

  1. Via Composer (recommended): composer require woocommerce/qit-cli --dev

  2. Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit

  3. Ensure 'qit' is available in your system PATH

For more information, visit: https://github.com/woocommerce/qit-cli

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesCache action: get (retrieve), set (store), or delete (remove)
keyYesThe cache key to operate on
valueNoThe value to store (required for 'set' action)
expirationNoExpiration time in seconds (optional for 'set' action)

Implementation Reference

  • The main handler function for the 'manage_cache' tool. It builds QIT CLI command arguments based on the provided action, key, optional value, and expiration, then executes the command using executeAndFormat.
    handler: async (args: {
      action: "get" | "set" | "delete";
      key: string;
      value?: string;
      expiration?: number;
    }) => {
      // CLI uses positional args: cache <action> <key> [<value> [<expiration>]]
      const cmdArgs = ["cache", args.action, args.key];
    
      if (args.action === "set") {
        if (!args.value) {
          return {
            content: "Error: 'value' is required for 'set' action",
            isError: true,
          };
        }
        cmdArgs.push(args.value);
        if (args.expiration !== undefined) {
          cmdArgs.push(String(args.expiration));
        }
      }
    
      return executeAndFormat(cmdArgs);
    },
  • Zod input schema defining parameters for the 'manage_cache' tool: action (get/set/delete), key, optional value, and optional expiration.
    inputSchema: z.object({
      action: z
        .enum(["get", "set", "delete"])
        .describe("Cache action: get (retrieve), set (store), or delete (remove)"),
      key: z.string().describe("The cache key to operate on"),
      value: z
        .string()
        .optional()
        .describe("The value to store (required for 'set' action)"),
      expiration: z
        .number()
        .optional()
        .describe("Expiration time in seconds (optional for 'set' action)"),
    }),
  • src/server.ts:25-38 (registration)
    MCP server request handler for listing tools, which includes 'manage_cache' by mapping over allTools (imported from tools/index.js). Converts Zod schemas to JSON schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      // Check if QIT CLI is available
      const cliInfo = detectQitCli();
    
      const tools = Object.entries(allTools).map(([_, tool]) => ({
        name: tool.name,
        description: cliInfo
          ? tool.description
          : `${tool.description}\n\n⚠️ QIT CLI not detected. ${getQitCliNotFoundError()}`,
        inputSchema: zodToJsonSchema(tool.inputSchema),
      }));
    
      return { tools };
    });
  • src/server.ts:41-87 (registration)
    MCP server request handler for calling tools, which looks up 'manage_cache' handler from allTools by name, validates arguments with its schema, executes the handler, and formats the response.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      const tool = allTools[name as ToolName];
    
      if (!tool) {
        return {
          content: [
            {
              type: "text",
              text: `Unknown tool: ${name}`,
            },
          ],
          isError: true,
        };
      }
    
      try {
        // Validate input
        const validatedArgs = tool.inputSchema.parse(args);
    
        // Execute tool
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        const result = await (tool.handler as (args: any) => Promise<{ content: string; isError: boolean }>)(validatedArgs);
    
        return {
          content: [
            {
              type: "text",
              text: result.content,
            },
          ],
          isError: result.isError,
        };
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${message}`,
            },
          ],
          isError: true,
        };
      }
    });
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. It mentions 'low-level manipulation' but doesn't explain what that means operationally (e.g., direct key-value operations vs higher-level abstractions). The CLI warning adds installation context but doesn't describe tool behavior like error handling, performance characteristics, or side effects. For a mutation tool (set/delete actions) with zero annotation coverage, this is insufficient.

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?

The description is poorly structured with significant wasted content. The first sentence is useful, but the lengthy CLI installation warning (7 lines) belongs in documentation or error messages, not in a tool description for AI agents. This creates noise and buries the actual usage guidance. The description is not appropriately sized for its purpose.

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?

For a cache manipulation tool with 4 parameters, no annotations, and no output schema, the description is incomplete. While it provides some usage guidance, it lacks crucial information about what the tool returns, error conditions, or behavioral details needed for proper invocation. The CLI warning doesn't compensate for these gaps in tool semantics.

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 all parameters well-documented in the schema itself (action with enum values, key, value, expiration). The description adds no parameter information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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 states 'Low-level QIT cache manipulation' which identifies the resource (QIT cache) and general action (manipulation), but 'manipulation' is vague compared to the specific actions in the schema (get, set, delete). It distinguishes from sibling 'sync_cache' for refreshing, but doesn't fully clarify what 'low-level manipulation' entails versus other cache-related tools.

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

Usage Guidelines5/5

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

The description explicitly provides when-not-to-use guidance: 'For refreshing cache data, use sync_cache instead.' This clearly distinguishes from a sibling tool and helps the agent choose between alternatives. The warning about QIT CLI installation also implies prerequisites for usage.

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/woocommerce/qit-mcp'

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