get_customer
Retrieve a specific GoCardless customer's details using their unique customer ID to access payment information and manage account data.
Instructions
Get a specific customer by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | Yes | The GoCardless customer ID (e.g., CU123) |
Implementation Reference
- src/gocardless_mcp/server.py:279-298 (handler)Handler implementation for 'get_customer' tool: extracts customer_id, fetches customer using GoCardless client, formats response with customer details including address and metadata, returns as formatted JSON text.elif name == "get_customer": customer_id = arguments["customer_id"] customer = client.customers.get(customer_id) result = { "id": customer.id, "email": customer.email, "given_name": customer.given_name, "family_name": customer.family_name, "company_name": customer.company_name, "created_at": customer.created_at, "address_line1": customer.address_line1, "address_line2": customer.address_line2, "city": customer.city, "postal_code": customer.postal_code, "country_code": customer.country_code, "metadata": customer.metadata if hasattr(customer, 'metadata') else {}, } return [ types.TextContent(type="text", text=_format_json(result)) ]
- src/gocardless_mcp/server.py:52-65 (registration)Registration of the 'get_customer' tool in list_tools(), including name, description, and input schema requiring 'customer_id'.types.Tool( name="get_customer", description="Get a specific customer by ID", inputSchema={ "type": "object", "properties": { "customer_id": { "type": "string", "description": "The GoCardless customer ID (e.g., CU123)", } }, "required": ["customer_id"], }, ),
- src/gocardless_mcp/server.py:55-64 (schema)Input schema for 'get_customer' tool: object with required 'customer_id' string.inputSchema={ "type": "object", "properties": { "customer_id": { "type": "string", "description": "The GoCardless customer ID (e.g., CU123)", } }, "required": ["customer_id"], },