search_refnr
Find watches in the WatchBase database by entering a reference number, supporting partial matches for flexible searching.
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:196-200 (handler)Handler logic for the 'search_refnr' tool. Validates input arguments, sets API path to 'search/refnr', and query parameter to the provided '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:109-120 (registration)Tool registration entry defining the name, description, and input schema for 'search_refnr'. This is part of the tools array returned by ListToolsRequestSchema handler.{ 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-23 (schema)Type guard (schema validation) for input arguments of 'search_refnr' tool, ensuring args is an object with a string 'q' property.const isSearchArgs = (args: any): args is { q: string } => typeof args === 'object' && args !== null && typeof args.q === 'string';