Skip to main content

Overview

This reference documents every MCP tool exposed by the Yuno MCP server. Each tool maps to a Yuno API endpoint and follows the Model Context Protocol specification.
Underlying REST calls use the same authentication as the public API: public-api-key and private-secret-key headers, plus account_id in the body on endpoints that take it. The MCP server reads sandbox credentials from its own environment variables (see LLM & MCP integration).
MCP tools are designed for sandbox use during development and debugging. All tool calls count against your standard API rate limits.

Tool Summary

ToolOperationAPI EndpointMethod
create_checkout_sessionStart a payment flow/v1/checkout/sessionsPOST
create_paymentProcess a payment/v1/paymentsPOST
get_paymentRetrieve payment details/v1/payments/{id}GET
list_paymentsList recent payments/v1/paymentsGET
capture_paymentCapture authorized payment/v1/payments/{id}/capturePOST
cancel_paymentCancel a payment/v1/payments/{id}/cancelPOST
create_refundRefund a payment/v1/payments/{id}/refundPOST
get_payment_methodsList available methods/v1/checkout/sessions/{id}GET
validate_payloadPre-flight validationClient-sideN/A
create_customerCreate customer record/v1/customersPOST
get_customerRetrieve customer/v1/customers/{id}GET
create_recipientCreate payout recipient/v1/recipientsPOST
create_payoutSend funds to recipient/v1/payoutsPOST

Tool Dependency Matrix

Some tools require outputs from other tools. This matrix shows prerequisites.
ToolRequiresProvides
create_checkout_sessionNonecheckout_session (UUID)
create_paymentcheckout_sessionpayment_id (UUID)
get_paymentpayment_idPayment status, details
list_paymentsNoneArray of payment objects
capture_paymentpayment_id (status: AUTHORIZED)Updated payment
cancel_paymentpayment_id (status: AUTHORIZED/PENDING)Updated payment
create_refundpayment_id (status: SUCCEEDED)Updated payment
get_payment_methodscheckout_sessionAvailable payment methods
validate_payloadNoneValidation result
create_customerNonecustomer_id (UUID)
get_customercustomer_idCustomer details
create_recipientNonerecipient_id (UUID)
create_payoutrecipient_idpayout_id (UUID)

Calling Order for Common Flows

Standard payment: create_checkout_session -> create_payment -> get_payment Auth + capture: create_checkout_session -> create_payment -> capture_payment Refund: get_payment (verify status) -> create_refund Payout: create_recipient -> create_payout

Tool Specifications

create_checkout_session

Creates a new checkout session to initialize a payment flow. Input Schema:
{
  "type": "object",
  "required": ["amount", "country", "merchant_order_id"],
  "properties": {
    "amount": {
      "type": "object",
      "required": ["currency", "value"],
      "properties": {
        "currency": { "type": "string", "description": "ISO 4217 code (e.g., USD, BRL, COP, MXN)" },
        "value": { "type": "number", "description": "Amount in major currency units" }
      }
    },
    "country": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "ISO 3166-1 alpha-2" },
    "merchant_order_id": { "type": "string", "description": "Your unique order reference" },
    "payment_description": { "type": "string" },
    "customer_id": { "type": "string", "format": "uuid" },
    "workflow": { "type": "string", "enum": ["SDK_CHECKOUT", "SDK_LITE", "DIRECT"] }
  }
}
Output Schema:
{
  "type": "object",
  "properties": {
    "checkout_session": { "type": "string", "format": "uuid" },
    "amount": { "$ref": "Amount" },
    "country": { "type": "string" },
    "merchant_order_id": { "type": "string" },
    "status": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" },
    "payment_methods": { "type": "array" }
  }
}
Rate limit: 100 requests per 60 seconds Idempotency: Not idempotent. Each call creates a new session. Use unique merchant_order_id values. Error codes:
CodeHTTPDescriptionAction
VALIDATION_ERROR400Schema or constraint validation failed. messages names the failed fields.Fix the named fields, retry.
INVALID_REQUEST400Request rejected by business rules.Fix the payload, retry.
UNAUTHORIZED401Missing or invalid public-api-key / private-secret-key.Verify the headers.
TOO_MANY_REQUESTS429Edge throttling.Exponential backoff with full jitter. Honor Retry-After.
INTERNAL_ERROR500Server side error.Retry with backoff.

