Skip to main content
Glama

Open Search MCP

by flyanima

jsonplaceholder_users

Retrieve test user data from JSONPlaceholder using Open Search MCP, with options to limit results for precise querying and testing purposes.

Instructions

Get test users data from JSONPlaceholder

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of users to return (1-10)

Input Schema (JSON Schema)

{ "properties": { "limit": { "default": 5, "description": "Maximum number of users to return (1-10)", "maximum": 10, "minimum": 1, "type": "number" } }, "required": [], "type": "object" }

Implementation Reference

  • The execute handler for the jsonplaceholder_users tool. It fetches users using the JSONPlaceholderAPIClient.getUsers method with optional limit and returns a standardized ToolOutput.
    execute: async (args: any) => { try { const users = await client.getUsers(args.limit || 5); return { success: true, data: { source: 'JSONPlaceholder API', type: 'users', results: users, count: users.length, timestamp: Date.now(), apiUsed: true } }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get test users' }; } }
  • Input schema definition for the jsonplaceholder_users tool, specifying optional limit parameter.
    inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of users to return (1-10)', default: 5, minimum: 1, maximum: 10 } }, required: [] },
  • Registration of the jsonplaceholder_users tool in the ToolRegistry within registerJSONPlaceholderTools function.
    registry.registerTool({ name: 'jsonplaceholder_users', description: 'Get test users data from JSONPlaceholder', category: 'testing', source: 'jsonplaceholder.typicode.com', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of users to return (1-10)', default: 5, minimum: 1, maximum: 10 } }, required: [] }, execute: async (args: any) => { try { const users = await client.getUsers(args.limit || 5); return { success: true, data: { source: 'JSONPlaceholder API', type: 'users', results: users, count: users.length, timestamp: Date.now(), apiUsed: true } }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get test users' }; } } });
  • Helper method in JSONPlaceholderAPIClient class that fetches users from /users endpoint and applies limit.
    async getUsers(limit?: number) { const users = await this.makeRequest('/users'); return limit ? users.slice(0, limit) : users; }
  • Zod schema for input validation of jsonplaceholder_users tool in the global input validator.
    'jsonplaceholder_users': z.object({ limit: z.number().int().min(1).max(10).optional().default(5)

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/flyanima/open-search-mcp'

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