list_customers
Retrieve customer records from GoCardless to manage payment relationships and view account details.
Instructions
List all customers from GoCardless
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of customers to retrieve (default: 50) |
Implementation Reference
- src/gocardless_mcp/server.py:257-277 (handler)Handler implementation for the 'list_customers' tool. Retrieves customers using the GoCardless client with an optional limit, formats the results into a list of dictionaries, and returns a formatted text content response.if name == "list_customers": limit = arguments.get("limit", 50) customers = client.customers.list(params={"limit": limit}) result = [] for customer in customers.records: result.append( { "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, } ) return [ types.TextContent( type="text", text=f"Found {len(result)} customers:\n{_format_json(result)}", ) ]
- src/gocardless_mcp/server.py:39-51 (registration)Registration of the 'list_customers' tool within the handle_list_tools() function, decorated with @server.list_tools(). Includes tool name, description, and input schema.types.Tool( name="list_customers", description="List all customers from GoCardless", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Number of customers to retrieve (default: 50)", } }, }, ),
- src/gocardless_mcp/server.py:42-50 (schema)Input schema for the 'list_customers' tool, defining an optional 'limit' parameter of type integer.inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Number of customers to retrieve (default: 50)", } }, },