Skip to main content
Glama
mikemc

Todoist MCP Server

by mikemc

todoist_get_sections

Retrieve sections from a Todoist account to organize tasks by project. Filter sections by project ID for targeted task management and improved workflow efficiency.

Instructions

Get all sections from the user's Todoist account

Args: project_id: Filter sections by project ID (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNo

Implementation Reference

  • The handler function that retrieves all sections from Todoist, optionally filtered by project_id, using batched pagination and returns them as formatted JSON or error message.
    def todoist_get_sections(ctx: Context, project_id: Optional[str] = None) -> str:
        """Get all sections from the user's Todoist account
    
        Args:
            project_id: Filter sections by project ID (optional)
        """
        todoist_client = ctx.request_context.lifespan_context.todoist_client
    
        try:
            logger.info(f"Getting sections{' for project ID: ' + project_id if project_id else ''}")
    
            # Use same pagination pattern as projects for consistency
            sections_iterator = todoist_client.get_sections(project_id=project_id)
            all_sections = []
    
            for section_batch in sections_iterator:
                all_sections.extend(section_batch)
                if len(section_batch) < 200:
                    break
    
            if not all_sections:
                logger.info("No sections found")
                return "No sections found" + (f" in project ID: {project_id}" if project_id else "")
    
            logger.info(f"Retrieved {len(all_sections)} sections")
            return json.dumps([section.to_dict() for section in all_sections], indent=2, default=str)
        except Exception as error:
            logger.error(f"Error getting sections: {error}")
            return f"Error getting sections: {str(error)}"
  • src/main.py:78-78 (registration)
    Registers the todoist_get_sections tool with the MCP server using the FastMCP decorator.
    mcp.tool()(todoist_get_sections)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'gets' data, implying a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, pagination, error handling, or what 'all sections' entails (e.g., if it returns archived sections). This leaves significant gaps for an agent to understand how to invoke it safely and effectively.

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

Conciseness4/5

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

The description is appropriately sized with two sentences: a clear purpose statement and a parameter explanation. It's front-loaded with the main action, and the 'Args' section adds necessary detail without redundancy. There's minimal waste, though it could be slightly more structured (e.g., bullet points).

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

Completeness2/5

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

Given no annotations, 0% schema coverage, and no output schema, the description is incomplete. It covers the basic purpose and one parameter but lacks details on authentication, return values (e.g., structure of sections), error cases, or how it fits with sibling tools. For a retrieval tool in a complex API, this leaves the agent under-informed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining 'project_id' as a filter for sections, which clarifies its optional role beyond the schema's basic type. However, with 1 parameter and no schema descriptions, it doesn't detail format (e.g., string format for ID) or provide examples, leaving the agent with incomplete guidance.

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

Purpose4/5

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

The description clearly states the action ('Get all sections') and resource ('from the user's Todoist account'), making the purpose evident. It distinguishes from 'todoist_get_section' (singular) by implying it retrieves multiple sections, but doesn't explicitly differentiate from other sibling tools like 'todoist_get_projects' or 'todoist_get_tasks'.

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?

The description provides minimal guidance by mentioning an optional 'project_id' filter, but offers no explicit advice on when to use this tool versus alternatives like 'todoist_get_section' (for a single section) or other retrieval tools. There's no mention of prerequisites, typical use cases, or comparisons to siblings.

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

Related 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/mikemc/todoist-mcp-server'

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