archive_list
Archive a list in Remember The Milk to remove it from active view. Input the list name to archive and receive updated list details.
Instructions
Archive a list.
Args: list_name: Name of the list to archive
Returns: Updated list details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/rtm_mcp/tools/lists.py:188-230 (handler)The archive_list tool handler. Looks up a list by name (case-insensitive), calls rtm.lists.archive API, and returns the archived list details with a transaction ID for undo support.
async def archive_list( ctx: Context, list_name: str, ) -> dict[str, Any]: """Archive a list. Args: list_name: Name of the list to archive Returns: Updated list details """ from ..client import RTMClient client: RTMClient = await get_client() lists_result = await client.call("rtm.lists.getList") lists = parse_lists_response(lists_result) list_id = None for lst in lists: if lst["name"].lower() == list_name.lower(): list_id = lst["id"] break if not list_id: return build_response(data={"error": f"List not found: {list_name}"}) result = await client.call( "rtm.lists.archive", require_timeline=True, list_id=list_id, ) lst = result.get("list", {}) return build_response( data={ "list": format_list(lst), "message": f"Archived list: {list_name}", }, transaction_id=get_transaction_id(result), ) - src/rtm_mcp/tools/lists.py:233-276 (handler)The unarchive_list tool handler (inverse operation). Same lookup logic, calls rtm.lists.unarchive API.
async def unarchive_list( ctx: Context, list_name: str, ) -> dict[str, Any]: """Unarchive a list. Args: list_name: Name of the list to unarchive Returns: Updated list details """ from ..client import RTMClient client: RTMClient = await get_client() # Need to include archived lists in search lists_result = await client.call("rtm.lists.getList") lists = parse_lists_response(lists_result) list_id = None for lst in lists: if lst["name"].lower() == list_name.lower(): list_id = lst["id"] break if not list_id: return build_response(data={"error": f"List not found: {list_name}"}) result = await client.call( "rtm.lists.unarchive", require_timeline=True, list_id=list_id, ) lst = result.get("list", {}) return build_response( data={ "list": format_list(lst), "message": f"Unarchived list: {list_name}", }, transaction_id=get_transaction_id(result), ) - src/rtm_mcp/tools/lists.py:15-16 (registration)The register_list_tools function that registers all list tools (including archive_list) via @mcp.tool() decorator. Called from server.py line 104.
def register_list_tools(mcp: Any, get_client: Any) -> None: """Register all list-related tools.""" - src/rtm_mcp/server.py:102-106 (registration)Registration call that wires register_list_tools into the MCP server, which in turn registers archive_list via the @mcp.tool() decorator inside lists.py.
# Register all tools register_task_tools(mcp, get_client) register_list_tools(mcp, get_client) register_note_tools(mcp, get_client) register_utility_tools(mcp, get_client) - The format_list helper used by archive_list to format the response.
def format_list(lst: dict[str, Any]) -> dict[str, Any]: """Format a list for response.""" return { "id": lst.get("id"), "name": lst.get("name"), "smart": lst.get("smart") == "1", "archived": lst.get("archived") == "1", "locked": lst.get("locked") == "1", }