Skip to main content
Glama
yvanfreitas

MCP Test Server

by yvanfreitas

search

Find users and tasks in the MCP Test Server by entering search queries to locate specific data entries.

Instructions

Search users and tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

Implementation Reference

  • Implements the core logic of the 'search' tool by querying both UserService and TaskService and aggregating results.
    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 }; }
  • Defines the input schema, name, and description 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:38-46 (registration)
    Registers the 'search' tool for listing by including its schema in the tools response.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...userToolSchemas, ...taskToolSchemas, searchToolSchema ] }; });
  • mcp-server.js:64-65 (registration)
    Dispatches calls to the 'search' tool by invoking SearchService.search in the callToolRequestSchema handler.
    case 'search': return createMcpResponse(SearchService.search(args.query));

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/yvanfreitas/MCP-test'

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