Skip to main content
Glama

get_labels_list

Retrieve all personal labels from Todoist to organize tasks and manage projects effectively.

Instructions

Get all personal labels from Todoist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for the get_labels_list tool. This anonymous function is generated by createApiHandler and executes todoistApi.get('/labels', {}) since no parameters are required, retrieving the list of personal labels from Todoist REST API.
    const handler = async (args: z.infer<z.ZodObject<T>>): Promise<R> => {
        let finalPath = options.path;
        const pathParams: Record<string, string> = {};
    
        // Extract path parameters (e.g., {id}) and replace them with actual values
        const pathParamRegex = /{([^}]+)}/g;
        let match;
    
        while ((match = pathParamRegex.exec(options.path)) !== null) {
            const fullMatch = match[0]; // e.g., "{id}"
            const paramName = match[1]; // e.g., "id"
    
            if (args[paramName] === undefined) {
                throw new Error(`Path parameter ${paramName} is required but not provided`);
            }
    
            // Validate and encode path parameter using the centralized security function
            const safeParamValue = validatePathParameter(args[paramName], paramName);
            finalPath = finalPath.replace(fullMatch, safeParamValue);
            pathParams[paramName] = String(args[paramName]);
        }
    
        // Collect non-path parameters for query string or request body
        const otherParams = Object.entries(args).reduce(
            (acc, [key, value]) => {
                if (value !== undefined && !pathParams[key]) {
                    acc[key] = value;
                }
                return acc;
            },
            {} as Record<string, any>
        );
    
        // Apply custom parameter transformation if provided
        const finalParams = options.transformParams ? options.transformParams(args) : otherParams;
    
        // Execute the API request based on HTTP method
        let result;
        switch (options.method) {
            case 'GET':
                result = await todoistApi.get(finalPath, finalParams);
                break;
            case 'POST':
                log('POST', finalPath, finalParams);
                result = await todoistApi.post(finalPath, finalParams);
                break;
            case 'DELETE':
                result = await todoistApi.delete(finalPath);
                break;
        }
    
        // Apply result post-processing if provided
        return options.processResult ? options.processResult(result, args) : result;
    };
  • Tool registration for get_labels_list, specifying name, empty input schema, GET method, and '/labels' path which triggers the Todoist API call for listing labels.
    createApiHandler({
        name: 'get_labels_list',
        description: 'Get all personal labels from Todoist',
        schemaShape: {},
        method: 'GET',
        path: '/labels',
    });
  • Input schema for get_labels_list tool, which is empty object indicating no input parameters are required.
    schemaShape: {},
  • The TodoistClient.get method implementation that performs the actual HTTP GET request to https://api.todoist.com/rest/v2/labels for fetching the labels list.
    async get(endpoint: string, params: Record<string, string> = {}): Promise<any> {
        let url = `${API_BASE_URL}${endpoint}`;
    
        const queryParams = new URLSearchParams();
        for (const [key, value] of Object.entries(params)) {
            if (value) {
                queryParams.append(key, value);
            }
        }
    
        const queryString = queryParams.toString();
        if (queryString) {
            url += `?${queryString}`;
        }
    
        log(`Making GET request to: ${url}`);
    
        const response = await fetch(url, {
            method: 'GET',
            headers: this.getHeaders(),
        });
    
        return this.handleResponse(response);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't specify aspects like authentication needs, rate limits, or what 'personal labels' entails (e.g., scope, format). This leaves significant gaps for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any redundant words. It is front-loaded and appropriately sized for a simple retrieval tool.

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's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, and differentiation from siblings, making it incomplete for optimal agent use without additional context.

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

Parameters4/5

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

The tool has 0 parameters, and the schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have clarified the absence of filters (e.g., no user ID parameter). Baseline is 4 for zero parameters.

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 action ('Get') and resource ('all personal labels from Todoist'), making the purpose unambiguous. However, it doesn't distinguish this tool from sibling tools like 'get_labels' or 'get_shared_labels', which appear to have similar functions, so it falls short of a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives such as 'get_labels' or 'get_shared_labels'. It lacks any mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the name alone.

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

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