list_files
Retrieve file listings from remote zip archives via HTTP, HTTPS, or FTP URLs without downloading the entire archive.
Instructions
Get list of files in a remote zip archive.
Args:
url: URL of the remote zip file (http, https, ftp supported)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- remotezip_server.py:8-20 (handler)The handler function for the 'list_files' tool. It uses the RemoteZip library to open a remote zip file and return a newline-separated list of file names. Includes error handling.@mcp.tool() async def list_files(url: str) -> str: """Get list of files in a remote zip archive. Args: url: URL of the remote zip file (http, https, ftp supported) """ try: with RemoteZip(url) as zip_file: files = zip_file.namelist() return "\n".join(files) except Exception as e: return f"Error listing files: {str(e)}"