list_families
Retrieve all watch families for a specific brand using the WatchBase MCP Server, enabling structured access to comprehensive watch metadata for querying and analysis.
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:210-214 (handler)Handler logic for the list_families tool: validates input arguments using type guard and sets the API endpoint ('families') and parameters for the WatchBase API call.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:132-141 (schema)Input schema definition for the list_families tool, specifying brand_id as required string or number.inputSchema: { type: 'object', properties: { brand_id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'BrandID of the brand', }, }, required: ['brand_id'], },
- src/index.ts:129-142 (registration)Registration of the list_families tool within the tools array returned by the ListTools handler.{ 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 (helper)Type guard helper function used to validate arguments for the list_families tool in the handler.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');