Skip to main content
Glama

test_trpc_endpoint

Validate tRPC endpoints by testing specific methods like news.getUnreadNewsCount or user.updateLastAccess with custom parameters to ensure accurate responses and functionality.

Instructions

Test specific tRPC endpoint with detailed response

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNotRPC method to test (e.g., news.getUnreadNewsCount, user.updateLastAccess)user.updateLastAccess
paramsNoJSON string of parameters (optional)

Implementation Reference

  • src/server.ts:380-398 (registration)
    Registration of the 'test_trpc_endpoint' tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.
    { name: "test_trpc_endpoint", description: "Test specific tRPC endpoint with detailed response", inputSchema: { type: "object", properties: { method: { type: "string", description: "tRPC method to test (e.g., news.getUnreadNewsCount, user.updateLastAccess)", default: "user.updateLastAccess", }, params: { type: "string", description: "JSON string of parameters (optional)", }, }, }, },
  • Input schema definition for the test_trpc_endpoint tool, specifying method (string with default) and optional params (JSON string).
    inputSchema: { type: "object", properties: { method: { type: "string", description: "tRPC method to test (e.g., news.getUnreadNewsCount, user.updateLastAccess)", default: "user.updateLastAccess", }, params: { type: "string", description: "JSON string of parameters (optional)", }, }, },
  • Handler for the test_trpc_endpoint tool in the CallToolRequestSchema switch statement. Parses arguments, calls NLobbyApi.testTrpcEndpoint, and returns formatted result or error.
    case "test_trpc_endpoint": { const { method, params } = args as { method: string; params?: string; }; try { const parsedParams = params ? JSON.parse(params) : {}; const result = await this.api.testTrpcEndpoint( method, parsedParams, ); return { content: [ { type: "text", text: `Result of ${method} with params ${JSON.stringify(parsedParams)}:\n\n${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error testing tRPC endpoint ${method}: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } }
  • Delegation to NLobbyApi.testTrpcEndpoint method for executing the tRPC call (implementation in ./api.js).
    const result = await this.api.testTrpcEndpoint( method, parsedParams, );

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/minagishl/nlobby-mcp'

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