Skip to main content
Glama
bitrefill

Bitrefill Search and Shop

Official
by bitrefill

ping

Verify Bitrefill API availability to ensure cryptocurrency shopping functions operate correctly before transactions.

Instructions

Check if the Bitrefill API is available

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration and handler for 'ping': registers the tool with empty input schema and handles execution by calling MiscService.ping(), formatting the response as JSON text, with error handling.
    /** * Ping tool * Checks if the API is available * @returns Ping response */ server.tool( "ping", "Check if the Bitrefill API is available", {}, async () => { try { const ping = await MiscService.ping(); return { content: [ { type: "text" as const, text: JSON.stringify(ping, null, 2) } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: JSON.stringify({ error: errorMessage }, null, 2), }, ], isError: true, }; } } );
  • Zod schema defining the structure of the ping API response (used for type safety in services).
    export const PingResponseSchema = z.object({ meta: z.object({ _endpoint: z.string(), }), message: z.string().describe("Ping response message"), });
  • MiscService.ping(): Thin wrapper that delegates to the authenticated API client ping method.
    public static async ping(): Promise<PingResponse> { return authenticatedApiClient.ping(); }
  • AuthenticatedApiClient.ping(): Makes the actual HTTP GET request to the '/ping' endpoint on Bitrefill API.
    public async ping(): Promise<PingResponse> { return this.makeRequest<PingResponse>( "ping", { method: "GET", headers: DEFAULT_HEADERS, } ); }

Other Tools

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/bitrefill/bitrefill-mcp-server'

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