Skip to main content
Glama
mikemc
by mikemc

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
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • 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)}"

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