Skip to main content
Glama

todoist_label_get

Retrieve all labels from your Todoist account to organize and filter tasks effectively.

Instructions

Get all labels in Todoist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that implements the todoist_label_get tool. Fetches labels from Todoist API using getLabels(), uses caching, formats and returns a human-readable list.
    export async function handleGetLabels( todoistClient: TodoistApi ): Promise<string> { const cacheKey = "labels:all"; const cached = labelCache.get(cacheKey); let labels: TodoistLabel[]; if (cached) { labels = cached; } else { try { const response = await todoistClient.getLabels(); labels = extractArrayFromResponse(response) as TodoistLabel[]; labelCache.set(cacheKey, labels); } catch (error) { throw new TodoistAPIError( "Failed to fetch labels", error instanceof Error ? error : undefined ); } } if (labels.length === 0) { return "No labels found."; } const labelList = labels .map( (label) => `• ${label.name} (ID: ${label.id}${label.color ? `, Color: ${label.color}` : ""})` ) .join("\n"); return `Found ${labels.length} labels:\n${labelList}`; }
  • Tool schema definition for todoist_label_get, specifying name, description, and empty input schema (no parameters required).
    export const GET_LABELS_TOOL: Tool = { name: "todoist_label_get", description: "Get all labels in Todoist", inputSchema: { type: "object", properties: {}, }, };
  • src/index.ts:254-259 (registration)
    Registration and dispatch logic in the main server request handler. Matches tool name, validates args with isGetLabelsArgs, and calls the handleGetLabels function.
    case "todoist_label_get": if (!isGetLabelsArgs(args)) { throw new Error("Invalid arguments for todoist_label_get"); } result = await handleGetLabels(apiClient); break;

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

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