Skip to main content
Glama

cli_add

Add URLs to an ArchiveBox web archive with options for crawling depth, tagging, updating snapshots, and customizing extraction methods.

Instructions

Execute archivebox add command.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsYesList of URLs to archive
tagNoComma-separated tags
depthNoCrawl depth
updateNoUpdate existing snapshots
update_allNoUpdate all snapshots
index_onlyNoIndex without archiving
overwriteNoOverwrite existing files
initNoInitialize collection if needed
extractorsNoComma-separated list of extractors to use
parserNoParser typeauto
extra_dataNoAdditional parameters as a dictionary

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The cli_add MCP tool handler, registered with @mcp.tool decorator. Defines input schema using Pydantic Field annotations and executes the tool logic by creating an ArchiveBox API client and calling its cli_add method to add URLs for archiving.
    @mcp.tool(
        exclude_args=[
            "archivebox_url",
            "username",
            "password",
            "token",
            "api_key",
            "verify",
        ],
        tags={"cli"},
    )
    def cli_add(
        urls: List[str] = Field(
            description="List of URLs to archive",
        ),
        tag: str = Field("", description="Comma-separated tags"),
        depth: int = Field(0, description="Crawl depth"),
        update: bool = Field(False, description="Update existing snapshots"),
        update_all: bool = Field(False, description="Update all snapshots"),
        index_only: bool = Field(False, description="Index without archiving"),
        overwrite: bool = Field(False, description="Overwrite existing files"),
        init: bool = Field(False, description="Initialize collection if needed"),
        extractors: str = Field(
            "", description="Comma-separated list of extractors to use"
        ),
        parser: str = Field("auto", description="Parser type"),
        extra_data: Optional[Dict] = Field(
            None, description="Additional parameters as a dictionary"
        ),
        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:
        """
        Execute archivebox add command.
        """
        client = Api(
            url=archivebox_url,
            username=username,
            password=password,
            token=token,
            api_key=api_key,
            verify=verify,
        )
        response = client.cli_add(
            urls=urls,
            tag=tag,
            depth=depth,
            update=update,
            update_all=update_all,
            index_only=index_only,
            overwrite=overwrite,
            init=init,
            extractors=extractors,
            parser=parser,
            extra_data=extra_data,
        )
        return response.json()
  • Helper method in the ArchiveBox API client class that performs the actual HTTP POST request to the ArchiveBox server's /api/v1/cli/add endpoint to add URLs.
    def cli_add(
        self,
        urls: List[str],
        tag: str = "",
        depth: int = 0,
        update: bool = False,
        update_all: bool = False,
        index_only: bool = False,
        overwrite: bool = False,
        init: bool = False,
        extractors: str = "",
        parser: str = "auto",
        extra_data: Optional[Dict] = None,
    ) -> requests.Response:
        """
        Execute archivebox add command
    
        Args:
            urls: List of URLs to archive.
            tag: Comma-separated tags (default: "").
            depth: Crawl depth (default: 0).
            update: Update existing snapshots (default: False).
            update_all: Update all snapshots (default: False).
            index_only: Index without archiving (default: False).
            overwrite: Overwrite existing files (default: False).
            init: Initialize collection if needed (default: False).
            extractors: Comma-separated list of extractors to use (default: "").
            parser: Parser type (default: "auto").
            extra_data: Additional parameters as a dictionary (optional).
    
        Returns:
            Response: The response object from the POST request.
    
        Raises:
            ParameterError: If the provided parameters are invalid.
        """
        data = {
            "urls": urls,
            "tag": tag,
            "depth": depth,
            "update": update,
            "update_all": update_all,
            "index_only": index_only,
            "overwrite": overwrite,
            "init": init,
            "extractors": extractors,
            "parser": parser,
        }
        if extra_data:
            data.update(extra_data)
        try:
            response = self._session.post(
                url=f"{self.url}/api/v1/cli/add",
                json=data,
                headers=self.headers,
                verify=self.verify,
            )
        except ValidationError as e:
            raise ParameterError(f"Invalid parameters: {e.errors()}")
        return response
  • MCP prompt helper that generates instructional text referencing the cli_add tool for adding URLs.
    @mcp.prompt
    def cli_add_prompt(
        urls: List[str],
        tag: str = "",
        depth: int = 0,
    ) -> str:
        """
        Generates a prompt for executing archivebox add command.
        """
        return f"Add new URLs to ArchiveBox: {urls}, with tags: '{tag}', depth: {depth}. Use the cli_add tool."
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. 'Execute archivebox add command' implies a write/mutation operation but doesn't disclose what gets created/changed, whether it's idempotent, what permissions are needed, or what side effects occur. For a tool with 11 parameters that presumably modifies an archive system, this is insufficient behavioral disclosure.

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?

Extremely concise single sentence with zero wasted words. The description is front-loaded with the essential action. While it's under-informative, it's not verbose or poorly structured.

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

Completeness2/5

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

Given this is a complex tool with 11 parameters, no annotations, and presumably modifies an archive system, the description is incomplete. While an output schema exists (which helps), the description doesn't explain what the tool actually does, when to use it, or its behavioral characteristics. For a mutation tool of this complexity, more context is needed.

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 already documents all 11 parameters thoroughly. The description adds no parameter information beyond what's in the schema - it doesn't explain relationships between parameters (like how update and update_all interact) or provide usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description 'Execute archivebox add command' states the action (execute) and target (archivebox add command), but is vague about what the command actually does - it doesn't specify that this adds URLs to the archive or creates snapshots. It doesn't distinguish from siblings like cli_list or cli_remove beyond the command name.

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. There's no mention of when to choose cli_add over cli_update or cli_schedule, nor any prerequisites or typical use cases. The description provides only the bare command execution instruction.

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