test_trpc_endpoint
Test tRPC endpoints to verify functionality and receive detailed responses for debugging and validation purposes.
Instructions
Test specific tRPC endpoint with detailed response
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | tRPC method to test (e.g., news.getUnreadNewsCount, user.updateLastAccess) | user.updateLastAccess |
| params | No | JSON string of parameters (optional) |
Implementation Reference
- src/server.ts:953-982 (handler)MCP tool handler for 'test_trpc_endpoint': parses method and params from input, calls this.api.testTrpcEndpoint(method, parsedParams), 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"}`, }, ], }; } }
- src/server.ts:380-398 (registration)Tool registration in ListToolsRequestSchema response: defines name, description, and input schema for 'test_trpc_endpoint'.{ 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)", }, }, }, },
- src/server.ts:383-396 (schema)Input schema definition for the test_trpc_endpoint tool.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)", }, },