Skip to main content
Glama

validate_payload

Validate JSON payloads for PayRetailers API operations before sending. Runs country-specific checks for documents, amounts, currencies, and method compatibility, returning actionable errors, warnings, and hints to fix common 4xx issues.

Instructions

REQUIRED whenever the user shows or you are about to emit a JSON body for POST /transactions, POST /payouts, POST /customers, POST /v1/subscription-products, POST /v1/subscriptions, or POST /v1/subscription-payments — even if the payload looks correct. Runs the same checks a senior PayRetailers integrator would run in code review: country-specific document checksum (CPF, CNPJ, RUT, DNI, RUC, CC, NIT, CURP, RFC, CLABE), minor-units-as-string amount format, currency/country match, HTTPS notificationUrl, method/country compatibility (PIX only BR, BRE_B only CO, SPEI only MX, etc.), idempotency key length, trackingId ≤ 50 chars, customer required fields matrix (customer.ip / customer.country always; city+address in CO or card in EC/MX; zip on cards in EC/MX; phone on Boleto/Efecty/PagoEfectivo/Yape/Plin/WesternUnion-PA/African methods). For subscriptions: enforces billingCycle shape, Bacen PIX_SPECIFIC contract (maxRetries=3 / retryIntervalDays=7 fixed for BR PIX Automático), FIXED_RETRY config completeness, and authorisationJourney vocabulary (BACKGROUND / USER_INTERACTION). Returns machine-readable {errors, warnings, info} with code, path, severity, hint and often a suggestion — pipe those back into the corrected payload before you show any curl / SDK call to the user. Do not skip: a payload that 'looks fine' but hits the API returns generic 4xx errors that are far harder to interpret than the codes this tool emits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoPayment method (e.g. 'PIX', 'CARD', 'SPEI', 'BRE_B', 'ALIAS_CVU'). Enables method-specific rules.
countryNoISO 3166-1 alpha-2 country code. If omitted, taken from payload.country. Determines the personalId format to validate.
payloadYesThe JSON body you're about to POST to the PayRetailers API. Pass it verbatim (no headers, just the body).
operationYesWhich PayRetailers operation the payload targets. Each operation has its own required fields.
environmentNo'sandbox' allows local/private notificationUrls (with a hint). 'production' rejects them. Default: 'sandbox'.
personalIdTypeNoExplicit personalId type. If omitted, inferred from country + value shape (e.g. BR + 11 digits → CPF).
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the return format ({errors, warnings, info} with code, path, severity, hint, suggestion) and warns that 'looks fine' payloads still need validation—setting expectations that the tool may catch issues even when the user thinks they're correct. It does not explicitly state non-behavior like 'does not make API calls' or 'no side effects', but the description implies a read-only validation function. It adds substantial context beyond the schema, justifying a 4.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very long, though it front-loads the critical usage note ('REQUIRED whenever') and structures the validations as a list. Every sentence adds useful detail, but it could be more concise by grouping related checks. For a tool with high complexity, the length is defensible, but it is not tightly packed—several clauses could be trimmed without loss of meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, nested objects, many validation rules) and the absence of an output schema, the description is remarkably complete. It covers all the inputs' roles, the full set of validations, the output structure, and why skipping is risky. An agent would have everything needed to decide whether and how to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is stated as 100%, so the baseline is 3. The description reinforces parameter roles (e.g., 'operation' selects the rule set, 'environment' affects notificationUrl checks, 'personalIdType' inference) but adds no new parameter info beyond what the schema already describes. It does contextualize why parameters matter, but not enough to exceed baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific, actionable purpose: validating JSON payloads for a defined set of PayRetailers POST endpoints. It enumerates the exact operations and lists the specific validation checks (CPF/CNPJ checksums, amount format, currency/country match, etc.), making the tool's function unambiguous and distinct from sibling tools like search_docs or get_endpoint_spec.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when the tool is REQUIRED ('REQUIRED whenever... even if the payload looks correct') and explains why (generic 4xx errors are hard to interpret). It also directs the user to pipe the returned errors/warnings back into the payload, effectively telling them the expected workflow. No exclusions or alternatives are mentioned, but the tool is clearly the primary validator for these operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/payretailers-dev/payretailers-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server