Skip to main content
Glama
mikemc
by mikemc

twist_threads_mark_read

Mark Twist threads as read to manage your inbox by specifying thread ID and last read message index.

Instructions

Marks the thread as being read.

Args: id: The id of the thread obj_index: The index of the last known read message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
obj_indexYes

Implementation Reference

  • The handler function that implements the tool logic: marks a specific thread as read up to a given comment index by calling the Twist API.
    def twist_threads_mark_read(
        ctx: Context,
        id: int,
        obj_index: int
    ) -> str:
        """Marks the thread as being read.
    
        Args:
            id: The id of the thread
            obj_index: The index of the last known read message
        """
        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}
    
        try:
            logger.info(f"Marking thread with ID: {id} as read up to comment index: {obj_index}")
            twist_request("threads/mark_read", params=params, token=token, method="POST")
            logger.info(f"Successfully marked thread with ID: {id} as read")
            return f"Successfully marked thread with ID: {id} as read up to comment index: {obj_index}"
        except Exception as error:
            logger.error(f"Error marking thread as read: {error}")
            return f"Error marking thread as read: {str(error)}"
  • main.py:43-47 (registration)
    Dynamic registration loop that registers all functions starting with 'twist_' from src.threads (including twist_threads_mark_read) as MCP tools using mcp.tool().
    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. It states the action ('Marks the thread as being read') but doesn't disclose behavioral traits like whether this requires specific permissions, if it's idempotent, what happens if the thread is already read, or any rate limits. The description is minimal and misses key operational details.

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 and front-loaded, with the core purpose stated first followed by parameter details. It avoids unnecessary words, though the structure could be slightly improved by integrating the Args more seamlessly. Every sentence adds value, but it's very brief.

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 of a mutation tool with no annotations and no output schema, the description is incomplete. It covers the basic action and parameters but lacks information on behavioral aspects (e.g., side effects, error conditions) and return values. For a tool that modifies state, this leaves significant gaps for an AI agent.

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 description includes an 'Args' section that explains both parameters: 'id' as 'The id of the thread' and 'obj_index' as 'The index of the last known read message'. With schema description coverage at 0%, this adds significant meaning beyond the bare schema, clarifying the purpose of each parameter. However, it doesn't detail format constraints (e.g., integer ranges) or examples.

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 tool's purpose with a specific verb ('Marks') and resource ('the thread as being read'), distinguishing it from siblings like twist_threads_mark_unread or twist_threads_clear_unread. However, it doesn't explicitly differentiate from twist_inbox_mark_all_read or twist_threads_mark_all_read, which are broader operations.

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 like twist_threads_mark_all_read (for all threads) or twist_threads_clear_unread (which might have similar functionality). The description lacks context about prerequisites, such as whether the thread must be unread first, or exclusions.

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