Skip to main content
Glama
guifelix

MCP Todo.txt Integration

filter-tasks

Filter tasks in Todo.txt files by priority, context, or project to organize and focus on specific work items.

Instructions

Filter tasks by specific criteria (priority, context, project).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
criteriaYes

Implementation Reference

  • The handler function for the 'filter-tasks' tool. It loads all tasks, applies sequential filters based on provided criteria (priority, context, or project), and returns the filtered tasks as a newline-separated string.
    async ({ criteria }) => {
        const tasks = await loadTasks();
        let filteredTasks = tasks;
        if (criteria.priority) {
            filteredTasks = filteredTasks.filter(task => task.priority() === criteria.priority);
        }
        if (criteria.context) {
            filteredTasks = filteredTasks.filter(task => criteria.context && task.contexts().includes(criteria.context));
        }
        if (criteria.project) {
            filteredTasks = filteredTasks.filter(task => criteria.project && task.projects().includes(criteria.project));
        }
        return {
            content: [
                { type: "text", text: filteredTasks.map(task => task.toString()).join("\n") },
            ],
        };
    }
  • Zod input schema for the 'filter-tasks' tool, defining an object with optional string fields for priority, context, and project filters.
    {
        criteria: z.object({
            priority: z.string().optional(),
            context: z.string().optional(),
            project: z.string().optional(),
        }),
    },
  • src/tools.ts:191-219 (registration)
    Registration of the 'filter-tasks' tool using server.tool(), which includes the name, description, input schema, and inline handler function. This occurs within the exported registerTools function.
    server.tool(
        "filter-tasks",
        "Filter tasks by specific criteria (priority, context, project).",
        {
            criteria: z.object({
                priority: z.string().optional(),
                context: z.string().optional(),
                project: z.string().optional(),
            }),
        },
        async ({ criteria }) => {
            const tasks = await loadTasks();
            let filteredTasks = tasks;
            if (criteria.priority) {
                filteredTasks = filteredTasks.filter(task => task.priority() === criteria.priority);
            }
            if (criteria.context) {
                filteredTasks = filteredTasks.filter(task => criteria.context && task.contexts().includes(criteria.context));
            }
            if (criteria.project) {
                filteredTasks = filteredTasks.filter(task => criteria.project && task.projects().includes(criteria.project));
            }
            return {
                content: [
                    { type: "text", text: filteredTasks.map(task => task.toString()).join("\n") },
                ],
            };
        }
    );
  • index.ts:48-48 (registration)
    Top-level call to registerTools on the MCP server instance, which in turn registers the 'filter-tasks' tool among others.
    registerTools(server, loadTasks, TODO_FILE_PATH);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool filters tasks but doesn't reveal whether it's read-only, destructive, requires authentication, has rate limits, or what the output looks like. For a tool with no annotation coverage, this is a significant gap in transparency.

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: 'Filter tasks by specific criteria (priority, context, project).' It is front-loaded with the core purpose and includes key details without any wasted words, making it highly concise and well-structured.

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?

Given the tool's complexity (1 parameter with nested objects), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on behavioral traits, output format, and usage context, making it inadequate for the agent to fully understand how to invoke and interpret results.

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 description lists the criteria fields (priority, context, project), which adds meaning beyond the input schema's 0% description coverage. However, it doesn't explain how these parameters work (e.g., exact matches, partial strings, or allowed values), leaving some ambiguity. With low schema coverage, the description compensates partially but not fully.

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 tool's purpose: 'Filter tasks by specific criteria (priority, context, project).' It specifies the verb ('filter'), resource ('tasks'), and the types of criteria used, making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'search-tasks' or 'list-tasks', which prevents 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 like 'search-tasks' or 'list-tasks'. It mentions criteria but doesn't specify scenarios, prerequisites, or exclusions for usage. This lack of context leaves the agent without clear direction on tool selection among siblings.

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/guifelix/mcp-server-todotxt'

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