Skip to main content
Glama

get_lists

Retrieve all Remember The Milk lists with options to include archived and smart lists. Returns metadata for each list.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_archivedNo
include_smartNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the get_lists tool. Defined as an async function decorated with @mcp.tool() inside register_list_tools. It calls the RTM API method rtm.lists.getList, parses the response using parse_lists_response, filters based on include_archived and include_smart parameters, sorts by position, and returns a formatted response using build_response and format_list helpers.
    @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),
            },
        )
  • Registration of all list tools (including get_lists) via register_list_tools(mcp, get_client) call in the main server module.
    register_task_tools(mcp, get_client)
    register_list_tools(mcp, get_client)
  • parse_lists_response helper function that parses the raw RTM API response (result['lists']['list']) into a structured list of dicts with id, name, deleted, locked, archived, position, smart, filter, and sort_order fields.
    def parse_lists_response(result: dict[str, Any]) -> list[dict[str, Any]]:
        """Parse RTM lists response."""
        lists = result.get("lists", {}).get("list", [])
        if isinstance(lists, dict):
            lists = [lists]
    
        return [
            {
                "id": lst.get("id"),
                "name": lst.get("name"),
                "deleted": lst.get("deleted") == "1",
                "locked": lst.get("locked") == "1",
                "archived": lst.get("archived") == "1",
                "position": int(lst.get("position", -1)),
                "smart": lst.get("smart") == "1",
                "filter": lst.get("filter"),
                "sort_order": lst.get("sort_order"),
            }
            for lst in lists
        ]
  • format_list helper function that formats a single list dict from RTM into a cleaner response format with id, name, smart (bool), archived (bool), and locked (bool).
    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",
        }
  • RTMList Pydantic model (schema) for type-safe representation of an RTM list, used as a data model for list-related tool responses.
    class RTMList(BaseModel):
        """An RTM list."""
    
        id: str
        name: str
        deleted: bool = False
        locked: bool = False
        archived: bool = False
        position: int = -1
        smart: bool = False
        sort_order: int | None = None
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Indicates a read operation but does not explicitly state safety or side effects. Adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Highly concise with clear structure: one-line purpose, args, and returns. Every part is essential.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers scope (all lists), parameters, and return type. With output schema present, no further details needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage 0% but description explains both parameters with defaults and behavior, compensating for lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Get all RTM lists' with specific verb and resource. Distinguishes from sibling tools like add_list, delete_list, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as get_groups or list_tasks. Lacks context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ljadach/rtm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server