twist_threads_remove
Delete a thread from Twist workspaces by specifying its ID to manage your inbox content.
Instructions
Removes a thread.
Args: id: The id of the thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/threads.py:161-181 (handler)The handler function implementing the 'twist_threads_remove' tool. It takes a thread ID and sends a POST request to the Twist API 'threads/remove' endpoint to remove the thread.def twist_threads_remove( ctx: Context, id: int ) -> str: """Removes a thread. Args: id: The 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"Removing thread with ID: {id}") twist_request("threads/remove", params=params, token=token, method="POST") logger.info(f"Successfully removed thread with ID: {id}") return f"Successfully removed thread with ID: {id}" except Exception as error: logger.error(f"Error removing thread: {error}") return f"Error removing thread: {str(error)}"