Skip to main content
Glama

search-tasks

Find tasks in Todo.txt files by searching for specific text or keywords to locate relevant items quickly.

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, filters those whose string representation includes the provided query, and returns the matching tasks joined by newlines in a text content block.
    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 Zod string schema.
    { query: z.string() },
  • src/tools.ts:150-163 (registration)
    The registration of the 'search-tasks' tool on the MCP server using server.tool(), including the tool name, description, input schema, and 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") }, ], }; } );

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