search-todos
Search for todos in Things 3 using natural language queries to find specific tasks and manage your workflow efficiently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search term | |
| detail | No | Response detail level. Defaults to compact. | |
| limit | No | Maximum number of todos to return |
Implementation Reference
- src/index.ts:1447-1471 (handler)The implementation of the 'search-todos' tool. It filters tasks from the database based on the provided query string.
server.tool( "search-todos", { query: z.string().describe("Search term"), detail: z.enum(["compact", "full"]).optional().describe("Response detail level. Defaults to compact."), limit: z.number().int().positive().optional().describe("Maximum number of todos to return"), }, async ({ query, detail, limit }) => { const requestedDetail = detail ?? "compact"; const lower = query.toLowerCase(); const todos = await withDatabase((db) => applyLimit( getAllTasks(db).filter( (task) => task.type === "to-do" && !task.trashed && matchesQuery(task, lower) ), limit ).map((task) => toTaskView(task, requestedDetail)) ); return buildTextResponse(`Found ${todos.length} matching todos`, { todos, detail: requestedDetail, limit: limit ?? null, }); } );