Skip to main content
Glama
yuriyo

RemoteZip MCP Server

by yuriyo

get_zip_statistics

Analyze remote ZIP archive statistics to understand file counts, sizes, and structure without downloading the entire archive.

Instructions

Get statistics about the remote zip archive.

Args:
    url: URL of the remote zip file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • The main handler function for the 'get_zip_statistics' tool. It uses RemoteZip to access the zip archive at the given URL, retrieves the file info list, calculates total number of files, total uncompressed size, and total compressed size, then returns a formatted string with these statistics. Includes error handling.
    @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)}"

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