Skip to main content
Glama
mikemc
by mikemc

twist_threads_add

Create a new discussion thread in a Twist channel with title, content, attachments, and customizable notifications for users and groups.

Instructions

Adds a new thread to a channel.

Args: channel_id: The id of the channel title: The title of the new thread content: The content of the new thread actions: List of action buttons to the new thread attachments: List of attachments to the new thread direct_group_mentions: The groups that are directly mentioned direct_mentions: The users that are directly mentioned groups: The groups that will be notified recipients: An array of users that will be attached to the thread or "EVERYONE" send_as_integration: Displays the integration as the thread creator temp_id: The temporary id of the thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
titleYes
contentYes
actionsNo
attachmentsNo
direct_group_mentionsNo
direct_mentionsNo
groupsNo
recipientsNo
send_as_integrationNo
temp_idNo

Implementation Reference

  • Handler function that implements the twist_threads_add tool by calling the Twist API endpoint 'threads/add' with the provided parameters.
    def twist_threads_add(
        ctx: Context,
        channel_id: int,
        title: str,
        content: str,
        actions: Optional[List[Dict[str, Any]]] = None,
        attachments: Optional[List[Dict[str, Any]]] = None,
        direct_group_mentions: Optional[List[int]] = None,
        direct_mentions: Optional[List[int]] = None,
        groups: Optional[List[int]] = None,
        recipients: Optional[Union[List[int], str]] = None,
        send_as_integration: Optional[bool] = None,
        temp_id: Optional[int] = None
    ) -> Union[str, Dict[str, Any]]:
        """Adds a new thread to a channel.
    
        Args:
            channel_id: The id of the channel
            title: The title of the new thread
            content: The content of the new thread
            actions: List of action buttons to the new thread
            attachments: List of attachments to the new thread
            direct_group_mentions: The groups that are directly mentioned
            direct_mentions: The users that are directly mentioned
            groups: The groups that will be notified
            recipients: An array of users that will be attached to the thread or "EVERYONE"
            send_as_integration: Displays the integration as the thread creator
            temp_id: The temporary id of the thread
        """
        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"Adding thread to channel ID: {channel_id}")
            thread_data = twist_request("threads/add", params=params, token=token, method="POST")
            logger.info(f"Added thread with ID: {thread_data.get('id')}")
            return thread_data
        except Exception as error:
            logger.error(f"Error adding thread: {error}")
            return f"Error adding thread: {str(error)}"
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the tool creates a thread but doesn't disclose permissions needed, rate limits, whether it's idempotent, what happens on failure, or the response format. This is inadequate for a mutation 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.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The structure is clear with a purpose statement followed by parameter list, but it's verbose with 11 parameter lines. Some descriptions like 'The title of the new thread' are redundant, and the format could be more streamlined without sacrificing clarity.

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?

For a mutation tool with 11 parameters, no annotations, and no output schema, the description is incomplete. It lacks behavioral context (e.g., error handling, side effects), usage guidelines, and output details, leaving significant gaps for an AI agent to operate effectively.

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 lists all 11 parameters with brief explanations, adding significant value beyond the schema which has 0% description coverage. It clarifies purposes like 'The id of the channel' for channel_id and 'Displays the integration as the thread creator' for send_as_integration, though some explanations could be more detailed (e.g., what 'actions' entail).

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 'Adds' and resource 'new thread to a channel', making the purpose specific and understandable. However, it doesn't differentiate from sibling tools like 'twist_threads_update' or 'twist_threads_move_to_channel', which would require explicit comparison for a perfect 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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, when not to use it, or refer to sibling tools like 'twist_threads_update' for modifying existing threads or 'twist_threads_move_to_channel' for relocation.

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