Skip to main content
Glama

Create payment

payments_create_payment
Idempotent

Creates a gateway payment order or session and returns checkout instructions so the frontend can render an SDK, redirect the browser, or submit a form.

Instructions

Create an order / payment session. Returns checkout, which tells the frontend what to do: js_sdk (load script + options), redirect (send the browser to url), form_post (auto-submit a form with fields), or manual. Persist orderRef + providerOrderId.

Input Schema

NameRequiredDescriptionDefault
amountYesInteger minor units (paise). Rs 499.00 = 49900
currencyNoISO 4217, default INR
customerNo
metadataNo
providerYesGateway id
order_refYesMerchant reference: 3-40 chars, letters/digits/_/-
notify_urlNoServer-to-server notification URL where the gateway takes it per request
return_urlNoBrowser redirect after payment (required for PayU, CCAvenue, Paytm, PhonePe, Stripe Checkout)
descriptionNo
include_rawNoInclude the untouched provider response (verbose).
idempotency_keyNoDefaults to order_ref
provider_optionsNoProvider-specific fields merged into the request

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare openWorldHint, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds genuine value beyond that: the four concrete frontend handling modes for `checkout` (js_sdk, redirect, form_post, manual) and the obligation to persist orderRef + providerOrderId. It stops short of covering failure modes or how provider errors surface.

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

Conciseness5/5

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

Two short sentences, zero filler, front-loaded with the verb+resource and then the return-shape enumeration. Every clause carries actionable information.

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

Completeness4/5

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

With 12 parameters, a nested customer object, an open provider enum, and no output schema, the description does the essential work of explaining the response envelope (`checkout` modes), which is the non-obvious part. Remaining gaps — error behavior, provider-specific requirements beyond the schema's return_url note — are minor because the schema is fairly rich.

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 coverage is 75% and the schema itself documents amount units, order_ref pattern, notify_url/return_url semantics, and idempotency_key default. The description mentions only `checkout` and providerOrderId persistence and adds no meaning to `provider_options`, `include_raw`, or `metadata` beyond what the schema states, so the baseline 3 applies.

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?

States a specific verb and resource ('Create an order / payment session') and immediately clarifies the return contract via the `checkout` discriminator. The action is unambiguously distinct from the sibling set (verify, refund, get_status, cancel_subscription), so an agent can route here without opening the schema.

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

Usage Guidelines3/5

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

The description implies the initiation context and gives an operational instruction ('Persist orderRef + providerOrderId'), but never states when to prefer this over `payments_recommend_gateway` (gateway selection), `payments_mock_complete_payment` (testing), or `payments_create_subscription` (recurring). Usage is implied rather than prescribed.

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