todoist_get_section
Retrieve details of a specific section from Todoist using the section ID, enabling efficient task organization and management through the Todoist MCP Server.
Instructions
Get a single section from Todoist
Args: section_id: ID of the section to retrieve
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| section_id | Yes |
Implementation Reference
- src/sections.py:40-61 (handler)The handler function that executes the core logic of the todoist_get_section tool. It retrieves a specific Todoist section by its ID using the Todoist API client from the context and returns the section data as JSON.def todoist_get_section(ctx: Context, section_id: str) -> str: """Get a single section from Todoist Args: section_id: ID of the section to retrieve """ todoist_client = ctx.request_context.lifespan_context.todoist_client try: logger.info(f"Getting section with ID: {section_id}") section = todoist_client.get_section(section_id=section_id) if not section: logger.info(f"No section found with ID: {section_id}") return f"No section found with ID: {section_id}" logger.info(f"Retrieved section: {section.id}") return json.dumps(section.to_dict(), indent=2, default=str) except Exception as error: logger.error(f"Error getting section: {error}") return f"Error getting section: {str(error)}"
- src/main.py:79-79 (registration)The registration of the todoist_get_section tool using the FastMCP decorator, which automatically generates the tool schema from the function signature and docstring.mcp.tool()(todoist_get_section)
- src/main.py:19-25 (registration)Import statement that brings the todoist_get_section handler into the main.py scope for registration.from .sections import ( todoist_get_sections, todoist_get_section, todoist_add_section, todoist_update_section, todoist_delete_section, )