Skip to main content
Glama

get_task

Retrieve a specific Todoist task using its unique ID to access task details and information for management purposes.

Instructions

Get a specific task by ID.

Args: task_id: The ID of the task to retrieve

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes

Implementation Reference

  • The handler function for the 'get_task' MCP tool. It is decorated with @mcp.tool() for automatic registration and implements the tool logic by calling the TodoistClient and formatting the response as a string.
    @mcp.tool() async def get_task(task_id: str) -> str: """Get a specific task by ID. Args: task_id: The ID of the task to retrieve """ _check_client() task = await todoist_client.get_task(task_id) return ( f"Task: {task.content}\n" f"ID: {task.id}\n" f"Description: {task.description}\n" f"Completed: {task.is_completed}\n" f"Priority: {task.priority}\n" f"Labels: {', '.join(task.labels) if task.labels else 'None'}\n" f"Due: {task.due_string or task.due_date or 'None'}\n" f"Project ID: {task.project_id}\n" f"URL: {task.url}" )
  • The underlying helper method in TodoistClient that fetches a specific task from the Todoist API and parses it into a TodoistTask model.
    async def get_task(self, task_id: str) -> TodoistTask: """Get a specific task by ID.""" data = await self._request("GET", f"/tasks/{task_id}") return TodoistTask(**data)
  • Pydantic model defining the structure and validation for TodoistTask objects used in the get_task implementation.
    class TodoistTask(BaseModel): """Represents a Todoist task.""" id: str content: str description: str = "" is_completed: bool = False labels: List[str] = [] priority: int = 1 due_string: Optional[str] = None due_date: Optional[str] = None project_id: str = "" section_id: Optional[str] = None parent_id: Optional[str] = None order: int = 0 url: str = "" created_at: str = ""

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