get_categories
List available business verticals per country to determine which business types agents can search for in a given region.
Instructions
List available business verticals per country. Use to discover what kinds of businesses agents can search for in a given region.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| countryCode | No | ISO-3166 alpha-2 (US, CA, GB, ...). Omit for all categories everywhere. |
Implementation Reference
- src/tools/getCategories.ts:22-24 (handler)The main handler function for the 'get_categories' tool. Calls the db layer to fetch categories, optionally filtered by countryCode.
export async function getCategories(input: GetCategoriesInput): Promise<CategoryEntry[]> { return fetchCategories(input.countryCode); } - src/tools/getCategories.ts:12-18 (schema)Zod schema defining the input for get_categories. Accepts an optional ISO-3166 alpha-2 countryCode string (length 2).
export const getCategoriesSchema = z.object({ countryCode: z .string() .length(2) .optional() .describe("ISO-3166 alpha-2 (US, CA, GB, ...). Omit for all categories everywhere.") }); - src/server.ts:65-73 (registration)Registration of the 'get_categories' tool with the MCP server, binding the schema and handler.
server.tool( "get_categories", "List available business verticals per country. Use to discover what kinds of businesses agents can search for in a given region.", getCategoriesSchema.shape, async (args) => { const cats = await getCategories(getCategoriesSchema.parse(args)); return { content: [{ type: "text", text: JSON.stringify(cats, null, 2) }] }; } ); - src/lib/db.ts:60-67 (helper)Data access function that loads categories from mock data (or future Supabase) and optionally filters by countryCode.
export async function getCategories(countryCode?: string): Promise<CategoryEntry[]> { if (DATA_SOURCE === "supabase") { throw new Error("Supabase data source not yet wired."); } const cats = loadMockCategories(); if (!countryCode) return cats; return cats.filter((c) => c.availableInCountries.includes(countryCode)); } - src/types.ts:111-116 (helper)Type definition for CategoryEntry used as the return type of get_categories.
export interface CategoryEntry { vertical: Vertical; label: string; subcategories: string[]; availableInCountries: string[]; }