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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| actions | No | ||
| attachments | No | ||
| content | No | ||
| direct_group_mentions | No | ||
| direct_mentions | No | ||
| title | No |
Implementation Reference
- src/threads.py:127-159 (handler)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)}"