Skip to main content
Glama
mikemc
by mikemc

twist_threads_mark_all_read

Mark all threads as read in a Twist workspace or specific channel to clear your notification count and organize your inbox.

Instructions

Marks all threads in the workspace or channel as read.

Args: workspace_id: The id of the workspace channel_id: The id of the channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idNo
channel_idNo

Implementation Reference

  • Handler function that implements the tool logic: marks all threads in specified workspace or channel as read by calling the Twist API endpoint 'threads/mark_all_read'.
    def twist_threads_mark_all_read(
        ctx: Context,
        workspace_id: Optional[int] = None,
        channel_id: Optional[int] = None
    ) -> str:
        """Marks all threads in the workspace or channel as read.
    
        Args:
            workspace_id: The id of the workspace
            channel_id: The id of the channel
        """
        all_params = locals()
        token = ctx.request_context.lifespan_context.twist_token
        params = {k: v for k, v in all_params.items() if k != 'ctx' and v is not None}
    
        if not workspace_id and not channel_id:
            workspace_id = os.getenv("TWIST_WORKSPACE_ID")
            if not workspace_id:
                logger.error("Either workspace_id or channel_id is required")
                return "Error: Either workspace_id or channel_id is required"
            params["workspace_id"] = workspace_id
    
        try:
            if "channel_id" in params:
                logger.info(f"Marking all threads in channel ID: {params['channel_id']} as read")
            else:
                logger.info(f"Marking all threads in workspace ID: {params['workspace_id']} as read")
    
            twist_request("threads/mark_all_read", params=params, token=token, method="POST")
    
            if "channel_id" in params:
                logger.info(f"Successfully marked all threads in channel ID: {params['channel_id']} as read")
                return f"Successfully marked all threads in channel ID: {params['channel_id']} as read"
            else:
                logger.info(f"Successfully marked all threads in workspace ID: {params['workspace_id']} as read")
                return f"Successfully marked all threads in workspace ID: {params['workspace_id']} as read"
        except Exception as error:
            logger.error(f"Error marking all threads as read: {error}")
            return f"Error marking all threads as read: {str(error)}"
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 the action ('marks all threads as read') but lacks critical behavioral details: whether this is reversible, what permissions are required, if it affects user notifications or history, or any side effects. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 efficiently structured with a clear main sentence followed by parameter explanations. Both sentences earn their place by stating the purpose and clarifying parameters, with no redundant or verbose language. It could be slightly improved by integrating parameter details more seamlessly, but it's well-front-loaded and concise.

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 a mutation tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks behavioral context (e.g., effects, permissions), usage guidance relative to siblings, and detailed parameter semantics. The basic purpose and parameter listing are insufficient for safe and effective tool invocation in this context.

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 0%, so the description must compensate. It lists both parameters (workspace_id and channel_id) and explains they identify the workspace or channel, adding basic semantics. However, it doesn't clarify the relationship between them (e.g., if both can be null, if channel_id implies workspace_id, or the scope when only one is provided), leaving ambiguity despite covering the parameters.

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 ('marks all threads as read') and specifies the scope ('in the workspace or channel'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'twist_threads_mark_read' (singular) or 'twist_inbox_mark_all_read', leaving some ambiguity about when to choose this specific tool.

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. It doesn't mention sibling tools like 'twist_threads_mark_read' (for individual threads) or 'twist_inbox_mark_all_read' (for inbox vs threads), nor does it specify prerequisites, exclusions, or contextual triggers for choosing this bulk operation.

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