search
Query the WatchBase database using brand, family, watch names, or reference numbers to retrieve comprehensive watch metadata and technical details.
Instructions
Search the database by brand name, family name, watch name and reference number (whole words).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Search keywords |
Implementation Reference
- src/index.ts:193-197 (handler)Handler logic for the 'search' MCP tool: validates input arguments using isSearchArgs type guard, sets the API endpoint path to 'search', and prepares query parameters { q: args.q } for the subsequent axios GET request to the WatchBase API.case 'search': if (!isSearchArgs(args)) throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for search'); apiPath = 'search'; apiParams = { q: args.q }; break;
- src/index.ts:101-111 (registration)Registration of the 'search' tool in the list returned by ListToolsRequestSchema handler, defining name, description, and input schema.name: 'search', description: 'Search the database by brand name, family name, watch name and reference number (whole words).', inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Search keywords' }, }, required: ['q'], }, },
- src/index.ts:104-110 (schema)Input schema definition for the 'search' tool, specifying an object with a required 'q' string property for search keywords.inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Search keywords' }, }, required: ['q'], },
- src/index.ts:22-23 (helper)Helper type guard function isSearchArgs that validates if the tool arguments match the expected { q: string } shape for the 'search' tool.const isSearchArgs = (args: any): args is { q: string } => typeof args === 'object' && args !== null && typeof args.q === 'string';