Skip to main content
Glama

create_payment

Create a new payment using an existing mandate by specifying amount, currency, and payment details to process transactions through GoCardless.

Instructions

Create a new payment in GoCardless

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount in minor currency unit (e.g., 1000 for £10.00)
currencyYesISO 4217 currency code (e.g., GBP, EUR)
descriptionNoPayment description
mandate_idYesID of the mandate to use for this payment

Implementation Reference

  • Implements the core logic for the create_payment tool by constructing parameters and calling the GoCardless client to create a new payment.
    elif name == "create_payment": params = { "amount": arguments["amount"], "currency": arguments["currency"], "links": {"mandate": arguments["mandate_id"]}, } if "description" in arguments: params["description"] = arguments["description"] payment = client.payments.create(params=params) return [ types.TextContent( type="text", text=f"Payment created successfully:\n{_format_json({'id': payment.id, 'amount': payment.amount, 'currency': payment.currency, 'status': payment.status})}", ) ]
  • Defines the input schema and description for the create_payment tool in the list_tools handler.
    types.Tool( name="create_payment", description="Create a new payment in GoCardless", inputSchema={ "type": "object", "properties": { "amount": { "type": "integer", "description": "Amount in minor currency unit (e.g., 1000 for £10.00)", }, "currency": { "type": "string", "description": "ISO 4217 currency code (e.g., GBP, EUR)", }, "mandate_id": { "type": "string", "description": "ID of the mandate to use for this payment", }, "description": { "type": "string", "description": "Payment description", }, }, "required": ["amount", "currency", "mandate_id"], }, ),

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/jmceleney/gocardless-mcp'

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