Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYesSearch term
detailNoResponse detail level. Defaults to compact.
limitNoMaximum number of items to return

Implementation Reference

  • 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,
        });
      }
    );

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/soycanopa/SupaThings-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server