Skip to main content
Glama

extract_file

Extract specific files from remote zip archives without downloading the entire archive. Download individual files from zip files hosted online to your local storage.

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
urlYes
filenameYes
local_pathNo.

Implementation Reference

  • The main handler function for the 'extract_file' tool, decorated with @mcp.tool() for registration. It extracts a specified file from a remote ZIP archive using RemoteZip and saves it to a local path.
    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