twist_threads_unpin
Remove a thread from pinned status in Twist workspaces by specifying its ID, helping users organize their workspace by managing pinned content.
Instructions
Unpins a thread.
Args: id: The id of the thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/threads.py:249-269 (handler)The handler function that executes the unpin logic by calling the Twist API 'threads/unpin' endpoint with the provided thread ID.def twist_threads_unpin( ctx: Context, id: int ) -> str: """Unpins 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"Unpinning thread with ID: {id}") twist_request("threads/unpin", params=params, token=token, method="POST") logger.info(f"Successfully unpinned thread with ID: {id}") return f"Successfully unpinned thread with ID: {id}" except Exception as error: logger.error(f"Error unpinning thread: {error}") return f"Error unpinning thread: {str(error)}"
- main.py:42-47 (registration)Dynamically discovers and registers all functions starting with 'twist_' from src.threads and src.inbox modules as MCP tools, including 'twist_threads_unpin'.# Register all tools from tool modules for module in [src.inbox, src.threads]: for name, func in inspect.getmembers(module, inspect.isfunction): if name.startswith('twist_') and func.__module__ == module.__name__: logger.info(f"Registering tool: {name}") mcp.tool()(func)