Skip to main content
Glama

decompress

Extract ZIP file contents to a specified directory with options for password-protected archives, overwriting files, and creating output directories.

Instructions

Decompress local ZIP file to specified directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesZIP file path to decompress
outputYesOutput directory path
optionsNo

Implementation Reference

  • Handler logic for the "decompress" tool using AdmZip to extract ZIP files.
    case "decompress": {
      const input = args.input as string;
      const output = args.output as string;
      const options = (args.options as any) || {};
    
      if (!fs.existsSync(input)) {
        throw new Error(`ZIP file does not exist: ${input}`);
      }
    
      if (options.createDirectories && !fs.existsSync(output)) {
        fs.mkdirSync(output, { recursive: true });
      }
    
      if (!fs.existsSync(output)) {
        throw new Error(`Output directory does not exist: ${output}`);
      }
    
      const zip = new AdmZip(input);
    
      zip.extractAllTo(output, options.overwrite || false);
    
      const entries = zip.getEntries();
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                success: true,
                output: output,
                filesExtracted: entries.length,
                files: entries.map((e) => e.entryName),
              },
              null,
              2,
            ),
          },
        ],
      };
    }
  • Schema definition for the "decompress" tool in the listTools request handler.
      name: "decompress",
      description: "Decompress local ZIP file to specified directory",
      inputSchema: {
        type: "object",
        properties: {
          input: {
            type: "string",
            description: "ZIP file path to decompress",
          },
          output: {
            type: "string",
            description: "Output directory path",
          },
          options: {
            type: "object",
            properties: {
              overwrite: {
                type: "boolean",
                description: "Overwrite existing files",
              },
              password: {
                type: "string",
                description: "Password for encrypted ZIP",
              },
              createDirectories: {
                type: "boolean",
                description: "Create output directory if it doesn't exist",
              },
            },
          },
        },
        required: ["input", "output"],
      },
    },
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic function. It doesn't disclose behavioral traits such as error handling (e.g., if input path is invalid), side effects (e.g., file system changes), performance implications, or output format. This leaves significant gaps for a tool that modifies local files.

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 that front-loads the core purpose without unnecessary words. It directly communicates the tool's function in a compact form, making it easy to parse.

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 (file system mutation, multiple parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavior, error cases, output expectations, and usage context, which are critical for safe and effective tool invocation by an AI agent.

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 67%, with parameters 'input' and 'output' well-described in the schema, but 'options' object properties (overwrite, password, createDirectories) are documented. The description adds no parameter semantics beyond the schema, so it meets the baseline for moderate coverage without compensating for gaps.

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 clearly states the action ('decompress') and resource ('local ZIP file'), specifying the target ('to specified directory'). It distinguishes from sibling 'compress' by indicating the opposite operation, though it doesn't explicitly differentiate from 'getZipInfo' (which inspects rather than extracts).

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?

No guidance is provided on when to use this tool versus alternatives like 'getZipInfo' (for inspection) or 'compress' (for the reverse operation). The description implies usage for extracting ZIP files but offers no context about prerequisites, error conditions, or when not to use it.

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/loscolmebrothers/zip-mcp'

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