get_zip_statistics
Retrieve statistics about remote zip archives by URL, including file details and archive information without downloading the entire file.
Instructions
Get statistics about the remote zip archive.
Args:
url: URL of the remote zip file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- remotezip_server.py:53-68 (handler)The main handler function for the get_zip_statistics tool. It is registered via the @mcp.tool() decorator. Computes total number of files, uncompressed size, and compressed size from a remote ZIP archive using RemoteZip library.@mcp.tool() async def get_zip_statistics(url: str) -> str: """Get statistics about the remote zip archive. Args: url: URL of the remote zip file """ try: with RemoteZip(url) as zip_file: files = zip_file.infolist() total_files = len(files) total_size = sum(info.file_size for info in files) total_compressed = sum(info.compress_size for info in files) return f"Total files: {total_files}\nTotal uncompressed size: {total_size} bytes\nTotal compressed size: {total_compressed} bytes" except Exception as e: return f"Error getting statistics: {str(e)}"