Mercado Pago MCP Tool

Exposes Mercado Pago operations as AI tools via MCP

Overview

This node provides an AI tool interface to interact with various Mercado Pago operations via MCP (Mercado Pago Connector Platform). It exposes multiple Mercado Pago functionalities such as creating, retrieving, canceling, and searching payments; managing customers; handling orders; working with webhooks; and searching documentation. The "Get All" operation returns a collection of these tools, each representing a specific Mercado Pago API action.

Common scenarios include automating payment processing workflows, customer management, order handling, and webhook configuration within n8n workflows. For example, you could use this node to programmatically create payments, retrieve payment details, update customer information, or list all configured webhooks in your Mercado Pago account.

Properties

Name Meaning
Limit Max number of results to return (number between 1 and 100)
Simple Whether to return simplified response data or the full API response (boolean)
Webhook ID Webhook ID for AI tool integration (string)

Output

The output is an array of objects where each object contains a json field with a tool property. Each tool represents a Mercado Pago operation exposed as an AI tool, including its name, description, input schema, and an asynchronous function to perform the API call.

Example output structure:

[
  {
    "json": {
      "tool": {
        "name": "mercadopago_payment_create",
        "description": "Create a new payment in Mercado Pago",
        "schema": { /* Zod schema describing input parameters */ },
        "func": "async function to execute the API call"
      }
    },
    "pairedItem": { "item": 0 }
  },
  ...
]

No binary data is output by this node.

Dependencies

  • Requires an API key credential for Mercado Pago authentication.
  • Uses Axios for HTTP requests to Mercado Pago's REST API.
  • Depends on the @langchain/core/tools package for defining dynamic structured tools.
  • Uses zod for input schema validation.
  • The node expects proper configuration of the Mercado Pago API credentials in n8n.

Troubleshooting

  • Authentication errors: Ensure that the provided API key credential is valid and has sufficient permissions.
  • API request failures: Network issues or incorrect parameters can cause errors. Check error messages returned from Mercado Pago API for details.
  • Invalid input data: Input parameters must conform to the expected types and formats defined in the schemas (e.g., valid email addresses, required fields).
  • Limit parameter out of range: The limit must be between 1 and 100; values outside this range may cause errors.
  • Webhook ID usage: If using webhook-related tools, ensure the webhook ID is correct and corresponds to an existing webhook.

Error messages typically include the reason returned by the Mercado Pago API or a generic message indicating which operation failed (e.g., "Payment creation failed", "Customer retrieval failed").

Links and References

Discussion