Skip to main content
Glama

Create Snap transaction

create_snap_transaction

Create a Midtrans Snap transaction to get a payment token and redirect URL for the Snap payment page, using a unique order ID and gross amount in IDR.

Instructions

Create a Midtrans Snap transaction and get back a token and redirect_url for the Snap payment page. gross_amount is in IDR (integer).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "order_id": "<order_id>",
      "gross_amount": "<gross_amount>"
    },
    "name": "create_snap_transaction"
  }
}

Input Schema

NameRequiredDescriptionDefault
order_idYesUnique order id for this transaction.
gross_amountYesTotal amount in IDR (integer, no decimals).
item_detailsNoOptional item list. If given, the sum of price*quantity must equal gross_amount.
customer_detailsNoOptional customer information shown on the Snap page.
enabled_paymentsNoOptional list of payment channels to enable, e.g. ['gopay','bca_va','credit_card'].

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/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 does add real value by naming the return payload (token and redirect_url) despite no output schema, but it omits auth requirements, environment (sandbox/production), what happens on a duplicate order_id, and error behavior for a mutating payment call.

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

Conciseness4/5

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

Two tight sentences, front-loaded with the action and the returned artifacts; the IDR unit note is a small redundancy with the schema but harmless. No filler.

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

Completeness3/5

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

The rich 100%-covered schema compensates for much, and the description covers the return payload. But for a payment-creation mutation with no annotations and no output schema, it should say more about environment, idempotency of order_id, and failure modes.

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 100%, including per-field descriptions such as the order_id pattern and the item-sum constraint, so the schema already does the heavy lifting. The description's only parameter note (gross_amount is IDR integer) merely repeats what the schema states.

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

Purpose4/5

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

States a specific verb ('Create') and resource ('Midtrans Snap transaction') plus what comes back (token and redirect_url). It does not explicitly distinguish itself from the sibling create_payment_link, so the agent must infer the Snap-vs-link split from the name alone.

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

Usage Guidelines2/5

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

There is no when-to-use guidance and no mention of alternatives such as create_payment_link or get_transaction_status. Prerequisites (server key, sandbox vs production environment) are not stated, so the agent gets no routing help beyond the name.

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