Skip to main content
Glama

get_subscription

Retrieve subscription details by ID from GoCardless to access payment information, mandate links, and manage recurring billing data.

Instructions

Get subscription by ID. Returns links.mandate - use get_mandate then get_customer for full details, or use get_subscription_details instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscription_idYesThe GoCardless subscription ID (e.g., SB123)

Implementation Reference

  • Handler that executes the get_subscription tool: fetches subscription by ID using GoCardless client and returns formatted details.
    elif name == "get_subscription":
        subscription_id = arguments["subscription_id"]
        subscription = client.subscriptions.get(subscription_id)
        result = {
            "id": subscription.id,
            "amount": subscription.amount,
            "currency": subscription.currency,
            "status": subscription.status,
            "interval_unit": subscription.interval_unit,
            "interval": subscription.interval,
            "created_at": subscription.created_at,
            "name": subscription.name,
            "start_date": subscription.start_date,
            "end_date": subscription.end_date,
            "metadata": subscription.metadata if hasattr(subscription, 'metadata') else {},
            "links": {
                "mandate": subscription.links.mandate if hasattr(subscription, 'links') else None,
            },
        }
        return [
            types.TextContent(type="text", text=_format_json(result))
        ]
  • Schema definition for the get_subscription tool, including input schema requiring subscription_id.
    types.Tool(
        name="get_subscription",
        description="Get subscription by ID. Returns links.mandate - use get_mandate then get_customer for full details, or use get_subscription_details instead.",
        inputSchema={
            "type": "object",
            "properties": {
                "subscription_id": {
                    "type": "string",
                    "description": "The GoCardless subscription ID (e.g., SB123)",
                }
            },
            "required": ["subscription_id"],
        },
    ),
  • Registration of tools via the MCP list_tools handler, which includes get_subscription in its returned list.
    @server.list_tools()
    async def handle_list_tools() -> list[types.Tool]:
  • Registration of tool handlers via the MCP call_tool handler, which dispatches to get_subscription logic.
    @server.call_tool()
    async def handle_call_tool(
Behavior4/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. It effectively describes the return format ('Returns links.mandate') and hints at limitations (requiring additional steps for full details), which adds valuable context beyond basic functionality. However, it doesn't cover aspects like error handling or authentication requirements.

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 and front-loaded, with two sentences that each serve a clear purpose: the first states the core functionality, and the second provides crucial usage guidance. There is zero wasted language, making it highly efficient and easy to parse.

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

Completeness4/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is quite complete. It covers purpose, usage alternatives, and behavioral aspects like return data structure. The main gap is the lack of output schema, but the description compensates well by explaining what information is returned and how to obtain further details.

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?

Schema description coverage is 100%, so the schema already fully documents the 'subscription_id' parameter. The description doesn't add any additional semantic meaning or context about the parameter beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter documentation.

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

Purpose5/5

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

The description clearly states the specific action ('Get subscription by ID') and resource ('subscription'), distinguishing it from sibling tools like 'get_subscription_details' by emphasizing the ID-based retrieval. It provides a precise verb+resource combination that leaves no ambiguity about its function.

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

Usage Guidelines5/5

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

The description explicitly provides usage guidance by stating when to use alternatives: it mentions that 'links.mandate' is returned and advises using 'get_mandate then get_customer for full details' or 'use get_subscription_details instead.' This clearly defines when this tool is appropriate versus other options.

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