Skip to main content
Glama

get_sections

Retrieve sections from a Todoist project to organize tasks by category or workflow stage. Specify a project ID to filter results.

Instructions

Get sections from a project.

Args:
    project_id: Project ID to get sections from (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'get_sections': registers the tool, checks client, fetches sections via TodoistClient, formats and returns as string list.
    @mcp.tool()
    async def get_sections(project_id: Optional[str] = None) -> str:
        """Get sections from a project.
        
        Args:
            project_id: Project ID to get sections from (optional)
        """
        _check_client()
        
        sections = await todoist_client.get_sections(project_id=project_id)
        
        if not sections:
            return "No sections found."
        
        section_list = []
        for section in sections:
            section_list.append(f"• [{section.id}] {section.name} (Project: {section.project_id})")
        
        return f"Found {len(sections)} sections:\n" + "\n".join(section_list)
  • Core implementation in TodoistClient: makes API GET request to /sections endpoint with optional project_id filter, parses response into TodoistSection models.
    async def get_sections(self, project_id: Optional[str] = None) -> List[TodoistSection]:
        """Get sections, optionally filtered by project."""
        params = {}
        if project_id:
            params["project_id"] = project_id
        
        data = await self._request("GET", "/sections", params=params)
        return [TodoistSection(**section) for section in data]
  • Pydantic model defining the structure of TodoistSection used for response typing and parsing.
    class TodoistSection(BaseModel):
        """Represents a Todoist section."""
        id: str
        project_id: str
        order: int
        name: str
  • @mcp.tool() decorator registers the get_sections function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation, what permissions are needed, how results are returned (e.g., pagination), or error conditions. 'Get' implies reading, but specifics are missing.

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 brief and front-loaded with the main purpose, followed by parameter notes. It avoids redundancy, though the parameter explanation could be more integrated. Overall, it's efficient with minimal waste.

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

Completeness3/5

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

Given the tool has an output schema (which handles return values), the description's gaps in usage guidelines and behavioral transparency are somewhat mitigated. However, for a tool with no annotations and low schema coverage, it should provide more context on behavior and alternatives to be fully complete.

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

Parameters3/5

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

The description adds that 'project_id' is optional, which is useful since the schema has 0% description coverage. However, it doesn't explain what happens when omitted (e.g., returns all sections across projects?) or provide format examples. With low schema coverage, this partial compensation earns a baseline score.

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 verb 'get' and resource 'sections from a project', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_projects' or 'get_tasks', which would require more specific scope definition to earn a 5.

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 is provided about when to use this tool versus alternatives like 'get_projects' or 'get_tasks'. The description mentions the parameter is optional but doesn't explain the implications of providing or omitting it, leaving usage context unclear.

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/dan-bailey/todoist-mcp'

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