Skip to main content
Glama
mikemc
by mikemc

twist_threads_update

Modify an existing thread by updating its content, title, attachments, or mentions within Twist workspaces.

Instructions

Updates an existing thread.

Args: id: The id of the thread actions: List of action buttons to the thread attachments: List of attachments to the thread content: The content of the thread direct_group_mentions: The groups that are directly mentioned direct_mentions: The users that are directly mentioned title: The title of the thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
actionsNo
attachmentsNo
contentNo
direct_group_mentionsNo
direct_mentionsNo
titleNo

Implementation Reference

  • The core handler function for the 'twist_threads_update' tool. It collects parameters, authenticates using the context token, calls the Twist API 'threads/update' endpoint via twist_request, and handles success/error responses.
    def twist_threads_update(
        ctx: Context,
        id: int,
        actions: Optional[List[Dict[str, Any]]] = None,
        attachments: Optional[List[Dict[str, Any]]] = None,
        content: Optional[str] = None,
        direct_group_mentions: Optional[List[int]] = None,
        direct_mentions: Optional[List[int]] = None,
        title: Optional[str] = None
    ) -> Union[str, Dict[str, Any]]:
        """Updates an existing thread.
    
        Args:
            id: The id of the thread
            actions: List of action buttons to the thread
            attachments: List of attachments to the thread
            content: The content of the thread
            direct_group_mentions: The groups that are directly mentioned
            direct_mentions: The users that are directly mentioned
            title: The title 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"Updating thread with ID: {id}")
            thread_data = twist_request("threads/update", params=params, token=token, method="POST")
            logger.info(f"Updated thread with ID: {id}")
            return thread_data
        except Exception as error:
            logger.error(f"Error updating thread: {error}")
            return f"Error updating thread: {str(error)}"

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