Skip to main content
Glama
aafsar

Task Manager MCP Server

by aafsar

search_tasks

Find tasks by searching titles or descriptions to locate specific items in your task management system.

Instructions

Search tasks by title or description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

Implementation Reference

  • The core handler function for the 'search_tasks' tool. It validates input using SearchSchema, loads all tasks, filters those matching the query in title or description (case-insensitive), and returns formatted results or a 'no matches' message.
    export async function searchTasks(args: unknown) { // Validate input const validated = SearchSchema.parse(args); // Load tasks const storage = await loadTasks(); const query = validated.query.toLowerCase(); // Search in title and description const matchingTasks = storage.tasks.filter( (t) => t.title.toLowerCase().includes(query) || (t.description && t.description.toLowerCase().includes(query)) ); if (matchingTasks.length === 0) { return { content: [ { type: "text", text: `No tasks found matching "${validated.query}".`, }, ], }; } // Format results let result = `πŸ” Found ${matchingTasks.length} task(s) matching "${validated.query}":\n\n`; matchingTasks.forEach((task) => { result += formatTask(task) + "\n"; }); return { content: [ { type: "text", text: result, }, ], }; }
  • src/index.ts:156-170 (registration)
    Tool registration in the TOOLS array, including name, description, and inputSchema for MCP tool listing.
    { name: "search_tasks", description: "Search tasks by title or description", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query", minLength: 1, }, }, required: ["query"], }, },
  • src/index.ts:230-231 (registration)
    Dispatch in the switch statement for handling 'search_tasks' tool calls, invoking the searchTasks handler.
    case "search_tasks": return await searchTasks(args);
  • Internal Zod schema used by the handler for input validation.
    export const SearchSchema = z.object({ query: z.string().min(1, "Search query is required"), });

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/aafsar/task-manager-mcp-server'

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