list_mandates
Retrieve and manage customer payment mandates from GoCardless to view authorization details, filter by customer, and control data retrieval limits.
Instructions
List mandates from GoCardless
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of mandates to retrieve (default: 50) | |
| customer | No | Filter by customer ID |
Implementation Reference
- src/gocardless_mcp/server.py:386-407 (handler)Handler for the 'list_mandates' tool call. Retrieves mandates from GoCardless API using client.mandates.list(), filters by limit and optional customer ID, formats results into a list of dicts with id, status, scheme, created_at, and returns formatted text content.elif name == "list_mandates": params = {"limit": arguments.get("limit", 50)} if "customer" in arguments: params["customer"] = arguments["customer"] mandates = client.mandates.list(params=params) result = [] for mandate in mandates.records: result.append( { "id": mandate.id, "status": mandate.status, "scheme": mandate.scheme, "created_at": mandate.created_at, } ) return [ types.TextContent( type="text", text=f"Found {len(result)} mandates:\n{_format_json(result)}", ) ]
- src/gocardless_mcp/server.py:157-173 (registration)Registration of the 'list_mandates' tool in the list_tools() function, defining its name, description, and input schema for parameters limit (optional integer) and customer (optional string filter).types.Tool( name="list_mandates", description="List mandates from GoCardless", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Number of mandates to retrieve (default: 50)", }, "customer": { "type": "string", "description": "Filter by customer ID", }, }, }, ),