Skip to main content
Glama

Pay and place the order

complete_checkout

Charge the payment credential the platform obtained for a session that is ready_for_payment and create the order. Input follows the ChatGPT payment-sheet contract: checkout_session_id, buyer, payment_data { token, provider: 'stripe', billing_address }. The token is a Stripe shared payment token (spt_…); platforms without one should send the user to pay_online_url from create_checkout. After payment the patient gets an email link to add date of birth, sex, phone and consent — the lab requisition is issued when that is done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyerNo
payment_dataYes
idempotency_keyNo
checkout_session_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
orderNo
statusYes
totalsYes
messagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • removedInput schema / properties / action
      Removed value: -{
      -  "description": "Default complete",
      -  "enum": [
      -    "complete",
      -    "get",
      -    "cancel"
      -  ],
      -  "type": "string"
      -}
    • addedInput schema / properties / buyer
      Added value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "email": {
      +          "anyOf": [
      +            {
      +              "format": "email",
      +              "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "first_name": {
      +          "anyOf": [
      +            {
      +              "maxLength": 80,
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "last_name": {
      +          "anyOf": [
      +            {
      +              "maxLength": 80,
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "name": {
      +          "anyOf": [
      +            {
      +              "maxLength": 160,
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "phone_number": {
      +          "anyOf": [
      +            {
      +              "maxLength": 20,
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedInput schema / properties / payment_data
      Added value: +{
      +  "properties": {
      +    "billing_address": {
      +      "anyOf": [
      +        {
      +          "properties": {
      +            "city": {
      +              "type": "string"
      +            },
      +            "country": {
      +              "type": "string"
      +            },
      +            "line_one": {
      +              "type": "string"
      +            },
      +            "line_two": {
      +              "type": "string"
      +            },
      +            "name": {
      +              "type": "string"
      +            },
      +            "postal_code": {
      +              "type": "string"
      +            },
      +            "state": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "provider": {
      +      "description": "'stripe'",
      +      "maxLength": 40,
      +      "type": "string"
      +    },
      +    "token": {
      +      "maxLength": 400,
      +      "minLength": 4,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "token"
      +  ],
      +  "type": "object"
      +}
    • removedInput schema / properties / payment_token
      Removed value: -{
      -  "description": "Stripe shared payment token (required for complete)",
      -  "maxLength": 200,
      -  "minLength": 4,
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "checkout_session_id"
      -]New value: +[
      +  "checkout_session_id",
      +  "payment_data"
      +]
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already indicate this is not read-only, not idempotent, and not destructive. The description adds meaningful behavioral context by disclosing that payment is charged, an order is created, an email link is sent, and the lab requisition is only issued after the patient completes additional steps. This goes beyond the annotation flags without contradicting them.

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?

Four compact sentences deliver the core action, the input contract, the token caveat with alternative routing, and the post-payment flow. Every sentence adds necessary information and the most important operational detail is front-loaded.

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?

The description is complete enough for the tool's complexity: it covers preconditions, input contract, token format, alternative flow, and downstream consequences. The presence of an output schema reduces the need to describe return values. Minor omissions like idempotency_key semantics prevent a perfect score.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the burden. It names the key parameters (checkout_session_id, buyer, payment_data) and clarifies semantics for token ('Stripe shared payment token (spt_…)') and provider ('stripe'). It does not explain idempotency_key in detail, but the main payment contract is well illuminated.

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 action ('charge the payment credential ... and create the order') and clearly identifies the resource (a checkout session ready_for_payment). It differentiates the tool from siblings like create_checkout, cancel_checkout, and update_checkout by describing the payment/order-placement responsibility.

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?

It gives an explicit precondition (session must be ready_for_payment) and names the alternative path for platforms without a Stripe shared token: send the user to pay_online_url from create_checkout. This is clear when-to-use and when-not-to-use guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources