Skip to main content
Glama

get_completed_tasks

Retrieve completed Todoist tasks with filtering by project, section, date range, or other criteria to track productivity and review past work.

Instructions

Get completed tasks from Todoist with filtering options

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoFilter by specific project ID
section_idNoFilter by specific section ID
parent_idNoFilter by specific parent task ID
sinceNoReturn tasks completed since this date (YYYY-MM-DD format)
untilNoReturn tasks completed until this date (YYYY-MM-DD format)
limitNoNumber of tasks to return (max 200)
offsetNoOffset for pagination
annotation_typeNoFilter by annotation type

Implementation Reference

  • Core execution logic of the get_completed_tasks tool: processes input args into params, fetches data via todoistApi.getCompletedTasks, and structures the response.
    async args => {
        const params: Record<string, string> = {};
    
        Object.entries(args).forEach(([key, value]) => {
            if (value !== undefined) {
                params[key] = typeof value === 'number' ? value.toString() : value;
            }
        });
    
        const response = await todoistApi.getCompletedTasks(params);
    
        return {
            completed_tasks: response.items || [],
            projects: response.projects || {},
            sections: response.sections || {},
            total: response.items?.length || 0,
        };
    }
  • Input schema using Zod for validating tool parameters such as project_id, since, until, limit, etc.
    {
        project_id: z.string().optional().describe('Filter by specific project ID'),
        section_id: z.string().optional().describe('Filter by specific section ID'),
        parent_id: z.string().optional().describe('Filter by specific parent task ID'),
        since: z
            .string()
            .optional()
            .describe('Return tasks completed since this date (YYYY-MM-DD format)'),
        until: z
            .string()
            .optional()
            .describe('Return tasks completed until this date (YYYY-MM-DD format)'),
        limit: z
            .number()
            .int()
            .min(1)
            .max(200)
            .optional()
            .default(50)
            .describe('Number of tasks to return (max 200)'),
        offset: z.number().int().min(0).optional().describe('Offset for pagination'),
        annotation_type: z.string().optional().describe('Filter by annotation type'),
    },
  • Registers the get_completed_tasks tool by calling createHandler with name, description, schema, and handler function.
    createHandler(
        'get_completed_tasks',
        'Get completed tasks from Todoist with filtering options',
        {
            project_id: z.string().optional().describe('Filter by specific project ID'),
            section_id: z.string().optional().describe('Filter by specific section ID'),
            parent_id: z.string().optional().describe('Filter by specific parent task ID'),
            since: z
                .string()
                .optional()
                .describe('Return tasks completed since this date (YYYY-MM-DD format)'),
            until: z
                .string()
                .optional()
                .describe('Return tasks completed until this date (YYYY-MM-DD format)'),
            limit: z
                .number()
                .int()
                .min(1)
                .max(200)
                .optional()
                .default(50)
                .describe('Number of tasks to return (max 200)'),
            offset: z.number().int().min(0).optional().describe('Offset for pagination'),
            annotation_type: z.string().optional().describe('Filter by annotation type'),
        },
        async args => {
            const params: Record<string, string> = {};
    
            Object.entries(args).forEach(([key, value]) => {
                if (value !== undefined) {
                    params[key] = typeof value === 'number' ? value.toString() : value;
                }
            });
    
            const response = await todoistApi.getCompletedTasks(params);
    
            return {
                completed_tasks: response.items || [],
                projects: response.projects || {},
                sections: response.sections || {},
                total: response.items?.length || 0,
            };
        }
    );
  • Helper method in TodoistClient that performs the actual API call to retrieve completed tasks using Todoist's sync v9 /completed/get_all endpoint.
    async getCompletedTasks(params: Record<string, string> = {}): Promise<any> {
        const url = `${API_SYNC_BASE_URL}/completed/get_all`;
    
        log(
            `Making completed tasks request to: ${url} with params:`,
            JSON.stringify(params, null, 2)
        );
    
        const formData = new URLSearchParams();
        for (const [key, value] of Object.entries(params)) {
            if (value) {
                formData.append(key, value);
            }
        }
    
        const response = await fetch(url, {
            method: 'POST',
            headers: {
                Authorization: `Bearer ${this.apiToken}`,
                'Content-Type': 'application/x-www-form-urlencoded',
                'X-Request-Id': uuidv4(),
            },
            body: formData.toString(),
        });
    
        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 but offers minimal information. It doesn't mention whether this is a read-only operation, how results are returned (e.g., pagination details beyond schema), authentication requirements, rate limits, or error conditions. The phrase 'filtering options' hints at functionality but lacks behavioral specifics.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose ('Get completed tasks from Todoist'). It avoids redundancy and wastes no words, though it could be slightly more structured by explicitly mentioning key filtering capabilities.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain return values, error handling, or behavioral nuances like pagination behavior (implied by offset/limit but not described). The agent would need to rely heavily on the schema alone, missing contextual guidance.

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

Parameters3/5

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

The schema description coverage is 100%, with all 8 parameters well-documented in the schema itself. The description adds no additional parameter semantics beyond mentioning 'filtering options', which is already covered by the schema. This meets the baseline of 3 when schema coverage is high.

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 completed tasks') and resource ('from Todoist'), making the purpose immediately understandable. It distinguishes itself from siblings like 'get_tasks' by specifying 'completed' tasks, though it doesn't explicitly contrast with other filtering tools like 'get_tasks_list'.

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 like 'get_tasks' or 'get_tasks_list'. It mentions 'filtering options' but doesn't specify when this tool is preferred over other task-retrieval methods, leaving the agent to infer usage context.

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