bos_product_search
Locate products in the BOS ERP system using name, SKU, or barcode search. Returns product details.
Instructions
Search products by name, SKU, or bar code
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"q": "<q>"
},
"name": "bos_product_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Search query |
Implementation Reference
- src/tools/bos.ts:30-30 (handler)The handler function for 'bos_product_search' tool - makes a GET request to '/mcp/products/search' with the query params.
handler: async (args, client) => client.get('/mcp/products/search', args), - src/tools/bos.ts:29-29 (schema)Input schema for 'bos_product_search' - expects a single 'q' (string) field as the search query.
schema: { q: { type: 'string', description: 'Search query' } }, - src/tools/bos.ts:27-27 (registration)Registration of the tool with name 'bos_product_search' and description 'Search products by name, SKU, or bar code' in the productTools array.
name: 'bos_product_search', - src/index.ts:33-33 (registration)The productTools array (containing bos_product_search) is spread into allTools and then registered via server.tool() in the loop at lines 55-76.
...productTools, - src/tools/index.ts:21-61 (helper)The toZodSchema helper converts the tool's schema definition into a Zod schema for MCP SDK validation.
export function toZodSchema(schema: Record<string, any>): z.ZodObject<any> { const shape: Record<string, z.ZodTypeAny> = {}; for (const [key, def] of Object.entries(schema)) { let field: z.ZodTypeAny; switch (def.type) { case 'number': field = z.number(); break; case 'boolean': field = z.boolean(); break; case 'array': field = z.array(z.any()); break; case 'object': field = z.record(z.any()); break; case 'string': default: if (def.enum) { field = z.enum(def.enum); } else { field = z.string(); } break; } if (def.description) { field = field.describe(def.description); } if (def.optional) { field = field.optional(); } shape[key] = field; } return z.object(shape);