Skip to main content
Glama

search-tasks

Find specific tasks in Todo.txt files by filtering with a search query, ensuring quick and precise task management within your workflow.

Instructions

Search for tasks containing a query string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The handler function for the 'search-tasks' tool. It loads all tasks using loadTasks(), filters those whose string representation includes the provided query, and returns a content block with the matching tasks joined by newlines.
    async ({ query }) => { const tasks = await loadTasks(); const matchingTasks = tasks.filter(task => task.toString().includes(query)); return { content: [ { type: "text", text: matchingTasks.map(task => task.toString()).join("\n") }, ], }; }
  • The input schema for the 'search-tasks' tool, defining a required 'query' parameter as a string using Zod.
    { query: z.string() },
  • src/tools.ts:150-163 (registration)
    The registration of the 'search-tasks' tool using server.tool(), including name, description, schema, and inline handler function.
    server.tool( "search-tasks", "Search for tasks containing a query string.", { query: z.string() }, async ({ query }) => { const tasks = await loadTasks(); const matchingTasks = tasks.filter(task => task.toString().includes(query)); return { content: [ { type: "text", text: matchingTasks.map(task => task.toString()).join("\n") }, ], }; } );

Other Tools

Related 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