product_reviews
Retrieve product reviews from MercadoLibre to analyze customer feedback and make informed purchasing decisions.
Instructions
Obtiene las reseñas 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_reviews"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| productId | No | ID del producto |
Implementation Reference
- src/handlers/tools.handler.ts:95-100 (handler)Handler case for 'product_reviews' tool: extracts productId from args, calls apiService.productReviews, and returns JSON-stringified reviews as text content.
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:51-60 (registration)Registration of the 'product_reviews' tool in listTools(), including name, description, and input schema requiring productId.
{ 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:54-59 (schema)Input schema for product_reviews tool: object with required productId string.
inputSchema: { type: 'object', properties: { productId: { type: 'string', description: 'ID del producto' } } } - src/services/api.service.ts:60-68 (helper)apiService.productReviews method: fetches product reviews from MercadoLibre API endpoint '/reviews/item/{productId}' using authenticated headers.
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 }