create_payment

Creates a payment against an existing checkout session. Input Schema:
{
  "type": "object",
  "required": ["checkout_session", "payment_method", "amount", "country"],
  "properties": {
    "checkout_session": { "type": "string", "format": "uuid" },
    "payment_method": {
      "type": "object",
      "required": ["type"],
      "properties": {
        "type": { "type": "string", "enum": ["CARD", "PIX", "BOLETO", "PSE", "SPEI", "OXXO", "BNPL", "GOOGLE_PAY", "APPLE_PAY"] },
        "token": { "type": "string", "description": "Tokenized card payment method" },
        "vaulted_token": { "type": "string", "description": "Stored payment method for returning customers" }
      }
    },
    "amount": { "$ref": "Amount" },
    "country": { "type": "string", "pattern": "^[A-Z]{2}$" },
    "customer": {
      "type": "object",
      "properties": {
        "document": { "$ref": "CustomerDocument" },
        "email": { "type": "string", "format": "email" },
        "first_name": { "type": "string" },
        "last_name": { "type": "string" },
        "phone": { "type": "string" }
      }
    },
    "description": { "type": "string" },
    "installments": { "type": "integer", "minimum": 1 }
  }
}
Output Schema:
{
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "checkout_session": { "type": "string", "format": "uuid" },
    "status": { "type": "string", "enum": ["SUCCEEDED", "PENDING", "DECLINED", "REJECTED", "AUTHORIZED"] },
    "amount": { "$ref": "Amount" },
    "country": { "type": "string" },
    "payment_method": { "type": "object" },
    "provider": { "type": "object" },
    "merchant_order_id": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" },
    "updated_at": { "type": "string", "format": "date-time" }
  }
}
Rate limit: 100 requests per 60 seconds Idempotency: One payment per checkout session. Submitting a second payment to the same session returns an error. Parameter validation rules:
  • checkout_session must reference an ACTIVE session
  • amount must match the session amount
  • country must match the session country
  • PIX payments in BR require customer.document (CPF or CNPJ)
  • CARD payments require either token or vaulted_token
  • installments only applies to CARD payments
Error codes:
codeHTTPDescriptionAction
VALIDATION_ERROR400Required field missing or malformed. messages names every failed field.Fix the named fields and retry.
INVALID_REQUEST400Request rejected by business rules.Fix the payload according to messages and retry.
PROVIDER_UNAVAILABLE_PAYMENT_METHOD400The selected method is not available on the routed provider.Enable the method or pick another.
PROVIDER_INVALID_REQUEST400Provider rejected the transaction.Check the provider response in messages.
TOO_MANY_REQUESTS429Edge throttling.Retry with exponential backoff and full jitter.

get_payment

Retrieves payment details by ID. Use for polling payment status. Input Schema:
{
  "type": "object",
  "required": ["payment_id"],
  "properties": {
    "payment_id": { "type": "string", "format": "uuid" }
  }
}
Output Schema: Same as create_payment output. Rate limit: Standard API limits Idempotency: Safe to call repeatedly (GET request). Error codes:
CodeHTTPDescriptionAction
NOT_FOUND404Payment ID does not existVerify the payment_id

list_payments

Returns a paginated list of payments. Input Schema:
{
  "type": "object",
  "properties": {
    "limit": { "type": "integer", "default": 20, "maximum": 100 },
    "starting_after": { "type": "string", "description": "Payment ID cursor for forward pagination" },
    "ending_before": { "type": "string", "description": "Payment ID cursor for backward pagination" }
  }
}
Output Schema:
{
  "type": "array",
  "items": { "$ref": "Payment" }
}
Rate limit: 100 requests per 60 seconds Idempotency: Safe to call repeatedly (GET request).

