Skip to main content
Glama

get_tag

Retrieve a specific tag by its ID or abid from ArchiveBox, including associated snapshots for organized web archive management.

Instructions

Get a specific Tag by id or abid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tag_idYesThe ID or abid of the tag
with_snapshotsNoWhether to include snapshots

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_tag' that creates an ArchiveBox Api client instance with provided credentials and calls its get_tag method to fetch the tag data as JSON.
    def get_tag(
        tag_id: str = Field(
            description="The ID or abid of the tag",
        ),
        with_snapshots: bool = Field(True, description="Whether to include snapshots"),
        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 Tag by id or abid.
        """
        client = Api(
            url=archivebox_url,
            username=username,
            password=password,
            token=token,
            api_key=api_key,
            verify=verify,
        )
        response = client.get_tag(
            tag_id=tag_id,
            with_snapshots=with_snapshots,
        )
        return response.json()
  • Registration of the 'get_tag' tool using FastMCP's @mcp.tool decorator, excluding auth parameters from the tool schema and tagging it as core.
    @mcp.tool(
        exclude_args=[
            "archivebox_url",
            "username",
            "password",
            "token",
            "api_key",
            "verify",
        ],
        tags={"core"},
    )
  • Input schema for the get_tag tool defined using Pydantic Field with descriptions, defaults from environment variables for authentication parameters.
        tag_id: str = Field(
            description="The ID or abid of the tag",
        ),
        with_snapshots: bool = Field(True, description="Whether to include snapshots"),
        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:
  • Supporting Api.get_tag method in the ArchiveBox client class that performs an authenticated HTTP GET request to retrieve the specific tag from the ArchiveBox API endpoint.
    def get_tag(self, tag_id: str, with_snapshots: bool = True) -> requests.Response:
        """
        Get a specific Tag by id or abid
    
        Args:
            tag_id: The ID or abid of the tag.
            with_snapshots: Whether to include snapshots (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/tag/{tag_id}",
                params={"with_snapshots": with_snapshots},
                headers=self.headers,
                verify=self.verify,
            )
        except ValidationError as e:
            raise ParameterError(f"Invalid parameters: {e.errors()}")
        return response
Behavior2/5

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

With no annotations provided, the description carries full burden but reveals little behavior. It doesn't disclose whether this is a read-only operation, what permissions are needed, error conditions, or response format. The mention of 'snapshots' hints at optional data inclusion but lacks detail.

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 with no wasted words. It's front-loaded with the core purpose and includes all necessary information in a compact form.

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 simplicity (fetch by identifier), 100% schema coverage, and presence of an output schema, the description is reasonably complete. However, it lacks behavioral context like error handling or authentication needs, which would be helpful despite the output schema.

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 minimal value beyond the schema—it implies 'tag_id' accepts either ID or abid format, but doesn't explain the difference or provide usage examples.

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 Tag'), and specifies the lookup method ('by id or abid'). It distinguishes from siblings like 'get_any' by focusing on tags, but doesn't explicitly differentiate from other tag-related tools (none are listed).

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 is provided. The description doesn't mention prerequisites, when not to use it, or compare it to sibling tools like 'get_any' or 'get_snapshot'.

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