Skip to main content
Glama
watchdealer-pavel

WatchBase MCP Server

list_watches

Retrieve watches by brand and family with optional date filtering to access comprehensive watch metadata from the WatchBase database.

Instructions

Retrieve a list of watches for a particular Brand and/or Family, optionally filtered by update date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
brand_idYesBrandID of the brand
family_idNoOptional: FamilyID of the family
updated_sinceNoOptional: Limit results to watches updated after this date (YYYY-MM-DD)

Implementation Reference

  • Handler for the 'list_watches' tool: validates arguments, sets API endpoint to '/watches' and constructs query parameters for brand_id (required), family_id (optional), and updated_since (optional). The actual API call is made after the switch statement.
    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;
  • Input schema definition for the 'list_watches' tool, defining parameters and validation rules.
    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:140-164 (registration)
    Tool registration object for 'list_watches' in the tools list provided to clients via list_tools.
    {
      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'],
      },
    },
  • Type guard helper function to validate 'list_watches' tool arguments at runtime, matching the input schema.
    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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/watchdealer-pavel/watchbase-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server