list_watches
Retrieve a filtered list of watches by Brand and/or Family, optionally limited by update date, using structured queries from WatchBase's comprehensive watch database.
Instructions
Retrieve a list of watches for a particular Brand and/or Family, optionally filtered by update date.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brand_id | Yes | BrandID of the brand | |
| family_id | No | Optional: FamilyID of the family | |
| updated_since | No | Optional: Limit results to watches updated after this date (YYYY-MM-DD) |
Implementation Reference
- src/index.ts:216-226 (handler)Handler logic for the 'list_watches' tool: validates input using isListWatchesArgs, sets API endpoint to 'watches', and constructs query parameters including brand_id, optional family_id, and updated_since.case 'list_watches': if (!isListWatchesArgs(args)) throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for list_watches'); apiPath = 'watches'; apiParams = { 'brand-id': args.brand_id }; // API uses hyphen if (args.family_id !== undefined) { apiParams['family-id'] = args.family_id; // API uses hyphen } if (args.updated_since !== undefined) { apiParams['updated-since'] = args.updated_since; // API uses hyphen } break;
- src/index.ts:30-46 (schema)Type guard function for validating arguments to the 'list_watches' tool, checking types for brand_id (required), family_id (optional), and updated_since (optional YYYY-MM-DD string).const isListWatchesArgs = ( args: any ): args is { brand_id: string | number; family_id?: string | number; updated_since?: string; } => typeof args === 'object' && args !== null && (typeof args.brand_id === 'string' || typeof args.brand_id === 'number') && (args.family_id === undefined || typeof args.family_id === 'string' || typeof args.family_id === 'number') && (args.updated_since === undefined || (typeof args.updated_since === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(args.updated_since))); // Basic YYYY-MM-DD check
- src/index.ts:143-167 (registration)Tool registration entry for 'list_watches', including name, description, and detailed inputSchema defining parameters and requirements.{ name: 'list_watches', description: 'Retrieve a list of watches for a particular Brand and/or Family, optionally filtered by update date.', inputSchema: { type: 'object', properties: { brand_id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'BrandID of the brand', }, family_id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'Optional: FamilyID of the family', }, updated_since: { type: 'string', format: 'date', // Indicates YYYY-MM-DD format description: 'Optional: Limit results to watches updated after this date (YYYY-MM-DD)', }, }, required: ['brand_id'], }, },
- src/index.ts:147-166 (schema)Input schema definition for the 'list_watches' tool, specifying object properties, types, and required fields.inputSchema: { type: 'object', properties: { brand_id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'BrandID of the brand', }, family_id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'Optional: FamilyID of the family', }, updated_since: { type: 'string', format: 'date', // Indicates YYYY-MM-DD format description: 'Optional: Limit results to watches updated after this date (YYYY-MM-DD)', }, }, required: ['brand_id'], },