capture_payment

Captures a previously authorized payment. Only valid for payments in AUTHORIZED status. Input Schema:
{
  "type": "object",
  "required": ["payment_id"],
  "properties": {
    "payment_id": { "type": "string", "format": "uuid" },
    "amount": {
      "type": "object",
      "properties": {
        "currency": { "type": "string" },
        "value": { "type": "number", "description": "Capture amount. Must be <= authorized amount." }
      }
    }
  }
}
Output Schema: Same as create_payment output (status changes to SUCCEEDED). Parameter validation rules:
  • Payment must be in AUTHORIZED status
  • Capture amount must not exceed authorized amount
  • Partial capture is supported (amount < authorized amount)
Error codes:
CodeHTTPDescriptionAction
INVALID_STATE400Payment not in AUTHORIZED statusVerify payment status first
INVALID_REQUEST400Capture amount greater than the authorized amount.Reduce capture amount.

cancel_payment

Cancels a pending or authorized payment. Input Schema:
{
  "type": "object",
  "required": ["payment_id"],
  "properties": {
    "payment_id": { "type": "string", "format": "uuid" }
  }
}
Output Schema: Same as create_payment output (status changes to CANCELLED). Error codes:
CodeHTTPDescriptionAction
INVALID_STATE400Payment cannot be cancelled in current stateUse refund instead for SUCCEEDED payments

create_refund

Refunds a completed payment. Supports full and partial refunds. Input Schema:
{
  "type": "object",
  "required": ["payment_id"],
  "properties": {
    "payment_id": { "type": "string", "format": "uuid" },
    "amount": {
      "type": "object",
      "description": "Omit for full refund",
      "properties": {
        "currency": { "type": "string" },
        "value": { "type": "number" }
      }
    },
    "reason": { "type": "string" }
  }
}
Output Schema: Same as create_payment output (status changes to REFUNDED or PARTIALLY_REFUNDED). Parameter validation rules:
  • Payment must be in SUCCEEDED or PARTIALLY_REFUNDED status
  • Refund amount must not exceed remaining refundable balance
  • Omitting amount triggers a full refund
Error codes:
CodeHTTPDescriptionAction
INVALID_STATE400Payment not refundableVerify payment status
INVALID_REQUEST400Refund amount exceeds remaining balance.Reduce refund amount.

validate_payload

Client-side validation tool that checks a payment payload against Yuno’s schema without making an API call. Input Schema:
{
  "type": "object",
  "required": ["payload", "operation"],
  "properties": {
    "payload": { "type": "object", "description": "The request body to validate" },
    "operation": {
      "type": "string",
      "enum": ["createCheckoutSession", "createPayment", "createRefund", "createPayout"],
      "description": "The operation this payload is intended for"
    }
  }
}
Output Schema:
{
  "type": "object",
  "properties": {
    "valid": { "type": "boolean" },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": { "type": "string" },
          "message": { "type": "string" },
          "expected": { "type": "string" }
        }
      }
    }
  }
}
Rate limit: No API call made; unlimited. Idempotency: Stateless; always safe to call.

create_customer

Creates a customer record for use in checkout sessions. Input Schema:
{
  "type": "object",
  "required": ["email"],
  "properties": {
    "email": { "type": "string", "format": "email" },
    "first_name": { "type": "string" },
    "last_name": { "type": "string" },
    "phone": { "type": "string" },
    "document": { "$ref": "CustomerDocument" },
    "merchant_customer_id": { "type": "string" }
  }
}
Output Schema:
{
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "email": { "type": "string" },
    "first_name": { "type": "string" },
    "last_name": { "type": "string" },
    "phone": { "type": "string" },
    "document": { "$ref": "CustomerDocument" },
    "merchant_customer_id": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" }
  }
}
Error codes:
CodeHTTPDescriptionAction
INVALID_REQUEST400Invalid email or document formatFix field format
DUPLICATE400Customer with same email existsUse existing customer

