get_file_info
Retrieve metadata about a specific file within a remote zip archive by providing the archive URL and filename, enabling targeted file inspection without full download.
Instructions
Get information about a specific file in the remote zip archive.
Args:
url: URL of the remote zip file
filename: Name of the file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| filename | Yes |
Implementation Reference
- remotezip_server.py:38-51 (handler)The handler function for the 'get_file_info' MCP tool. It uses RemoteZip to get file info (size, compressed size) from a remote zip archive given URL and filename.@mcp.tool() async def get_file_info(url: str, filename: str) -> str: """Get information about a specific file in the remote zip archive. Args: url: URL of the remote zip file filename: Name of the file """ try: with RemoteZip(url) as zip_file: info = zip_file.getinfo(filename) return f"Filename: {info.filename}\nSize: {info.file_size} bytes\nCompressed size: {info.compress_size} bytes" except Exception as e: return f"Error getting file info: {str(e)}"