Skip to main content
Glama
mikemc
by mikemc

twist_inbox_get_count

Retrieve the current count of unread messages in your Twist workspace inbox to monitor pending conversations.

Instructions

Gets inbox count in a workspace for the authenticated user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that retrieves the inbox count for the workspace using the Twist API.
    def twist_inbox_get_count(
        ctx: Context
    ) -> Union[str, dict]:
        """Gets inbox count in a workspace for the authenticated user.
        """
        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}
    
        try:
            logger.info(f"Getting inbox count for workspace ID: {workspace_id}")
    
            count_data = twist_request("inbox/get_count", params=params, token=token)
    
            if not count_data:
                logger.info("Failed to get inbox count")
                return "Failed to get inbox count"
    
            logger.info(f"Retrieved inbox count: {count_data}")
            return count_data
        except Exception as error:
            logger.error(f"Error getting inbox count: {error}")
            return f"Error getting inbox count: {str(error)}"
  • main.py:42-48 (registration)
    Dynamically registers all functions starting with 'twist_' from src.inbox and src.threads modules as MCP tools, including twist_inbox_get_count.
    # 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 full burden. It states it's a read operation ('Gets') and implies authentication, but lacks details on rate limits, error handling, or return format. This is inadequate for a tool with zero annotation coverage.

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, making it easy to scan and understand quickly.

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?

Given the tool's low complexity (0 parameters, no output schema) and lack of annotations, the description is minimally adequate. It covers the basic purpose but misses behavioral details like response format or error cases, which are needed for full completeness.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents inputs. The description doesn't need to add parameter details, and it correctly implies no inputs are required, aligning with the 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 action ('Gets') and resource ('inbox count'), specifying it's for a workspace and authenticated user. It distinguishes from siblings like twist_inbox_get (which likely retrieves inbox items) by focusing on count retrieval, though not explicitly contrasting them.

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 is provided on when to use this tool versus alternatives. It doesn't mention when to prefer this over twist_inbox_get or other inbox-related tools, nor does it specify prerequisites or exclusions, leaving usage context implied.

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