Skip to main content
Glama
bitrefill

Bitrefill Search and Shop

Official
by bitrefill

search

Find gift cards, eSIMs, and mobile top-ups by searching with keywords, country codes, or categories to purchase products using cryptocurrencies.

Instructions

Search for gift cards, esims, mobile topups and more. It's suggested to use the categories tool before searching for products, to have a better understanding of what's available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g., 'Amazon', 'Netflix', 'AT&T' or '*' for all the available products)
countryNoCountry code (e.g., 'US', 'IT', 'GB')
languageNoLanguage code for results (e.g., 'en')
limitNoMaximum number of results to return
skipNoNumber of results to skip (for pagination)
categoryNoFilter by category (e.g., 'gaming', 'entertainment')
beta_flagsNoBeta feature flags
cartNoCart identifier
do_recommendNoEnable recommendations
recNoRecommendation parameter
secNoSecurity parameter
colNoColumn layout parameter
prefccNoPreferred country code parameter
srcNoSource of the request

Implementation Reference

  • The execution logic of the 'search' MCP tool handler, which invokes the SearchService and returns formatted results or error content.
    async (args) => {
      try {
        const searchResults = await SearchService.search(args.query, args);
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(searchResults, 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,
        };
      }
    }
  • Registration of the 'search' tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      "search",
      "Search for gift cards, esims, mobile topups and more. It's suggested to use the `categories` tool before searching for products, to have a better understanding of what's available.",
      SearchOptions,
      async (args) => {
        try {
          const searchResults = await SearchService.search(args.query, args);
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(searchResults, 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,
          };
        }
      }
    );
  • Input schema (SearchOptions) for the 'search' tool, defining parameters like query, country, limit, etc., using Zod.
    export const SearchOptions = {
      query: z.string().describe("Search query (e.g., 'Amazon', 'Netflix', 'AT&T' or '*' for all the available products)"),
      country: z.string().optional().describe("Country code (e.g., 'US', 'IT', 'GB')"),
      language: z.string().optional().describe("Language code for results (e.g., 'en')"),
      limit: z.number().optional().describe("Maximum number of results to return"),
      skip: z.number().optional().describe("Number of results to skip (for pagination)"),
      category: z.string().optional().describe("Filter by category (e.g., 'gaming', 'entertainment')"),
      beta_flags: z.string().optional().describe("Beta feature flags"),
      cart: z.string().optional().describe("Cart identifier"),
      do_recommend: z.number().optional().describe("Enable recommendations"),
      rec: z.number().optional().describe("Recommendation parameter"),
      sec: z.number().optional().describe("Security parameter"),
      col: z.number().optional().describe("Column layout parameter"),
      prefcc: z.number().optional().describe("Preferred country code parameter"),
      src: z.string().optional().describe("Source of the request"),
    };
  • Helper method in SearchService that validates options and delegates to publicApiClient.search for the actual API call.
    public static async search(
      query: string,
      options: Partial<SearchOptionsType> = {}
    ): Promise<SearchResults> {
      // Validate options
      const validatedOptions = SearchOptionsSchema.parse(options);
      
      // Use the public API client to perform the search
      return publicApiClient.search(query, validatedOptions);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions a suggested workflow but lacks critical behavioral information: it doesn't describe what the search returns (product listings, availability, pricing), whether it requires authentication, rate limits, error conditions, or how results are structured. The description is insufficient for a search tool with 14 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately brief with two sentences that each serve a purpose: the first states the tool's function, the second provides usage guidance. It's front-loaded with the core purpose and wastes no words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (14 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the search returns, how results are formatted, error handling, authentication requirements, or the relationship between parameters. For a search tool with many configuration options, more context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 14 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, but doesn't need to compensate for coverage gaps. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for specific product types (gift cards, esims, mobile topups, and more), which provides a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'detail' or 'ping', though the search function is distinct from categories listing or system checks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance to use the 'categories' tool first for better understanding of available products, which establishes context and a recommended workflow. However, it doesn't specify when NOT to use this tool or alternatives beyond the categories suggestion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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