Skip to main content
Glama
hofill
by hofill

list_files

Retrieve all stored file responses to access captured web request data for inspection and management.

Instructions

List all file responses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual list_files implementation in RequestrepoMCPService class. Retrieves all file responses from the requestrepo client and returns a dictionary with count and serialized file data.
    def list_files(self) -> dict[str, Any]:
        files = self._client().files()
        return {
            "count": len(files),
            "files": {
                path: serialize_file_response(response, decode_base64=False, max_bytes=self.config.max_bytes)
                for path, response in files.items()
            },
        }
  • MCP tool registration for list_files using @mcp.tool() decorator. This function exposes the list_files functionality through the MCP protocol by delegating to resolved_service.list_files().
    @mcp.tool()
    def list_files() -> dict[str, Any]:
        """List all file responses."""
        return resolved_service.list_files()
  • The serialize_file_response helper function used by list_files to convert Response objects into dictionaries containing raw_base64, headers, status_code, and optionally raw_decoded data.
    def serialize_file_response(
        response: Response,
        *,
        decode_base64: bool,
        max_bytes: int,
    ) -> dict[str, Any]:
        payload: dict[str, Any] = {
            "raw_base64": response.raw,
            "headers": [serialize_header(header) for header in response.headers],
            "status_code": response.status_code,
        }
        if decode_base64:
            try:
                decoded = base64.b64decode(response.raw, validate=True)
            except binascii.Error as exc:
                payload["raw_decoded"] = None
                payload["decode_error"] = str(exc)
            else:
                payload["raw_decoded"] = bytes_envelope(decoded, max_bytes=max_bytes)
        return payload

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/hofill/RequestRepo-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server