Skip to main content
Glama
mikemc
by mikemc

twist_inbox_archive_all

Archive all threads in a Twist workspace inbox to reduce clutter, with optional filtering by timestamp to target older conversations.

Instructions

Archives all threads in a workspace.

Args: older_than_ts: Only archives threads that are the same or older than this timestamp

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
older_than_tsNo

Implementation Reference

  • The main handler function that executes the logic to archive all inbox threads in the Twist workspace, optionally filtering by timestamp. It retrieves the token from context, builds params, calls the Twist API via twist_request, and returns success or error message.
    def twist_inbox_archive_all(
        ctx: Context,
        older_than_ts: Optional[int] = None
    ) -> str:
        """Archives all threads in a workspace.
    
        Args:
            older_than_ts: Only archives threads that are the same or older than this timestamp
        """
        token = ctx.request_context.lifespan_context.twist_token
    
        workspace_id = os.getenv("TWIST_WORKSPACE_ID")
        if not workspace_id:
            logger.error("TWIST_WORKSPACE_ID environment variable is required")
            return "Error: TWIST_WORKSPACE_ID environment variable is required"
    
        params = {"workspace_id": workspace_id}
    
        if older_than_ts is not None:
            params["older_than_ts"] = older_than_ts
    
        try:
            logger.info(f"Archiving all inbox threads for workspace ID: {workspace_id}")
    
            result = twist_request("inbox/archive_all", params=params, token=token, method="POST")
    
            logger.info("Successfully archived all inbox threads")
            return "Successfully archived all inbox threads"
        except Exception as error:
            logger.error(f"Error archiving all inbox threads: {error}")
            return f"Error archiving all inbox threads: {str(error)}"
  • main.py:42-48 (registration)
    Dynamic registration of all twist_* functions from src.inbox and src.threads modules as MCP tools using FastMCP.tool() decorator, matching the tool name to the function name 'twist_inbox_archive_all'.
    # Register all tools from tool modules
    for module in [src.inbox, src.threads]:
        for name, func in inspect.getmembers(module, inspect.isfunction):
            if name.startswith('twist_') and func.__module__ == module.__name__:
                logger.info(f"Registering tool: {name}")
                mcp.tool()(func)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Archives all threads') but doesn't cover critical aspects like whether this is reversible (e.g., via 'twist_inbox_unarchive'), what permissions are required, if it's destructive to thread data, or how it handles errors. For a bulk mutation tool with zero annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is appropriately sized with two sentences: one for the main purpose and one for the parameter. It's front-loaded with the core action, and the 'Args:' section is structured but could be more integrated. There's no wasted text, though it could be slightly more polished.

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 the complexity (a bulk archiving tool with mutation), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't address reversibility, permissions, error handling, or what happens to archived threads, leaving the agent with insufficient context for safe and effective use.

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?

The description adds the parameter 'older_than_ts' with a brief explanation ('Only archives threads that are the same or older than this timestamp'), which provides basic semantics. However, with 0% schema description coverage and only 1 parameter documented out of 1, the description compensates minimally but doesn't clarify the timestamp format (e.g., Unix timestamp in seconds/milliseconds) or default behavior when null.

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 verb ('Archives') and resource ('all threads in a workspace'), making the purpose specific and understandable. However, it doesn't explicitly distinguish this tool from its sibling 'twist_inbox_archive', which likely archives individual threads rather than all threads, leaving some ambiguity in sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives like 'twist_inbox_archive' (for single threads) or 'twist_inbox_mark_all_read' (for marking as read instead of archiving). It mentions an optional timestamp filter but doesn't explain when this filtering is appropriate or necessary.

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/mikemc/twist-mcp-server'

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