Skip to main content
Glama

list_extensions

Retrieve available WooCommerce extensions for testing with QIT. Filter results by name or slug to manage response size.

Instructions

List WooCommerce extensions you have access to test with QIT. Use 'search' parameter to filter results and reduce response size.

⚠️ 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
searchNoSearch/filter extensions by name or slug (recommended to reduce response size)
limitNoMaximum number of extensions to return (default: 20, use higher values only when needed)

Implementation Reference

  • The async handler function that implements the core logic of the 'list_extensions' tool: executes QIT CLI command, parses tabular output into structured extensions list, applies filtering and limiting, and formats a user-friendly text response.
    handler: async (args: { search?: string; limit?: number }) => {
      const result = await executeQitCommand(["extensions", "--no-interaction"]);
    
      if (!result.success) {
        return {
          content: result.stderr || result.stdout || "Failed to list extensions",
          isError: true,
        };
      }
    
      // Parse table output format: | ID | Slug | Type |
      const lines = result.stdout.split("\n");
      let extensions: Array<{ id: string; slug: string; type: string }> = [];
    
      for (const line of lines) {
        // Skip header, separator lines, and empty lines
        if (!line.startsWith("|") || line.includes("---") || line.includes(" ID ")) {
          continue;
        }
    
        const parts = line.split("|").map(p => p.trim()).filter(p => p);
        if (parts.length >= 3) {
          extensions.push({
            id: parts[0],
            slug: parts[1],
            type: parts[2],
          });
        }
      }
    
      const totalCount = extensions.length;
    
      // Filter by search term if provided
      if (args.search) {
        const searchLower = args.search.toLowerCase();
        extensions = extensions.filter(ext =>
          ext.slug.toLowerCase().includes(searchLower)
        );
      }
    
      // Apply limit (default 20 to prevent huge responses)
      const limit = args.limit ?? 20;
      const limited = extensions.slice(0, limit);
      const hasMore = extensions.length > limit;
    
      // Text format - compact representation
      const outputLines = limited.map(ext => `- ${ext.slug} (${ext.type})`);
    
      let output = `Extensions (showing ${limited.length} of ${extensions.length}`;
      if (args.search) output += ` matching "${args.search}"`;
      output += `, ${totalCount} total):\n${outputLines.join("\n")}`;
    
      if (hasMore) {
        output += `\n\n... and ${extensions.length - limit} more. Use 'limit' parameter to see more or 'search' to filter.`;
      }
    
      return { content: output, isError: false };
    },
  • Tool name, description, and Zod input schema defining optional parameters: 'search' (string for filtering) and 'limit' (number for max results).
    name: "list_extensions",
    description:
      "List WooCommerce extensions you have access to test with QIT. Use 'search' parameter to filter results and reduce response size.",
    inputSchema: z.object({
      search: z
        .string()
        .optional()
        .describe("Search/filter extensions by name or slug (recommended to reduce response size)"),
      limit: z
        .number()
        .optional()
        .describe("Maximum number of extensions to return (default: 20, use higher values only when needed)"),
    }),
  • Aggregates all tool modules into a single 'allTools' object by spreading 'utilitiesTools' (which contains 'list_extensions') along with other tool sets; this object is imported and used by the MCP server for tool listing and execution.
    export const allTools = {
      ...authTools,
      ...testExecutionTools,
      ...testResultsTools,
      ...groupsTools,
      ...environmentTools,
      ...packagesTools,
      ...configTools,
      ...utilitiesTools,
    };
  • src/server.ts:24-87 (registration)
    MCP server request handlers for listing tools (using Object.entries(allTools)) and calling tools (lookup by name in allTools, validate inputSchema, invoke handler); this registers 'list_extensions' with the Model Context Protocol server.
    // List available tools
    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 };
    });
    
    // Handle tool calls
    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?

No annotations are provided, so the description carries the full burden. It mentions filtering with the 'search' parameter to reduce response size, which adds some behavioral context, but it doesn't disclose other traits like rate limits, authentication needs, or what the output looks like. The CLI installation warning is irrelevant to tool behavior and doesn't compensate for missing transparency.

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

Conciseness1/5

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

The description is poorly structured and not front-loaded. The first sentence is relevant, but it's followed by a lengthy, irrelevant CLI installation warning that doesn't belong in a tool description. This wastes space and distracts from the tool's purpose, making it inefficient and cluttered.

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 simple read operation with 2 parameters, the description is incomplete. It lacks details on authentication requirements, output format, or error handling. The CLI warning adds noise instead of useful context, failing to compensate for the missing structured information.

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 ('search' and 'limit') with descriptions. The description adds minimal value by mentioning the 'search' parameter for filtering, but it doesn't provide additional meaning beyond what the schema states. Baseline 3 is appropriate as the schema does the heavy lifting.

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 'List WooCommerce extensions you have access to test with QIT', which provides a clear verb ('List') and resource ('WooCommerce extensions'), but it doesn't distinguish this from sibling tools like 'list_environments', 'list_packages', or 'list_tests'. The purpose is understandable but lacks sibling differentiation.

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 includes a brief note to 'Use 'search' parameter to filter results and reduce response size', which gives some implied usage guidance, but it doesn't explicitly state when to use this tool versus alternatives like 'list_packages' or 'list_tests'. No exclusions or clear context are provided, making it minimal guidance.

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