product_reviews
Retrieve product reviews by entering the product ID to analyze customer feedback and insights from MercadoLibre's marketplace.
Instructions
Obtiene las reseñas de un producto
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | No | ID del producto |
Implementation Reference
- src/services/api.service.ts:60-68 (handler)Core implementation of the product_reviews tool: fetches reviews from MercadoLibre API using the provided product ID.async productReviews (productId: string) { const headers = await this.getHeaders() const response = await fetch(`${this.baseURL}reviews/item/${productId}`, { headers }) if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`) } const data = await response.json() return data }
- src/handlers/tools.handler.ts:95-101 (handler)Dispatch handler in callTool method that extracts productId from args and invokes the apiService.productReviews implementation.case 'product_reviews': { const { productId } = args as { productId: string } const reviews = await this.apiService.productReviews(productId) return { content: [{ type: 'text', text: JSON.stringify(reviews, null, 2) }] } }
- src/handlers/tools.handler.ts:52-59 (schema)Input schema definition for the product_reviews tool, specifying the required productId parameter.name: 'product_reviews', description: 'Obtiene las reseñas de un producto', inputSchema: { type: 'object', properties: { productId: { type: 'string', description: 'ID del producto' } } }
- src/handlers/tools.handler.ts:51-60 (registration)Registration of the product_reviews tool in the listTools() response array.{ name: 'product_reviews', description: 'Obtiene las reseñas de un producto', inputSchema: { type: 'object', properties: { productId: { type: 'string', description: 'ID del producto' } } } },