list_files
List files inside remote zip archives from 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, decorated with @mcp.tool() for registration. It takes a URL to a remote zip file, uses RemoteZip to list the files, joins them with newlines, and returns the list or an error message.@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)}"