get_mandate
Retrieve a specific payment authorization (mandate) by its unique ID to access details for managing recurring payments through GoCardless.
Instructions
Get a specific mandate by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mandate_id | Yes | The GoCardless mandate ID (e.g., MD123) |
Implementation Reference
- src/gocardless_mcp/server.py:409-425 (handler)The handler logic for the 'get_mandate' tool within the @server.call_tool() function. It retrieves the mandate using the GoCardless client API and formats the response as JSON text content.elif name == "get_mandate": mandate_id = arguments["mandate_id"] mandate = client.mandates.get(mandate_id) result = { "id": mandate.id, "status": mandate.status, "scheme": mandate.scheme, "created_at": mandate.created_at, "reference": mandate.reference, "metadata": mandate.metadata if hasattr(mandate, 'metadata') else {}, "links": { "customer": mandate.links.customer if hasattr(mandate, 'links') else None, }, } return [ types.TextContent(type="text", text=_format_json(result)) ]
- src/gocardless_mcp/server.py:174-187 (registration)Registration of the 'get_mandate' tool in the @server.list_tools() function, defining its name, description, and input schema.types.Tool( name="get_mandate", description="Get a specific mandate by ID", inputSchema={ "type": "object", "properties": { "mandate_id": { "type": "string", "description": "The GoCardless mandate ID (e.g., MD123)", } }, "required": ["mandate_id"], }, ),
- src/gocardless_mcp/server.py:174-187 (schema)Input schema definition for the 'get_mandate' tool, specifying the required 'mandate_id' parameter.types.Tool( name="get_mandate", description="Get a specific mandate by ID", inputSchema={ "type": "object", "properties": { "mandate_id": { "type": "string", "description": "The GoCardless mandate ID (e.g., MD123)", } }, "required": ["mandate_id"], }, ),