add_list
Create a new list in Remember The Milk, optionally with a filter to generate a smart list.
Instructions
Create a new list.
Args: name: Name for the new list filter: Optional RTM filter to make this a smart list
Returns: Created list details with transaction ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| filter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/rtm_mcp/tools/lists.py:56-91 (handler)The handler function for the 'add_list' tool. Creates a new RTM list by calling rtm.lists.add with the provided name and optional filter, returns the created list details with a transaction ID.
@mcp.tool() async def add_list( ctx: Context, name: str, filter: str | None = None, ) -> dict[str, Any]: """Create a new list. Args: name: Name for the new list filter: Optional RTM filter to make this a smart list Returns: Created list details with transaction ID """ from ..client import RTMClient client: RTMClient = await get_client() params: dict[str, Any] = {"name": name} if filter: params["filter"] = filter result = await client.call("rtm.lists.add", require_timeline=True, **params) # Parse the created list lst = result.get("list", {}) transaction_id = get_transaction_id(result) return build_response( data={ "list": format_list(lst), "message": f"Created list: {name}", }, transaction_id=transaction_id, ) - src/rtm_mcp/tools/lists.py:57-61 (schema)Schema/type definition for add_list: takes 'name' (str, required) and 'filter' (str | None, optional), returns a dict.
async def add_list( ctx: Context, name: str, filter: str | None = None, ) -> dict[str, Any]: - src/rtm_mcp/server.py:104-104 (registration)Registration of all list tools (including add_list) via register_list_tools called in server.py.
register_list_tools(mcp, get_client) - src/rtm_mcp/tools/lists.py:15-91 (registration)The registration function that decorates add_list as an MCP tool via @mcp.tool() inside register_list_tools.
def register_list_tools(mcp: Any, get_client: Any) -> None: """Register all list-related tools.""" @mcp.tool() async def get_lists( ctx: Context, include_archived: bool = False, include_smart: bool = True, ) -> dict[str, Any]: """Get all RTM lists. Args: include_archived: Include archived lists (default: false) include_smart: Include smart lists (default: true) Returns: List of all lists with metadata """ from ..client import RTMClient client: RTMClient = await get_client() result = await client.call("rtm.lists.getList") lists = parse_lists_response(result) # Filter based on preferences if not include_archived: lists = [lst for lst in lists if not lst["archived"]] if not include_smart: lists = [lst for lst in lists if not lst["smart"]] # Sort by position lists.sort(key=lambda x: (x["position"] if x["position"] >= 0 else 9999, x["name"])) return build_response( data={ "lists": [format_list(lst) for lst in lists], "count": len(lists), }, ) @mcp.tool() async def add_list( ctx: Context, name: str, filter: str | None = None, ) -> dict[str, Any]: """Create a new list. Args: name: Name for the new list filter: Optional RTM filter to make this a smart list Returns: Created list details with transaction ID """ from ..client import RTMClient client: RTMClient = await get_client() params: dict[str, Any] = {"name": name} if filter: params["filter"] = filter result = await client.call("rtm.lists.add", require_timeline=True, **params) # Parse the created list lst = result.get("list", {}) transaction_id = get_transaction_id(result) return build_response( data={ "list": format_list(lst), "message": f"Created list: {name}", }, transaction_id=transaction_id, ) - src/rtm_mcp/tools/lists.py:7-12 (helper)Helper imports used by add_list: build_response, format_list, get_transaction_id, and parse_lists_response from the response builder module.
from ..response_builder import ( build_response, format_list, get_transaction_id, parse_lists_response, )