bos_inventory_check
Check real-time stock quantity for a product by providing its product ID to verify inventory levels.
Instructions
Check stock quantity for a product
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| product_id | Yes |
Implementation Reference
- src/tools/bos.ts:408-413 (handler)The handler function for 'bos_inventory_check' that executes the tool logic: calls client.get('/mcp/inventory/check/${args.product_id}') to check stock quantity for a product.
{ name: 'bos_inventory_check', description: 'Check stock quantity for a product', schema: { product_id: { type: 'string' } }, handler: async (args, client) => client.get(`/mcp/inventory/check/${args.product_id}`), }, - src/tools/bos.ts:397-431 (helper)The inventoryTools array definition containing bos_inventory_check along with other inventory tools (list, update, low_stock).
export const inventoryTools: McpTool[] = [ { name: 'bos_inventory_list', description: 'List inventory stock across all products', schema: { page: { type: 'number', optional: true }, page_size: { type: 'number', optional: true }, warehouse_id: { type: 'string', optional: true }, }, handler: async (args, client) => client.get('/mcp/inventory', args), }, { name: 'bos_inventory_check', description: 'Check stock quantity for a product', schema: { product_id: { type: 'string' } }, handler: async (args, client) => client.get(`/mcp/inventory/check/${args.product_id}`), }, { name: 'bos_inventory_update', description: 'Update inventory stock', schema: { product_id: { type: 'string' }, quantity: { type: 'number' }, type: { type: 'string', enum: ['set', 'add', 'subtract'] }, reason: { type: 'string', optional: true }, }, handler: async (args, client) => client.post('/mcp/inventory/update', args), }, { name: 'bos_inventory_low_stock', description: 'Get products with low stock alerts', schema: { threshold: { type: 'number', optional: true } }, handler: async (args, client) => client.get('/mcp/inventory/low-stock', args), }, ]; - src/tools/bos.ts:409-409 (schema)The tool definition object for 'bos_inventory_check', including its name, description, schema (product_id: string), and handler.
name: 'bos_inventory_check', - src/index.ts:55-76 (registration)Registration of all tools via server.tool() loop, including bos_inventory_check. The tool is gathered from inventoryTools array (line 37) and registered with its name, Zod schema, and handler wrapper.
for (const tool of allTools) { const zodSchema = toZodSchema(tool.schema); server.tool( tool.name, tool.description, zodSchema.shape, async (args: any) => { try { const result = await tool.handler(args, client); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } catch (error: any) { return { content: [{ type: 'text' as const, text: JSON.stringify({ error: error.message || 'Unknown error' }) }], isError: true, }; } } ); } - src/index.ts:37-37 (registration)The inventoryTools array is spread into allTools on line 37, which is how bos_inventory_check gets included in the tool registration loop.
...inventoryTools,