Skip to main content
Glama

search_tasks

Find Todoist tasks using search filters with three syntax options: basic text, wildcard, or exact phrase matching. Returns structured task details for efficient task management.

Instructions

Search for tasks in Todoist using the search filter. This is one of three search tools: basic search (single term), AND search (all terms must match), and OR search (any term can match). Supports three search syntax options: basic text search (meeting), wildcard search (report), and exact phrase search ("buy groceries"). 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
queryYesSearch query to find matching tasks. Examples: meeting (basic text search), *report* (wildcard search), "buy groceries" (quoted, exact phrase search)

Implementation Reference

  • The handler function for the 'search_tasks' MCP tool. It takes a query argument, calls the underlying searchTasks service function, and returns the result as formatted JSON text content.
    handler: async (args: { query: string }) => { console.error('Executing search_tasks...'); const result = await searchTasks(args.query); console.error('search_tasks completed successfully'); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; },
  • The schema definition for the 'search_tasks' tool, specifying its name, description, and input schema that requires a 'query' string parameter.
    schema: { name: 'search_tasks', description: 'Search for tasks in Todoist using the search filter. This is one of three search tools: basic search (single term), AND search (all terms must match), and OR search (any term can match). Supports three search syntax options: basic text search (meeting), wildcard search (*report*), and exact phrase search ("buy groceries"). Returns structured JSON data with task details including id, content, description, completion status, labels, priority, due date, and comment count.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query to find matching tasks. Examples: meeting (basic text search), *report* (wildcard search), "buy groceries" (quoted, exact phrase search)', }, }, required: ['query'], }, },
  • Registration of the 'search_tasks' tool handler (and related search tools) in the toolsWithArgs registry, which is used by the handleToolRequest function to dispatch tool calls.
    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:100-100 (registration)
    The 'search_tasks' tool schema is included in the list of tools returned by the ListToolsRequestHandler in the MCP server.
    searchTasksTool.schema,
  • src/index.ts:29-29 (registration)
    Import of the searchTasksTool (containing schema and handler) in the main index file for server setup.
    searchTasksTool,

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