product_description
Retrieve detailed product descriptions by providing the product ID. This tool integrates with the MercadoLibre API to streamline access to essential product information.
Instructions
Obtiene la descripción de un producto
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | No | ID del producto |
Implementation Reference
- src/services/api.service.ts:70-78 (handler)Core implementation of the product_description tool: fetches the product description from MercadoLibre API using the provided productId.async productDescription (productId: string) { const headers = await this.getHeaders() const response = await fetch(`${this.baseURL}items/${productId}/description`, { headers }) if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`) } const data = await response.json() return data }
- src/handlers/tools.handler.ts:61-65 (registration)Registration of the 'product_description' tool in listTools(), including name, description, and input schema.{ name: 'product_description', description: 'Obtiene la descripción de un producto', inputSchema: { type: 'object', properties: { productId: { type: 'string', description: 'ID del producto' } } } }
- src/handlers/tools.handler.ts:103-109 (handler)Handler logic in callTool() that extracts productId from args, calls the apiService, and formats the response.case 'product_description': { const { productId } = args as { productId: string } const description = await this.apiService.productDescription(productId) return { content: [{ type: 'text', text: JSON.stringify(description, null, 2) }] } }
- src/handlers/tools.handler.ts:64-64 (schema)Input schema for the product_description tool: requires productId as string.inputSchema: { type: 'object', properties: { productId: { type: 'string', description: 'ID del producto' } } }