clickup_get_task
Retrieve a specific task from ClickUp using its unique task ID to access task details and information.
Instructions
Get a task by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Implementation Reference
- src/controllers/task.controller.ts:29-35 (handler)Executes the tool logic: destructures task_id from input, calls taskService.getTask(task_id), returns response as text content.handler: async (input) => { const { task_id } = input; const response = await taskService.getTask(task_id); return { content: [{ type: "text", text: JSON.stringify(response) }], }; },
- Defines the tool name, description, and input schema requiring 'task_id' as string.name: "clickup_get_task", description: "Get a task by its ID", inputSchema: { task_id: z.string(), },
- src/services/task.service.ts:34-38 (helper)Core helper method that performs the HTTP request to ClickUp API to fetch the task by ID.async getTask(taskId: string): Promise<ClickUpTask> { return this.request<ClickUpTask>( `/task/${taskId}?custom_task_ids=false&team_id=${this.workspaceId}&include_subtasks=true&include_markdown_description=true` ); }
- src/index.ts:89-91 (registration)Registers the clickup_get_task tool (included in the tools array) to the MCP server using server.tool().tools.forEach((tool) => { server.tool(tool.name, tool.description, tool.inputSchema, tool.handler); });
- src/controllers/task.controller.ts:23-36 (registration)Defines the tool object using defineTool utility, which is later exported and registered.const getTaskTool = defineTool((z) => ({ name: "clickup_get_task", description: "Get a task by its ID", inputSchema: { task_id: z.string(), }, handler: async (input) => { const { task_id } = input; const response = await taskService.getTask(task_id); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }, }));