get_mandate
Retrieve specific GoCardless mandate details by providing the mandate ID to access payment authorization information.
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)Handler for the 'get_mandate' tool. Fetches the mandate by ID from GoCardless API, extracts key fields including ID, status, scheme, dates, reference, metadata, and customer link, then returns formatted 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 list_tools handler, including name, description, and input schema requiring 'mandate_id'.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 'get_mandate' tool: object with required 'mandate_id' string property.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"], }, ),