Skip to content

Add mercadopago-agent-toolkit example#1477

Open
naza00000 wants to merge 1 commit intovercel:mainfrom
naza00000:add-mercadopago-agent-toolkit
Open

Add mercadopago-agent-toolkit example#1477
naza00000 wants to merge 1 commit intovercel:mainfrom
naza00000:add-mercadopago-agent-toolkit

Conversation

@naza00000
Copy link
Copy Markdown

Description

Adds a new solutions/mercadopago-agent-toolkit/ example: a Next.js app where an agent drives Mercado Pago billing flows (Subscriptions, Payments, Refunds, Cuotas) via @ar-agents/mercadopago, Vercel AI SDK 6, and the AI Gateway.

The agent picks the right tool from a natural-language prompt:

  • Cobrale $25.000 mensual a juan@example.com con razón Plan Pro. routes to create_subscription.
  • Buscá pagos de los últimos 30 días por más de $5.000. routes to search_payments.
  • Reembolsame el último pago de juan@example.com. confirms then calls refund_payment.

Vercel-native bits used:

  • AI Gateway routes the LLM call by string model name (anthropic/claude-sonnet-4-6), so the Anthropic key never touches the client bundle.
  • Edge Runtime on /api/agent: the package is Web-Crypto based.
  • The package ships @ar-agents/mercadopago/vercel-kv (subscription state, OAuth tokens, idempotency cache, audit log, distributed rate limiter) and @ar-agents/mercadopago/otel (OpenTelemetry instrumentation) as subpath exports.

Demo URL

https://ar-agents.vercel.app (the live landing has a "Try it with a live agent" panel that runs the same code path against mocked MP tools).

Type of Change

  • New Example
  • Example updates (Bug fixes, new features, etc.)
  • Other (changes to the codebase, but not to examples)

New Example Checklist

  • 🛫 npm run new-example was used to create the example
  • 📚 The template wasn't used but I carefully read Adding a new example and followed the structure (.gitignore, package.json with MIT license, README.md with front matter metadata + deployUrl + demoUrl, .env.example)
  • 📱 Responsive (single-column chat, no fixed widths)
  • License is MIT
  • Front matter metadata included so the example can be featured on vercel.com/templates

Notes for reviewers

  • The package handles 89 typed tools across the agent-relevant Mercado Pago surface; this example only exercises a subset to keep the demo small. The full surface is documented at packages/mercadopago/AGENTS.md.
  • The cookbook with 9 production recipes lives at packages/mercadopago/cookbook.
  • Open source, MIT, no Vercel dependency injected: the example just uses the published npm package.

Adds a Next.js example where an agent drives Mercado Pago billing
flows (Subscriptions, Payments, Refunds, Cuotas) via the
@ar-agents/mercadopago package, Vercel AI SDK 6, and AI Gateway.

The route handler picks anthropic/claude-sonnet-4-6 by string model
name so the Anthropic key stays on the Gateway side, and wires the
89 MP tools into streamText with stepCountIs(8). Idempotency keys
are auto-derived in the package.

Live demo: https://ar-agents.vercel.app
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 7, 2026

@naza00000 is attempting to deploy a commit to the Vercel Examples Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 7, 2026

Deployment failed with the following error:

The `vercel.ts` schema validation failed with the following message: `rewrites[0]` missing required property `destination`

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​ar-agents/​mercadopago@​0.15.27910010095100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant