list_families
Retrieve all watch families for a specific brand to explore collections and models within the WatchBase database.
Instructions
Retrieve a list of all families for a given brand.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brand_id | Yes | BrandID of the brand |
Implementation Reference
- src/index.ts:207-211 (handler)Handler logic for the 'list_families' tool: validates input arguments, sets the API endpoint to '/families' and maps 'brand_id' to 'brand-id' parameter.case 'list_families': if (!isListFamiliesArgs(args)) throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for list_families'); apiPath = 'families'; apiParams = { 'brand-id': args.brand_id }; // API uses hyphen break;
- src/index.ts:127-139 (registration)Registration of the 'list_families' tool in the tools array, including name, description, and input schema definition.name: 'list_families', description: 'Retrieve a list of all families for a given brand.', inputSchema: { type: 'object', properties: { brand_id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'BrandID of the brand', }, }, required: ['brand_id'], }, },
- src/index.ts:25-28 (schema)Type guard function for validating 'list_families' tool arguments (schema validation helper).const isListFamiliesArgs = (args: any): args is { brand_id: string | number } => typeof args === 'object' && args !== null && (typeof args.brand_id === 'string' || typeof args.brand_id === 'number');
- src/index.ts:236-246 (helper)Shared API execution and response formatting logic used by all tools, including 'list_families'.const response = await this.axiosInstance.get(apiPath, { params: apiParams }); // Return successful response return { content: [ { type: 'text', // Corrected type to 'text' text: JSON.stringify(response.data, null, 2), // JSON content is in the text field }, ], };