Skip to main content
Glama

list_subscriptions

Retrieve and filter subscription data from GoCardless to manage recurring payments, view status, and monitor customer billing cycles.

Instructions

List subscriptions from GoCardless

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of subscriptions to retrieve (default: 50)
statusNoFilter by subscription status

Implementation Reference

  • The core handler logic for the 'list_subscriptions' tool. It retrieves subscriptions from the GoCardless API using optional limit and status parameters, extracts key fields, and returns a formatted JSON list.
    elif name == "list_subscriptions": params = {"limit": arguments.get("limit", 50)} if "status" in arguments: params["status"] = arguments["status"] subscriptions = client.subscriptions.list(params=params) result = [] for subscription in subscriptions.records: result.append( { "id": subscription.id, "amount": subscription.amount, "currency": subscription.currency, "status": subscription.status, "created_at": subscription.created_at, } ) return [ types.TextContent( type="text", text=f"Found {len(result)} subscriptions:\n{_format_json(result)}", ) ]
  • Registers the 'list_subscriptions' tool in the list_tools handler, including its description and input schema definition.
    types.Tool( name="list_subscriptions", description="List subscriptions from GoCardless", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Number of subscriptions to retrieve (default: 50)", }, "status": { "type": "string", "description": "Filter by subscription status", }, }, }, ),
  • Input schema for the 'list_subscriptions' tool, defining optional limit and status parameters.
    inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Number of subscriptions to retrieve (default: 50)", }, "status": { "type": "string", "description": "Filter by subscription status", }, }, },
  • Helper function used by the list_subscriptions handler (and others) to format the result as pretty-printed JSON.
    def _format_json(data: Any) -> str: """Format data as JSON string.""" import json return json.dumps(data, indent=2)

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