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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't mention whether this is a read-only operation, if it requires authentication, how results are returned (pagination, format), rate limits, or error conditions. For a listing tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 4 words with zero wasted language. It's front-loaded with the essential information (list subscriptions) and doesn't include any unnecessary elaboration or redundant phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a listing tool with no annotations and no output schema, the description is incomplete. It doesn't explain what information is returned, how results are structured, whether pagination is supported, or any behavioral aspects. The agent would need to guess about the tool's behavior and output format based solely on the minimal description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides no parameter information, but the input schema has 100% description coverage with clear documentation for both 'limit' and 'status' parameters. Since the schema does the heavy lifting, the baseline score of 3 is appropriate even though the description adds no value beyond what's already in the structured schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('subscriptions from GoCardless'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'get_subscription' or 'get_subscription_details', which likely retrieve individual subscriptions rather than listing multiple ones.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_subscription' or 'get_subscription_details'. There's no mention of use cases, prerequisites, or exclusions that would help an agent choose between these related subscription tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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