search-items
Search for tasks and projects in Things 3 using queries, with options to control detail level and result limits.
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 items to return |
Implementation Reference
- src/index.ts:1474-1504 (handler)Implementation of the "search-items" MCP tool which searches across tasks, areas, and tags.
"search-items", { 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 items to return"), }, async ({ query, detail, limit }) => { const requestedDetail = detail ?? "compact"; const lower = query.toLowerCase(); const results = await withDatabase((db) => { const tasks = getAllTasks(db).filter((task) => !task.trashed); const areas = getAreas(db, tasks); const tags = getTags(db); return applyLimit( [ ...tasks.filter((task) => matchesQuery(task, lower)).map((task) => toTaskView(task, requestedDetail)), ...areas.filter((area) => matchesQuery(area, lower)).map((area) => toCompactArea(area)), ...tags.filter((tag) => matchesQuery(tag, lower)).map((tag) => toCompactTag(tag)), ], limit ); }); return buildTextResponse(`Found ${results.length} matching items`, { results, detail: requestedDetail, limit: limit ?? null, }); } );