search
Search for users and tasks on the MCP Test Server by entering a query to retrieve relevant data efficiently. Supports streamlined user and task management.
Instructions
Search users and tasks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query |
Implementation Reference
- src/domains/search.js:5-25 (handler)The core handler function that performs the search by aggregating results from UserService.search and TaskService.search.static search(query) { if (!query) { return { success: false, message: 'Query parameter is required' }; } const userResults = UserService.search(query); const taskResults = TaskService.search(query); return { success: true, query, results: { users: userResults, tasks: taskResults }, totalResults: userResults.length + taskResults.length }; }
- src/domains/search.js:29-42 (schema)The input schema definition for the MCP 'search' tool.export const searchToolSchema = { name: 'search', description: 'Search users and tasks', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query' } }, required: ['query'] } };
- mcp-server.js:40-44 (registration)Registration of the search tool schema in the ListTools response.tools: [ ...userToolSchemas, ...taskToolSchemas, searchToolSchema ]
- mcp-server.js:64-65 (registration)Handler registration for the 'search' tool in the CallToolRequestSchema switch dispatcher.case 'search': return createMcpResponse(SearchService.search(args.query));