b24_products_get
Retrieve full product details from Bitrix24 by providing the product ID.
Instructions
Obtiene el detalle completo de un producto por ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID del producto | |
| webhook_url | No |
Implementation Reference
- src/tools/catalog-products.js:39-43 (handler)The handler function that executes the 'b24_products_get' tool logic. It creates a Bitrix24Client, calls 'catalog.product.get' with the provided ID, and returns the product details.
export async function productsGet({ id, webhook_url }) { const client = new Bitrix24Client(resolveWebhook(webhook_url)); const res = await client.call('catalog.product.get', { id }); return { portal: client.portal, product: res.result }; } - src/tools/catalog-products.js:34-37 (schema)Zod schema for the 'b24_products_get' tool. Defines input: id (string|number) and webhook_url (optional URL).
export const productsGetSchema = z.object({ id: z.union([z.string(), z.number()]).describe('ID del producto'), webhook_url: z.string().url().optional(), }); - index.js:267-269 (registration)Registration of the 'b24_products_get' tool on the MCP server, binding the schema and handler via wrap().
server.tool('b24_products_get', 'Obtiene el detalle completo de un producto por ID.', productsGetSchema.shape, wrap(productsGet)); - src/tools/catalog-products.js:39-43 (helper)Uses 'Bitrix24Client' from '../bitrix24/client.js' and 'resolveWebhook' from '../utils/resolve-webhook.js' as helpers to execute the API call.
export async function productsGet({ id, webhook_url }) { const client = new Bitrix24Client(resolveWebhook(webhook_url)); const res = await client.call('catalog.product.get', { id }); return { portal: client.portal, product: res.result }; }