Skip to main content
Glama
flyanima

Open Search MCP

by flyanima

jsonplaceholder_users

Retrieve test user data from JSONPlaceholder for development and testing purposes, with configurable limits up to 10 records.

Instructions

Get test users data from JSONPlaceholder

Input Schema

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

Implementation Reference

  • The main handler function that executes the tool logic: fetches users from JSONPlaceholder API using the client instance 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' }; } }
  • JSON Schema definition for tool inputs, specifying an optional 'limit' parameter between 1-10 with default 5.
    inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of users to return (1-10)', default: 5, minimum: 1, maximum: 10 } }, required: [] },
  • Tool registration call to registry.registerTool() that defines and registers the jsonplaceholder_users tool including its handler and schema.
    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' }; } } });
  • Supporting helper method in JSONPlaceholderAPIClient class that makes the API request to /users endpoint and slices results by optional limit.
    async getUsers(limit?: number) { const users = await this.makeRequest('/users'); return limit ? users.slice(0, limit) : users; }
  • Additional Zod schema for input validation of jsonplaceholder_users parameters in the global input-validator utility.
    '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