search_refnr
Query the WatchBase database by reference number to retrieve detailed watch metadata, supporting partial matches for flexible searches.
Instructions
Search the database by reference number (allows partial matches).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Search keywords (reference number) |
Implementation Reference
- src/index.ts:199-203 (handler)Handler logic for the 'search_refnr' tool. Validates the input arguments using the isSearchArgs type guard, sets the API endpoint to 'search/refnr', and passes the query parameter 'q'.case 'search_refnr': if (!isSearchArgs(args)) throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for search_refnr'); apiPath = 'search/refnr'; apiParams = { q: args.q }; break;
- src/index.ts:116-122 (schema)Input schema definition for the 'search_refnr' tool, specifying a required 'q' string parameter for the reference number search query.inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Search keywords (reference number)' }, }, required: ['q'], },
- src/index.ts:112-123 (registration)Tool registration object for 'search_refnr' including name, description, and input schema, added to the tools list served via ListToolsRequestSchema.{ name: 'search_refnr', description: 'Search the database by reference number (allows partial matches).', inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Search keywords (reference number)' }, }, required: ['q'], }, },
- src/index.ts:22-24 (helper)Shared type guard helper function used to validate arguments for both 'search' and 'search_refnr' tools, ensuring 'q' is a string.const isSearchArgs = (args: any): args is { q: string } => typeof args === 'object' && args !== null && typeof args.q === 'string';