Skip to main content
Glama

extract_file

Extract specific files from remote zip archives over HTTP, HTTPS, or FTP without downloading the entire archive, saving time and bandwidth.

Instructions

Extract a specific file from a remote zip archive to local storage.

Args: url: URL of the remote zip file filename: Name of the file to extract local_path: Local directory to extract to (default: current directory)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
local_pathNo.
urlYes

Implementation Reference

  • The @mcp.tool() decorator registers the extract_file function as an MCP tool.
    @mcp.tool()
  • The extract_file handler function implements the core logic: opens the remote ZIP using RemoteZip, extracts the specified file to the local path, and returns success or error message.
    async def extract_file(url: str, filename: str, local_path: str = ".") -> str: """Extract a specific file from a remote zip archive to local storage. Args: url: URL of the remote zip file filename: Name of the file to extract local_path: Local directory to extract to (default: current directory) """ try: with RemoteZip(url) as zip_file: zip_file.extract(filename, local_path) return f"Extracted {filename} to {local_path}" except Exception as e: return f"Error extracting file: {str(e)}"

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/yuriyo/remotezip-mcp'

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