Skip to main content
Glama

get_tasks_with_label

Retrieve tasks filtered by a specific label, excluding those from Brian or Projects projects. Returns structured JSON with task details including content, priority, due dates, and completion status.

Instructions

Get all tasks with a specific label that are not part of the "Brian projects" or "Projects" projects. Returns structured JSON data with task details including id, content, description, completion status, labels, priority, due date, and comment count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesThe label to filter tasks by (e.g., "urgent", "important", "work")

Implementation Reference

  • Primary implementation of the 'get_tasks_with_label' tool: defines schema for input validation and handler function that executes the tool logic by calling the service and formatting response as JSON.
    export const getTasksWithLabelTool: Tool = {
      schema: {
        name: 'get_tasks_with_label',
        description:
          'Get all tasks with a specific label that are not part of the "Brian projects" or "Projects" projects. Returns structured JSON data with task details including id, content, description, completion status, labels, priority, due date, and comment count.',
        inputSchema: {
          type: 'object',
          properties: {
            label: {
              type: 'string',
              description:
                'The label to filter tasks by (e.g., "urgent", "important", "work")',
            },
          },
          required: ['label'],
        },
      },
      handler: async (args: { label: string }) => {
        console.error('Executing get_tasks_with_label...');
        const result = await getTasksWithLabel(args.label);
        console.error('get_tasks_with_label completed successfully');
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      },
    };
  • Helper service function that constructs Todoist filter for tasks with given label (excluding projects unless context label) and fetches/transforms tasks.
    export async function getTasksWithLabel(label: string): Promise<TasksResponse> {
      const filter = label.startsWith('context:')
        ? `@${label}`
        : `@${label} & !##Brian projects & !##Projects`;
    
      return await fetchTasksByFilter(filter, 'get tasks with label');
    }
  • Registration of the tool handler in the toolsWithArgs registry map, mapping 'get_tasks_with_label' to its handler function.
    const toolsWithArgs: Record<string, (args: any) => Promise<ToolResponse>> = {
      get_task_comments: getTaskCommentsTool.handler,
      create_project_label: createProjectLabelTool.handler,
      create_task_comment: createTaskCommentTool.handler,
      update_task: updateTaskTool.handler,
      create_task: createTaskTool.handler,
      move_task: moveTaskTool.handler,
      get_tasks_with_label: getTasksWithLabelTool.handler,
      complete_task: completeTaskTool.handler,
      uncomplete_task: uncompleteTaskTool.handler,
      search_tasks: searchTasksTool.handler,
      search_tasks_using_and: searchTasksUsingAndTool.handler,
      search_tasks_using_or: searchTasksUsingOrTool.handler,
      complete_becky_task: completeBeckyTaskTool.handler,
    };
  • src/index.ts:97-97 (registration)
    Registration of the tool schema in MCP ListToolsRequestHandler response array.
    getTasksWithLabelTool.schema,
  • Schema definition for the tool, including name, description, and inputSchema for validation (requires 'label' string).
    schema: {
      name: 'get_tasks_with_label',
      description:
        'Get all tasks with a specific label that are not part of the "Brian projects" or "Projects" projects. Returns structured JSON data with task details including id, content, description, completion status, labels, priority, due date, and comment count.',
      inputSchema: {
        type: 'object',
        properties: {
          label: {
            type: 'string',
            description:
              'The label to filter tasks by (e.g., "urgent", "important", "work")',
          },
        },
        required: ['label'],
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns structured JSON data with specific task details, which is useful behavioral context. However, it does not mention potential limitations like pagination, rate limits, or authentication needs, leaving some behavioral traits unspecified.

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 appropriately sized with two sentences: one stating the purpose and exclusions, and another detailing the return format. It is front-loaded with key information, though the second sentence could be slightly more concise by integrating return details more tightly.

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

Completeness4/5

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

Given the tool's moderate complexity (filtering tasks by label with exclusions), no annotations, and no output schema, the description does a good job by specifying exclusions and return data. However, it could be more complete by mentioning error cases or response structure details, which would help in a no-annotation context.

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 input schema has 100% description coverage for its single parameter ('label'), so the schema already documents it well. The description does not add any additional meaning or syntax details beyond what the schema provides, resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('all tasks with a specific label'), and distinguishes from siblings by specifying exclusions ('not part of the "Brian projects" or "Projects" projects'). It also mentions the return format, making the purpose specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool (for tasks with a specific label, excluding certain projects), but does not explicitly mention when not to use it or name alternative tools. This gives good guidance but lacks explicit exclusions or named alternatives.

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

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