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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/tools.ts:154-162 (handler)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") }, ], }; }
- src/tools.ts:153-153 (schema)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") }, ], }; } );