Skip to main content
Glama
bitrefill

Bitrefill Search and Shop

Official
by bitrefill

detail

Retrieve comprehensive product specifications and details by providing the unique product identifier to support informed purchasing decisions on the Bitrefill platform.

Instructions

Get detailed information about a product

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier of the product

Implementation Reference

  • The handler function for the "detail" MCP tool. It takes a product ID, fetches detailed product information using ProductService.getProductDetails, formats it as JSON text content, and handles errors by returning an error JSON response.
    server.tool(
      "detail",
      "Get detailed information about a product",
      {
        id: z.string().describe("Unique identifier of the product"),
      },
      async (args) => {
        try {
          const productDetail = await ProductService.getProductDetails(args.id);
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(productDetail, 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 ProductDetailResponse returned by the detail tool's underlying service.
    export const ProductDetailResponseSchema = z.object({
      _id: z.string(),
      slug: z.string(),
      name: z.string(),
      baseName: z.string(),
      noIndex: z.boolean().optional(),
      logoBackground: z.string().optional(),
      logoForeground: z.string().optional(),
      isLogoSvgPreferred: z.boolean().optional(),
      logoVersion: z.number().optional(),
      logoImage: z.string(),
      logoPreview: z.string(),
      iconPreview: z.string(),
      iconVersion: z.number().optional(),
      iconImage: z.string().optional(),
      iconBackground: z.string().optional(),
      iconForeground: z.string().optional(),
      iconNoMargin: z.boolean().optional(),
      type: z.string(),
      categories: z.array(z.string()),
      stats: z.object({
        popularity: z.number().optional(),
        packageSize: z.number().optional(),
      }).optional(),
      countryStat: z.record(z.number()).optional(),
      countryCode: z.string(),
      countries: z.array(z.string()),
      recipientType: z.string().optional(),
      isPinBased: z.boolean().optional(),
      outOfStock: z.boolean().optional(),
      ratings: z.object({
        reviewCount: z.number(),
        ratingValue: z.number(),
        ratingCount: z.number().optional(),
        scoreDistribution: z.array(z.number()).optional(),
        reviews: z.array(z.object({
          id: z.string(),
          content: z.string(),
          score: z.number(),
          scoreMax: z.number(),
          authorName: z.string(),
          createdTime: z.string(),
          source: z.string(),
          author: z.string(),
          extract: z.string().optional(),
          score_max: z.number().optional(),
          date: z.string().optional(),
          feedback_url: z.string().optional(),
        })).optional(),
      }).optional(),
      packages: z.array(z.object({
        display: z.string().nullable().optional(),
        value: z.string(),
        eurValue: z.number(),
        amount: z.number(),
        eurPrice: z.number(),
        usdPrice: z.number(),
        prices: z.record(z.number()),
      })),
      currency: z.string(),
      terms: z.string().optional(),
      termsLink: z.string().optional(),
      languages: z.record(z.boolean()).optional(),
      descriptions: z.record(z.string()).optional(),
      subtitles: z.record(z.string()).optional(),
      instructions: z.record(z.string()).optional(),
      redemptionMethods: z.array(z.string()).optional(),
      relatedX: z.array(z.object({
        _id: z.string(),
        name: z.string(),
        slug: z.string(),
        logoImage: z.string().optional(),
        logoPreview: z.string().optional(),
        iconPreview: z.string().optional(),
        cashbackDisabled: z.boolean().optional(),
        logoVersion: z.number().optional(),
        countries: z.array(z.string()).optional(),
        type: z.string().optional(),
        countryCode: z.string().optional(),
        categories: z.array(z.string()).optional(),
        range: z.object({
          min: z.number(),
          max: z.number(),
          step: z.number(),
          customerEurPriceRate: z.number().optional(),
          customerUsdPriceRate: z.number().optional(),
          eurValueRate: z.number().optional(),
          purchaseFeeEur: z.number().nullable().optional(),
          purchaseFeeUsd: z.number().nullable().optional(),
        }).optional(),
        currency: z.string().optional(),
        _ratingValue: z.number().optional(),
        _reviewCount: z.number().optional(),
        _priceRange: z.string().optional(),
        _expandedCC: z.record(z.number()).optional(),
        _sortOrderCC: z.record(z.number()).optional(),
        logoBackground: z.string().optional(),
        logoNoMargin: z.boolean().optional(),
        label: z.string().optional(),
        cashbackPercentageFinal: z.number().optional(),
        isRanged: z.boolean().optional(),
        _noIos: z.boolean().optional(),
      })).optional(),
      cashbackDisabled: z.boolean().optional(),
      _ratingValue: z.number().optional(),
      _reviewCount: z.number().optional(),
      _priceRange: z.string().optional(),
      _expandedCC: z.record(z.number()).optional(),
    });
    
    /**
     * Product Detail Response interface for the complete product details from API
     */
    export type ProductDetailResponse = z.infer<typeof ProductDetailResponseSchema>;
  • Registers the "detail" tool with the MCP server, specifying name, description, input schema (product ID), and handler function.
    server.tool(
      "detail",
      "Get detailed information about a product",
      {
        id: z.string().describe("Unique identifier of the product"),
      },
      async (args) => {
        try {
          const productDetail = await ProductService.getProductDetails(args.id);
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(productDetail, 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,
          };
        }
      }
    );
  • ProductService method that proxies the getProductDetails call to the public API client, typed with ProductDetailResponse.
      public static async getProductDetails(
        id: string
      ): Promise<ProductDetailResponse> {
        return publicApiClient.getProductDetails(id);
      }
    }
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. 'Get detailed information' implies a read-only operation, but it doesn't specify authentication requirements, rate limits, error conditions, or what constitutes 'detailed information' (fields returned, format). This leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a simple lookup tool and front-loads the essential information.

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?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'detailed information' includes (structure, fields), potential error responses, or operational constraints. Given the lack of structured metadata, the description should provide more context about the tool's behavior and outputs.

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 fully documents the single 'id' parameter. The description doesn't add any parameter-specific context beyond what's in the schema (like examples of valid IDs or format requirements), meeting 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 verb ('Get') and resource ('detailed information about a product'), making the purpose immediately understandable. It distinguishes from 'search' (which likely returns multiple results) and 'categories' (which deals with product groupings), but doesn't explicitly differentiate from 'ping' (a health check tool).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'search' or 'categories'. It doesn't mention prerequisites (like needing a product ID) or contextual factors that would help an agent choose between this and sibling tools.

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