categories
Retrieve product categories to organize searches for cryptocurrency gift cards and mobile top-ups on Bitrefill.
Instructions
Get the full product type/categories map. It's suggested to use this tool to get the categories and then use the search tool to search for products in a specific category.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/tools.ts:104-115 (handler)The inline handler function for the 'categories' tool, which returns a JSON-formatted string of the productCategories map.server.tool( "categories", "Get the full product type/categories map. It's suggested to use this tool to get the categories and then use the `search` tool to search for products in a specific category.", {}, async () => { return { content: [ { type: "text" as const, text: JSON.stringify(productCategories, null, 2) } ] }; } );
- src/handlers/tools.ts:104-115 (registration)Registration of the 'categories' tool within the registerToolHandlers function using server.tool.server.tool( "categories", "Get the full product type/categories map. It's suggested to use this tool to get the categories and then use the `search` tool to search for products in a specific category.", {}, async () => { return { content: [ { type: "text" as const, text: JSON.stringify(productCategories, null, 2) } ] }; } );
- src/constants/categories.ts:6-77 (helper)The productCategories constant/map that provides the hierarchy of product types and categories, used by the 'categories' tool.export const productCategories: ProductCategoriesMap = { "giftcards": [ "all-gift-cards", "apparel", "automobiles", "cruises", "ecommerce", "electronics", "entertainment", "experiences", "flights", "food", "food-delivery", "games", "gifts", "groceries", "health-beauty", "home", "multi-brand", "music", "other", "payment-cards", "pets", "pharmacy", "restaurants", "retail", "streaming", "top-products", "travel", "utility-bills", "voip" ], "refills": [ "refill", "data", "pin", "bundles", "dth" ], "bills": [ "all-bills", "auto-loans", "banking", "bill", "catalog-sales", "cemeteries-funerals", "club-membership", "commission-businesses", "credit-card", "education", "financial-services", "healthcare", "hoa-rent", "installment-payments", "insurance", "internet-cable-tv", "mortgages-home-equity", "mortgages-property-management", "phone", "press", "sanitation", "security-monitoring", "taxes", "water-electricity-gas" ], "esims": [ "esim" ], "crypto-utils": [ "bitcoin" ] };
- src/schemas/search.ts:80-85 (schema)Zod schema and TypeScript type definition for the product categories map data structure.export const ProductCategoriesMapSchema = z.record(z.array(z.string())); /** * Product types and their associated categories */ export type ProductCategoriesMap = z.infer<typeof ProductCategoriesMapSchema>;