Skip to main content
Glama
mikemc
by mikemc

twist_threads_mark_unread

Mark Twist threads as unread to track messages for later review or follow-up. Specify thread ID and message index to control unread status.

Instructions

Marks the thread as being unread.

Args: id: The id of the thread obj_index: The index of the last unread message. A value of -1 marks the whole thread as unread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
obj_indexYes

Implementation Reference

  • The main handler function that executes the tool logic: extracts parameters, calls the Twist API 'threads/mark_unread' endpoint via twist_request, and returns success/error messages.
    def twist_threads_mark_unread(
        ctx: Context,
        id: int,
        obj_index: int
    ) -> str:
        """Marks the thread as being unread.
    
        Args:
            id: The id of the thread
            obj_index: The index of the last unread message. A value of -1 marks the whole thread as unread
        """
        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 unread from comment index: {obj_index}")
            twist_request("threads/mark_unread", params=params, token=token, method="POST")
            logger.info(f"Successfully marked thread with ID: {id} as unread")
            return f"Successfully marked thread with ID: {id} as unread from comment index: {obj_index}"
        except Exception as error:
            logger.error(f"Error marking thread as unread: {error}")
            return f"Error marking thread as unread: {str(error)}"
  • main.py:42-48 (registration)
    Dynamically registers all functions starting with 'twist_' from src.threads (and inbox) modules as MCP tools using FastMCP's mcp.tool() decorator.
    # 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 the action ('marks unread') but doesn't disclose behavioral traits like whether this affects notifications, requires specific permissions, has side effects on other users, or what happens on success/failure. The parameter explanation adds some context but not enough for a mutation tool.

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: a purpose statement and parameter explanations. It's front-loaded with the main action. The parameter section is necessary given the 0% schema coverage, though the formatting could be slightly cleaner.

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 this is a mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It explains parameters well but lacks information about behavioral aspects, return values, error conditions, or how this interacts with the sibling tools in the context.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for both parameters: 'id' as the thread identifier and 'obj_index' with detailed explanation including the special value -1 for marking the whole thread unread. This adds significant meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the purpose ('Marks the thread as being unread') which is clear but vague about scope. It distinguishes from obvious opposites like 'mark_read' but doesn't differentiate from similar tools like 'twist_threads_clear_unread' or 'twist_threads_mark_unread_for_others' in the sibling list.

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 on when to use this tool versus alternatives is provided. The description doesn't mention when this should be used instead of 'twist_threads_clear_unread' or 'twist_threads_mark_unread_for_others', nor does it specify any prerequisites or context for usage.

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