Skip to main content
Glama

get_snapshot

Retrieve a specific web archive snapshot by its ID from ArchiveBox, including archived content results for analysis or restoration.

Instructions

Get a specific Snapshot by abid or id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
snapshot_idYesThe ID or abid of the snapshot
with_archiveresultsNoWhether to include archiveresults

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary MCP tool handler for 'get_snapshot'. This function is decorated with @mcp.tool, defining both the registration and the execution logic. It creates an ArchiveBox API client and calls its get_snapshot method to retrieve the snapshot data.
    @mcp.tool(
        exclude_args=[
            "archivebox_url",
            "username",
            "password",
            "token",
            "api_key",
            "verify",
        ],
        tags={"core"},
    )
    def get_snapshot(
        snapshot_id: str = Field(
            description="The ID or abid of the snapshot",
        ),
        with_archiveresults: bool = Field(
            True, description="Whether to include archiveresults"
        ),
        archivebox_url: str = Field(
            default=os.environ.get("ARCHIVEBOX_URL", None),
            description="The URL of the ArchiveBox instance",
        ),
        username: Optional[str] = Field(
            default=os.environ.get("ARCHIVEBOX_USERNAME", None),
            description="Username for authentication",
        ),
        password: Optional[str] = Field(
            default=os.environ.get("ARCHIVEBOX_PASSWORD", None),
            description="Password for authentication",
        ),
        token: Optional[str] = Field(
            default=os.environ.get("ARCHIVEBOX_TOKEN", None),
            description="Bearer token for authentication",
        ),
        api_key: Optional[str] = Field(
            default=os.environ.get("ARCHIVEBOX_API_KEY", None),
            description="API key for authentication",
        ),
        verify: Optional[bool] = Field(
            default=to_boolean(os.environ.get("ARCHIVEBOX_VERIFY", "True")),
            description="Whether to verify SSL certificates",
        ),
    ) -> dict:
        """
        Get a specific Snapshot by abid or id.
        """
        client = Api(
            url=archivebox_url,
            username=username,
            password=password,
            token=token,
            api_key=api_key,
            verify=verify,
        )
        response = client.get_snapshot(
            snapshot_id=snapshot_id,
            with_archiveresults=with_archiveresults,
        )
        return response.json()
  • Pydantic Field definitions for the input schema of the get_snapshot tool, including descriptions and defaults.
    snapshot_id: str = Field(
        description="The ID or abid of the snapshot",
    ),
    with_archiveresults: bool = Field(
        True, description="Whether to include archiveresults"
    ),
    archivebox_url: str = Field(
        default=os.environ.get("ARCHIVEBOX_URL", None),
        description="The URL of the ArchiveBox instance",
    ),
    username: Optional[str] = Field(
        default=os.environ.get("ARCHIVEBOX_USERNAME", None),
        description="Username for authentication",
    ),
    password: Optional[str] = Field(
        default=os.environ.get("ARCHIVEBOX_PASSWORD", None),
        description="Password for authentication",
    ),
    token: Optional[str] = Field(
        default=os.environ.get("ARCHIVEBOX_TOKEN", None),
        description="Bearer token for authentication",
    ),
    api_key: Optional[str] = Field(
        default=os.environ.get("ARCHIVEBOX_API_KEY", None),
        description="API key for authentication",
    ),
    verify: Optional[bool] = Field(
        default=to_boolean(os.environ.get("ARCHIVEBOX_VERIFY", "True")),
        description="Whether to verify SSL certificates",
    ),
  • Helper method in the Api class that performs the actual HTTP GET request to the ArchiveBox API endpoint /api/v1/core/snapshot/{snapshot_id} to fetch the snapshot data.
    @require_auth
    def get_snapshot(
        self, snapshot_id: str, with_archiveresults: bool = True
    ) -> requests.Response:
        """
        Get a specific Snapshot by abid or id
    
        Args:
            snapshot_id: The ID or abid of the snapshot.
            with_archiveresults: Whether to include archiveresults (default: True).
    
        Returns:
            Response: The response object from the GET request.
    
        Raises:
            ParameterError: If the provided parameters are invalid.
        """
        try:
            response = self._session.get(
                url=f"{self.url}/api/v1/core/snapshot/{snapshot_id}",
                params={"with_archiveresults": with_archiveresults},
                headers=self.headers,
                verify=self.verify,
            )
        except ValidationError as e:
            raise ParameterError(f"Invalid parameters: {e.errors()}")
        return response
  • Utility helper function used to convert string environment variables to boolean for the 'verify' parameter.
    def to_boolean(string: Union[str, bool] = None) -> bool:
        if isinstance(string, bool):
            return string
        if not string:
            return False
        normalized = str(string).strip().lower()
        true_values = {"t", "true", "y", "yes", "1"}
        false_values = {"f", "false", "n", "no", "0"}
        if normalized in true_values:
            return True
        elif normalized in false_values:
            return False
        else:
            raise ValueError(f"Cannot convert '{string}' to boolean")
  • The @mcp.tool decorator registers the get_snapshot function as an MCP tool, excluding certain auth args from the tool schema and tagging it as 'core'.
    @mcp.tool(
        exclude_args=[
            "archivebox_url",
            "username",
            "password",
            "token",
            "api_key",
            "verify",
        ],
        tags={"core"},
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool 'Get[s]' a snapshot, implying a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what 'with_archiveresults' entails beyond the schema. This leaves gaps for a tool with parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Get a specific Snapshot') without unnecessary details. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no nested objects) and the presence of an output schema (which handles return values), the description is reasonably complete. It specifies the resource and key parameter, though it lacks behavioral context and usage guidelines, which are minor gaps in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no meaning beyond the schema—it mentions 'abid or id' which aligns with 'snapshot_id' but doesn't clarify differences or provide additional context. Baseline 3 is appropriate as the schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('a specific Snapshot'), specifying it retrieves by 'abid or id'. It distinguishes from sibling 'get_snapshots' (plural) by focusing on a single snapshot, but doesn't explicitly contrast with 'get_any' or 'get_archiveresults'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'get_snapshots' (for listing) or 'get_archiveresults' (for specific archive data). The description implies usage for retrieving a single snapshot by identifier, but lacks explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Knuckles-Team/archivebox-api'

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