create_recipient

Creates a payout recipient with bank account details. Input Schema:
{
  "type": "object",
  "required": ["merchant_recipient_id", "country"],
  "properties": {
    "merchant_recipient_id": { "type": "string" },
    "country": { "type": "string", "pattern": "^[A-Z]{2}$" },
    "name": { "type": "string" },
    "email": { "type": "string", "format": "email" },
    "document": { "$ref": "CustomerDocument" },
    "bank_account": {
      "type": "object",
      "properties": {
        "bank_code": { "type": "string" },
        "account_number": { "type": "string" },
        "account_type": { "type": "string", "enum": ["CHECKING", "SAVINGS"] }
      }
    }
  }
}
Output Schema:
{
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "merchant_recipient_id": { "type": "string" },
    "country": { "type": "string" },
    "name": { "type": "string" },
    "bank_account": { "type": "object" },
    "created_at": { "type": "string", "format": "date-time" }
  }
}

create_payout

Sends funds to a previously created recipient. Input Schema:
{
  "type": "object",
  "required": ["amount", "country", "recipient_id"],
  "properties": {
    "amount": { "$ref": "Amount" },
    "country": { "type": "string", "pattern": "^[A-Z]{2}$" },
    "recipient_id": { "type": "string", "format": "uuid" },
    "description": { "type": "string" },
    "merchant_reference": { "type": "string" },
    "purpose": { "type": "string" }
  }
}
Output Schema:
{
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "status": { "type": "string", "enum": ["PENDING", "SUCCEEDED", "FAILED", "CANCELLED"] },
    "amount": { "$ref": "Amount" },
    "recipient_id": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" }
  }
}

Multi-Step Examples

Example: Complete Payment Flow

Step 1: Agent calls create_checkout_session
  Input:  { amount: { currency: "USD", value: 99.90 }, country: "US", merchant_order_id: "order-123" }
  Output: { checkout_session: "sess_abc123", status: "ACTIVE", payment_methods: [...] }

Step 2: Agent calls create_payment
  Input:  { checkout_session: "sess_abc123", payment_method: { type: "CARD", token: "tok_test_abc" }, amount: { currency: "USD", value: 99.90 }, country: "US", customer: { email: "dee@hock.example", first_name: "Jane", last_name: "Smith" } }
  Output: { id: "pay_def456", status: "SUCCEEDED" }

Step 3: Agent calls get_payment (polling)
  Input:  { payment_id: "pay_def456" }
  Output: { id: "pay_def456", status: "SUCCEEDED" }

Example: Validate then Create

Step 1: Agent calls validate_payload
  Input:  { payload: { amount: { currency: "USD" }, country: "US" }, operation: "createCheckoutSession" }
  Output: { valid: false, errors: [{ field: "amount.value", message: "Required field missing" }, { field: "merchant_order_id", message: "Required field missing" }] }

Step 2: Agent fixes payload and calls create_checkout_session
  Input:  { amount: { currency: "USD", value: 50.00 }, country: "US", merchant_order_id: "order-456" }
  Output: { checkout_session: "sess_ghi789", status: "ACTIVE" }

Rate Limiting

All MCP tools that make API calls share the same rate limits as direct API access.
Endpoint GroupLimitWindowScope
Checkout Sessions (create)10060 secondsPer API key
Payments (create)10060 secondsPer API key
Payments (list)10060 secondsPer API key
All other endpointsStandardStandardPer API key
When rate limited (HTTP 429), implement exponential backoff:
Retry 1: wait 1 second
Retry 2: wait 2 seconds
Retry 3: wait 4 seconds
Maximum retries: 3