product_description
Retrieve product descriptions from MercadoLibre using product IDs to display detailed item information for listings or research.
Instructions
Obtiene la descripción de un producto
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": "product_description"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | No | ID del producto |
Implementation Reference
- src/handlers/tools.handler.ts:103-109 (handler)The handler case in callTool method for the 'product_description' tool. Extracts productId from args, calls apiService.productDescription, and returns the result as JSON text content.
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:61-65 (registration)Registration of the 'product_description' tool in the listTools method, 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:61-65 (schema)Input schema definition for the 'product_description' tool, requiring a productId string.
{ name: 'product_description', description: 'Obtiene la descripción de un producto', inputSchema: { type: 'object', properties: { productId: { type: 'string', description: 'ID del producto' } } } } - src/services/api.service.ts:70-78 (helper)Helper method in ApiService that fetches the product description from the MercadoLibre API endpoint.
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 }