get_payment
Retrieve specific payment details using the payment ID to access transaction information, status, and related data from the GoCardless payment system.
Instructions
Get a specific payment by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payment_id | Yes | The GoCardless payment ID (e.g., PM123) |
Implementation Reference
- src/gocardless_mcp/server.py:348-367 (handler)Handler implementation for the 'get_payment' tool. Retrieves the payment by ID using the GoCardless client and returns formatted details including metadata and links.elif name == "get_payment": payment_id = arguments["payment_id"] payment = client.payments.get(payment_id) result = { "id": payment.id, "amount": payment.amount, "currency": payment.currency, "status": payment.status, "description": payment.description, "created_at": payment.created_at, "charge_date": payment.charge_date, "metadata": payment.metadata if hasattr(payment, 'metadata') else {}, "links": { "mandate": payment.links.mandate if hasattr(payment, 'links') and hasattr(payment.links, 'mandate') else None, "subscription": payment.links.subscription if hasattr(payment, 'links') and hasattr(payment.links, 'subscription') else None, }, } return [ types.TextContent(type="text", text=_format_json(result)) ]
- src/gocardless_mcp/server.py:117-130 (registration)Registration of the 'get_payment' tool in the list_tools() function, including its name, description, and input schema.types.Tool( name="get_payment", description="Get a specific payment by ID", inputSchema={ "type": "object", "properties": { "payment_id": { "type": "string", "description": "The GoCardless payment ID (e.g., PM123)", } }, "required": ["payment_id"], }, ),
- src/gocardless_mcp/server.py:120-129 (schema)Input schema definition for the 'get_payment' tool, specifying the required 'payment_id' parameter.inputSchema={ "type": "object", "properties": { "payment_id": { "type": "string", "description": "The GoCardless payment ID (e.g., PM123)", } }, "required": ["payment_id"], },