health
Verify PayBot MCP Server connectivity to ensure automated USDC payment infrastructure is operational for transaction processing.
Instructions
Check if the PayBot server is reachable
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:92-96 (handler)The health tool handler that checks if the PayBot server is reachable by making a GET request to /health endpoint
// Tool: health server.tool('health', 'Check if the PayBot server is reachable', {}, async () => { const result = await paybotRequest('GET', '/health'); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }; }); - src/index.ts:92-96 (registration)Registration of the health tool with the MCP server, including tool name, description, and handler
// Tool: health server.tool('health', 'Check if the PayBot server is reachable', {}, async () => { const result = await paybotRequest('GET', '/health'); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }; }); - src/index.ts:17-33 (helper)The paybotRequest helper function used by the health tool to make authenticated HTTP requests to the PayBot API
async function paybotRequest<T>(method: string, path: string, body?: unknown): Promise<T> { const response = await fetch(`${PAYBOT_BASE_URL}${path}`, { method, headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${PAYBOT_API_KEY}`, }, body: body ? JSON.stringify(body) : undefined, }); if (!response.ok) { const errorBody = await response.text().catch(() => 'Unknown error'); throw new Error(`PayBot API error (${response.status}): ${errorBody}`); } return (await response.json()) as T; }