Skip to main content
Glama
mikemc
by mikemc

twist_inbox_get

Retrieve your Twist inbox threads with filters for date ranges, archive status, ordering, and exclusions to manage conversations.

Instructions

Get the authenticated user's inbox.

Args: limit: Limits the number of threads returned (default is 30, maximum is 500) newer_than_ts: Limits threads to those newer when the specified Unix time older_than_ts: Limits threads to those older when the specified Unix time archive_filter: Filter threads based on their is_archived flag: 'all', 'archived', or 'active' (default) order_by: Order of threads: 'desc' (default) or 'asc', based on last_updated attribute exclude_thread_ids: Thread IDs to exclude from results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
newer_than_tsNo
older_than_tsNo
archive_filterNo
order_byNo
exclude_thread_idsNo

Implementation Reference

  • The core handler function that implements the logic for retrieving the user's inbox threads from the Twist API, including parameter handling and error management.
    def twist_inbox_get(
        ctx: Context,
        limit: Optional[int] = None,
        newer_than_ts: Optional[int] = None,
        older_than_ts: Optional[int] = None,
        archive_filter: Optional[str] = None,
        order_by: Optional[str] = None,
        exclude_thread_ids: Optional[List[int]] = None
    ) -> str:
        """Get the authenticated user's inbox.
    
        Args:
            limit: Limits the number of threads returned (default is 30, maximum is 500)
            newer_than_ts: Limits threads to those newer when the specified Unix time
            older_than_ts: Limits threads to those older when the specified Unix time
            archive_filter: Filter threads based on their is_archived flag: 'all', 'archived', or 'active' (default)
            order_by: Order of threads: 'desc' (default) or 'asc', based on last_updated attribute
            exclude_thread_ids: Thread IDs to exclude from results
        """
        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 limit is not None:
            params["limit"] = limit
        if newer_than_ts is not None:
            params["newer_than_ts"] = newer_than_ts
        if older_than_ts is not None:
            params["older_than_ts"] = older_than_ts
        if archive_filter is not None:
            params["archive_filter"] = archive_filter
        if order_by is not None:
            params["order_by"] = order_by
        if exclude_thread_ids is not None:
            params["exclude_thread_ids"] = exclude_thread_ids
    
        try:
            logger.info(f"Getting inbox for workspace ID: {workspace_id}")
    
            inbox_data = twist_request("inbox/get", params=params, token=token)
    
            if not inbox_data:
                logger.info("No inbox threads found")
                return "No inbox threads found"
    
            logger.info(f"Retrieved {len(inbox_data)} inbox threads")
            return inbox_data
        except Exception as error:
            logger.error(f"Error getting inbox: {error}")
            return f"Error getting inbox: {str(error)}"
  • main.py:42-48 (registration)
    Dynamic registration code that discovers and registers all functions prefixed with 'twist_' from inbox.py and threads.py modules as MCP tools, including twist_inbox_get.
    # 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)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the core functionality (retrieving inbox threads with filtering) and mentions default values, which adds useful context. However, it lacks information about authentication requirements, rate limits, error conditions, or pagination behavior, which are important for a retrieval tool with multiple parameters.

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 well-structured with a clear purpose statement followed by organized parameter documentation. Each parameter explanation is concise and informative. While efficient, the initial purpose statement could be slightly more detailed to better distinguish from sibling tools, but overall it's appropriately sized with minimal waste.

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

Completeness3/5

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

For a retrieval tool with 6 parameters and no output schema, the description provides good parameter documentation but lacks information about the return format, authentication requirements, and error handling. With no annotations and no output schema, the agent needs more context about what to expect from the response and any behavioral constraints.

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

Parameters5/5

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

Given 0% schema description coverage, the description compensates fully by providing detailed parameter documentation. It explains all 6 parameters with clear semantics, including default values, constraints (e.g., 'maximum is 500'), valid values for enums (e.g., 'all', 'archived', 'active'), and usage context (e.g., 'based on last_updated attribute'). This adds significant value beyond the bare schema.

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 ('Get') and resource ("the authenticated user's inbox"), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like twist_inbox_get_count or twist_threads_get, which also retrieve inbox-related data, so it doesn't reach the highest score.

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. With multiple sibling tools for inbox and thread operations (e.g., twist_inbox_get_count, twist_threads_get), there's no indication of when this specific 'get inbox' tool is appropriate versus other retrieval tools, leaving the agent without contextual usage direction.

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