Skip to main content
Glama
bitrefill

Bitrefill Search and Shop

Official
by bitrefill

ping

Verify the availability of the Bitrefill API to ensure readiness for cryptocurrency-based product search and shopping.

Instructions

Check if the Bitrefill API is available

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'ping' tool registration and inline handler function. Registers the tool with MCP server and implements the logic to ping the API via MiscService and return formatted response or error.
    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 (PingResponseSchema) and TypeScript type (PingResponse) for validating the ping API response used by the tool.
    /** * Ping response schema */ export const PingResponseSchema = z.object({ meta: z.object({ _endpoint: z.string(), }), message: z.string().describe("Ping response message"), }); /** * Ping response type */ export type PingResponse = z.infer<typeof PingResponseSchema>;
  • Helper method in MiscService that performs the ping by delegating to the authenticated API client.
    /** * Ping the API to check if it's available * @returns Ping response */ public static async ping(): Promise<PingResponse> { return authenticatedApiClient.ping(); }

Other Tools

Related 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