search
Find watches in the WatchBase database by entering brand, family, model names, or reference numbers. This tool helps users locate specific watch information using targeted search queries.
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:190-194 (handler)The handler function for the 'search' tool within the CallToolRequestSchema request handler. It validates the input arguments using the isSearchArgs type guard and sets the apiPath and apiParams for the subsequent API call to 'search' endpoint.case 'search': if (!isSearchArgs(args)) throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for search'); apiPath = 'search'; apiParams = { q: args.q }; break;
- src/index.ts:97-108 (registration)Registers the 'search' tool in the tools array used by the ListToolsRequestSchema handler.{ 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:101-107 (schema)Input schema definition for the 'search' tool, specifying the required 'q' string parameter.inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Search keywords' }, }, required: ['q'], },
- src/index.ts:22-23 (helper)Type guard helper function used to validate arguments for the 'search' tool (shared with 'search_refnr').const isSearchArgs = (args: any): args is { q: string } => typeof args === 'object' && args !== null && typeof args.q === 'string';