Skip to main content
Glama

manage_package

Publish, download, scaffold, delete, or show QIT test packages for WordPress/WooCommerce plugin testing workflows.

Instructions

Manage QIT test packages. Actions: publish, download, scaffold, delete, show

⚠️ 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
actionYesThe package management action to perform
package_nameNoFull package ID with version (e.g., 'namespace/name:version'). Required for download, show, delete actions.
pathNoPath for scaffold output or package location
typeNoPackage type for scaffold action
jsonNoReturn output in JSON format

Implementation Reference

  • The main handler function implementing the 'manage_package' tool. It handles different actions by setting up CLI commands and flags, then executes them using shared executor functions.
    handler: async (args: {
      action: (typeof packageActions)[number];
      package_name?: string;
      path?: string;
      type?: "e2e" | "utility";
      json?: boolean;
    }) => {
      let command: string;
      let positional: string[] = [];
      const flags: Record<string, string | boolean | undefined> = {
        json: args.json,
      };
    
      switch (args.action) {
        case "publish":
          command = "package:publish";
          if (args.path) positional.push(args.path);
          break;
    
        case "download":
          command = "package:download";
          if (args.package_name) positional.push(args.package_name);
          if (args.path) flags.output = args.path;
          break;
    
        case "scaffold":
          command = "package:scaffold";
          if (args.package_name) positional.push(args.package_name);
          if (args.type) flags.type = args.type;
          if (args.path) flags.output = args.path;
          break;
    
        case "delete":
          command = "package:delete";
          if (args.package_name) positional.push(args.package_name);
          break;
    
        case "show":
          command = "package:show";
          if (args.package_name) positional.push(args.package_name);
          break;
    
        default:
          return {
            content: `Unknown action: ${args.action}`,
            isError: true,
          };
      }
    
      const cmdArgs = buildArgs(command, positional, flags);
      return executeAndFormat(cmdArgs);
    },
  • Zod input schema defining parameters for the manage_package tool: action (enum), package_name, path, type, json.
    inputSchema: z.object({
      action: z
        .enum(packageActions)
        .describe("The package management action to perform"),
      package_name: z
        .string()
        .optional()
        .describe("Full package ID with version (e.g., 'namespace/name:version'). Required for download, show, delete actions."),
      path: z
        .string()
        .optional()
        .describe("Path for scaffold output or package location"),
      type: z
        .enum(["e2e", "utility"])
        .optional()
        .describe("Package type for scaffold action"),
      json: z
        .boolean()
        .optional()
        .describe("Return output in JSON format"),
    }),
  • Local tool object definition and export within packagesTools, including name, description, schema, and handler.
    manage_package: {
      name: "manage_package",
      description: `Manage QIT test packages. Actions: ${packageActions.join(", ")}`,
      inputSchema: z.object({
        action: z
          .enum(packageActions)
          .describe("The package management action to perform"),
        package_name: z
          .string()
          .optional()
          .describe("Full package ID with version (e.g., 'namespace/name:version'). Required for download, show, delete actions."),
        path: z
          .string()
          .optional()
          .describe("Path for scaffold output or package location"),
        type: z
          .enum(["e2e", "utility"])
          .optional()
          .describe("Package type for scaffold action"),
        json: z
          .boolean()
          .optional()
          .describe("Return output in JSON format"),
      }),
      handler: async (args: {
        action: (typeof packageActions)[number];
        package_name?: string;
        path?: string;
        type?: "e2e" | "utility";
        json?: boolean;
      }) => {
        let command: string;
        let positional: string[] = [];
        const flags: Record<string, string | boolean | undefined> = {
          json: args.json,
        };
    
        switch (args.action) {
          case "publish":
            command = "package:publish";
            if (args.path) positional.push(args.path);
            break;
    
          case "download":
            command = "package:download";
            if (args.package_name) positional.push(args.package_name);
            if (args.path) flags.output = args.path;
            break;
    
          case "scaffold":
            command = "package:scaffold";
            if (args.package_name) positional.push(args.package_name);
            if (args.type) flags.type = args.type;
            if (args.path) flags.output = args.path;
            break;
    
          case "delete":
            command = "package:delete";
            if (args.package_name) positional.push(args.package_name);
            break;
    
          case "show":
            command = "package:show";
            if (args.package_name) positional.push(args.package_name);
            break;
    
          default:
            return {
              content: `Unknown action: ${args.action}`,
              isError: true,
            };
        }
    
        const cmdArgs = buildArgs(command, positional, flags);
        return executeAndFormat(cmdArgs);
      },
    },
  • Registration of packagesTools (containing manage_package) into the central allTools object by spreading.
    export const allTools = {
      ...authTools,
      ...testExecutionTools,
      ...testResultsTools,
      ...groupsTools,
      ...environmentTools,
      ...packagesTools,
  • src/server.ts:25-38 (registration)
    MCP server lists all tools from allTools, converting Zod schemas to JSON schema for the protocol.
    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 };
    });
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It mentions that QIT CLI is required and gives installation steps, which is useful context about dependencies. However, it doesn't describe what each action does (e.g., what 'publish' entails, if 'delete' is destructive), the tool's permissions, rate limits, or output format, leaving significant gaps for a multi-action tool.

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 and not front-loaded. It starts with a brief purpose, then devotes most space to CLI installation warnings and instructions unrelated to tool usage. This wastes sentences that don't help an agent invoke the tool, making it inefficient and cluttered despite moderate length.

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 (5 parameters, multiple actions) and lack of annotations and output schema, the description is incomplete. It misses critical details like what each action does, behavioral implications (e.g., destructive operations), and output expectations, leaving the agent under-informed for proper tool selection and invocation.

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 all five parameters well. The description adds no additional meaning about parameters beyond listing the actions, which are covered by the 'action' enum. This meets the baseline of 3, as the schema does the heavy lifting without description compensation needed.

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 the tool 'Manage[s] QIT test packages' and lists five specific actions, which provides a clear general purpose. However, it doesn't specify what a 'QIT test package' is or how this differs from sibling tools like 'list_packages' or 'validate_zip', leaving some ambiguity about its exact scope and 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 provides no guidance on when to use this tool versus alternatives like 'list_packages' or other package-related tools. It includes installation instructions for QIT CLI, but these are prerequisites rather than usage context, failing to help an agent decide between this and sibling tools.

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