Skip to main content
Glama

create_payment

Create a new payment in GoCardless by specifying amount, currency, and mandate ID. This tool processes payments through the GoCardless MCP Server for managing payment data.

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)
mandate_idYesID of the mandate to use for this payment
descriptionNoPayment description

Implementation Reference

  • Handler for the create_payment tool. Constructs payment parameters from arguments and calls client.payments.create to execute the payment creation.
    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})}",
            )
        ]
  • Registration of the create_payment tool in the list_tools handler, including name, description, and input schema definition.
    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"],
        },
    ),
  • Input schema definition for the create_payment tool, specifying required parameters and types.
    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"],
    },
  • Helper function get_client() used by all tools including create_payment to initialize the GoCardless API client.
    def get_client() -> gocardless_pro.Client:
        """Initialize and return GoCardless client."""
        access_token = os.environ.get("GOCARDLESS_ACCESS_TOKEN")
        if not access_token:
            raise ValueError("GOCARDLESS_ACCESS_TOKEN environment variable is required")
    
        environment = os.environ.get("GOCARDLESS_ENVIRONMENT", "sandbox")
        return gocardless_pro.Client(access_token=access_token, environment=environment)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a creation tool, implying a write operation, but doesn't mention critical behaviors like authentication requirements, potential side effects (e.g., charging a customer), error conditions, or what happens on success. For a payment creation tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly. Every word earns its place by conveying essential information about the action and target system.

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

Completeness2/5

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

Given this is a payment creation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, what happens after creation (e.g., payment status), error handling, or integration with other tools like mandate management. For a financial transaction tool, more context about behavior and outcomes is needed.

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?

The input schema has 100% description coverage, providing clear documentation for all 4 parameters (amount, currency, mandate_id, description) including formats and examples. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting but doesn't compensate or enhance understanding.

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?

The description clearly states the verb ('Create') and resource ('payment in GoCardless'), making the purpose immediately understandable. It distinguishes from siblings like 'get_payment' or 'list_payments' by specifying creation rather than retrieval. However, it doesn't explicitly differentiate from other creation tools like 'create_customer', leaving some ambiguity about when to create a payment versus a customer.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a mandate first), compare to sibling tools like 'create_customer', or specify contexts where payment creation is appropriate versus other operations. This leaves the agent without explicit usage instructions.

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

Install Server

Other Tools

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