twist_inbox_archive
Archive specific threads in Twist workspaces by providing the thread ID. Use this tool to declutter and organize your Twist inbox efficiently.
Instructions
Archives a thread.
Args: id: The ID of the thread to archive
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/inbox.py:100-122 (handler)The main handler function for the 'twist_inbox_archive' tool. It takes a thread ID and sends a POST request to the Twist API's inbox/archive endpoint to archive the specified thread.def twist_inbox_archive( ctx: Context, id: int ) -> str: """Archives a thread. Args: id: The ID of the thread to archive """ token = ctx.request_context.lifespan_context.twist_token params = {"id": id} try: logger.info(f"Archiving thread with ID: {id}") result = twist_request("inbox/archive", params=params, token=token, method="POST") logger.info(f"Successfully archived thread with ID: {id}") return f"Successfully archived thread with ID: {id}" except Exception as error: logger.error(f"Error archiving thread: {error}") return f"Error archiving thread: {str(error)}"
- main.py:42-48 (registration)Dynamic registration loop that registers all functions starting with 'twist_' from src.inbox (including twist_inbox_archive) and src.threads modules as MCP tools using FastMCP.tool() decorator.# 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)