Skip to main content
Glama

list_payments

Retrieve and filter payment records from GoCardless by status, subscription, or mandate to monitor transaction history and track payment status.

Instructions

List payments from GoCardless

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of payments to retrieve (default: 50)
mandateNoFilter by mandate ID (e.g., MD123)
statusNoFilter by payment status (pending_customer_approval, pending_submission, submitted, confirmed, paid_out, cancelled, customer_approval_denied, failed, charged_back)
subscriptionNoFilter by subscription ID (e.g., SB123)

Implementation Reference

  • The specific handler logic within handle_call_tool for executing the 'list_payments' tool. It constructs query parameters from input arguments, fetches payments using the GoCardless client.payments.list(), extracts relevant fields, and returns formatted JSON text content.
    elif name == "list_payments": params = {"limit": arguments.get("limit", 50)} if "status" in arguments: params["status"] = arguments["status"] if "subscription" in arguments: params["subscription"] = arguments["subscription"] if "mandate" in arguments: params["mandate"] = arguments["mandate"] payments = client.payments.list(params=params) result = [] for payment in payments.records: result.append( { "id": payment.id, "amount": payment.amount, "currency": payment.currency, "status": payment.status, "description": payment.description, "created_at": payment.created_at, } ) return [ types.TextContent( type="text", text=f"Found {len(result)} payments:\n{_format_json(result)}", ) ]
  • Registers the 'list_payments' tool in the handle_list_tools() function, including its name, description, and input schema definition.
    types.Tool( name="list_payments", description="List payments from GoCardless", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Number of payments to retrieve (default: 50)", }, "status": { "type": "string", "description": "Filter by payment status (pending_customer_approval, pending_submission, submitted, confirmed, paid_out, cancelled, customer_approval_denied, failed, charged_back)", }, "subscription": { "type": "string", "description": "Filter by subscription ID (e.g., SB123)", }, "mandate": { "type": "string", "description": "Filter by mandate ID (e.g., MD123)", }, }, }, ),
  • Defines the input schema for the 'list_payments' tool, specifying optional parameters for limit, status, subscription, and mandate filters.
    "properties": { "limit": { "type": "integer", "description": "Number of payments to retrieve (default: 50)", }, "status": { "type": "string", "description": "Filter by payment status (pending_customer_approval, pending_submission, submitted, confirmed, paid_out, cancelled, customer_approval_denied, failed, charged_back)", }, "subscription": { "type": "string", "description": "Filter by subscription ID (e.g., SB123)", }, "mandate": { "type": "string", "description": "Filter by mandate ID (e.g., MD123)", }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jmceleney/gocardless-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server