Skip to main content
Glama

create_customer

Add new customers to your GoCardless account by providing their email, name, and optional company details for payment processing.

Instructions

Create a new customer in GoCardless

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesCustomer email address
given_nameNoCustomer first name
family_nameNoCustomer last name
company_nameNoCustomer company name (optional)

Implementation Reference

  • Handler function for the 'create_customer' tool. Constructs parameters from input arguments and calls client.customers.create() to create a new customer in GoCardless.
    elif name == "create_customer":
        params = {
            "email": arguments["email"],
        }
        if "given_name" in arguments:
            params["given_name"] = arguments["given_name"]
        if "family_name" in arguments:
            params["family_name"] = arguments["family_name"]
        if "company_name" in arguments:
            params["company_name"] = arguments["company_name"]
    
        customer = client.customers.create(params=params)
        return [
            types.TextContent(
                type="text",
                text=f"Customer created successfully:\n{_format_json({'id': customer.id, 'email': customer.email})}",
            )
        ]
  • Registration of the 'create_customer' tool in list_tools(), including its name, description, and input schema definition.
    types.Tool(
        name="create_customer",
        description="Create a new customer in GoCardless",
        inputSchema={
            "type": "object",
            "properties": {
                "email": {
                    "type": "string",
                    "description": "Customer email address",
                },
                "given_name": {
                    "type": "string",
                    "description": "Customer first name",
                },
                "family_name": {
                    "type": "string",
                    "description": "Customer last name",
                },
                "company_name": {
                    "type": "string",
                    "description": "Customer company name (optional)",
                },
            },
            "required": ["email"],
        },
    ),
  • Input schema definition for the 'create_customer' tool, specifying required 'email' and optional name fields.
    inputSchema={
        "type": "object",
        "properties": {
            "email": {
                "type": "string",
                "description": "Customer email address",
            },
            "given_name": {
                "type": "string",
                "description": "Customer first name",
            },
            "family_name": {
                "type": "string",
                "description": "Customer last name",
            },
            "company_name": {
                "type": "string",
                "description": "Customer company name (optional)",
            },
        },
        "required": ["email"],
    },

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