bos_product_list
Retrieve a paginated list of products filtered by category, search query, or status.
Instructions
List products with pagination and filters
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "bos_product_list"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| page_size | No | ||
| category_id | No | ||
| search | No | ||
| status | No |
Implementation Reference
- src/tools/bos.ts:8-19 (handler)The handler for 'bos_product_list' tool. It receives optional args (page, page_size, category_id, search, status) and delegates to client.get('/mcp/products', args), making a GET request to the BOS API.
{ name: 'bos_product_list', description: 'List products with pagination and filters', schema: { page: { type: 'number', optional: true }, page_size: { type: 'number', optional: true }, category_id: { type: 'string', optional: true }, search: { type: 'string', optional: true }, status: { type: 'string', enum: ['active', 'inactive'], optional: true }, }, handler: async (args, client) => client.get('/mcp/products', args), }, - src/tools/bos.ts:11-17 (schema)Input schema for 'bos_product_list': page (number, optional), page_size (number, optional), category_id (string, optional), search (string, optional), status (string enum active/inactive, optional).
schema: { page: { type: 'number', optional: true }, page_size: { type: 'number', optional: true }, category_id: { type: 'string', optional: true }, search: { type: 'string', optional: true }, status: { type: 'string', enum: ['active', 'inactive'], optional: true }, }, - src/index.ts:54-76 (registration)Registration: the tool is registered via McpServer.tool() in the main entry point. The productTools array is spread into allTools, then each tool is iterated and registered with its zodSchema and handler.
// Register all tools with proper Zod schemas 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/client/index.ts:88-92 (helper)The BosApiClient.get() method which is called by the handler. It delegates to request('GET', ...) and sends query params for list requests.
// BUG 2+3 FIX: GET now accepts optional query params async get<T>(path: string, params?: Record<string, any>): Promise<T> { return this.request<T>('GET', path, undefined, params); }