Skip to main content
Glama

get_subscription_details

Retrieve comprehensive subscription information including mandate and customer details in a single API call for GoCardless payment management.

Instructions

Get complete subscription info including mandate and customer in one call

Input Schema

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

Implementation Reference

  • Handler implementation for the 'get_subscription_details' tool within the @server.call_tool() function. Fetches subscription details along with associated mandate and customer information from the GoCardless API.
    elif name == "get_subscription_details":
        subscription_id = arguments["subscription_id"]
    
        # Get subscription
        subscription = client.subscriptions.get(subscription_id)
    
        # Get mandate
        mandate = client.mandates.get(subscription.links.mandate)
    
        # Get customer
        customer = client.customers.get(mandate.links.customer)
    
        result = {
            "subscription": {
                "id": subscription.id,
                "name": subscription.name,
                "amount": subscription.amount,
                "currency": subscription.currency,
                "status": subscription.status,
                "interval_unit": subscription.interval_unit,
                "interval": subscription.interval,
                "start_date": subscription.start_date,
                "end_date": subscription.end_date,
                "created_at": subscription.created_at,
                "metadata": subscription.metadata if hasattr(subscription, 'metadata') else {},
            },
            "mandate": {
                "id": mandate.id,
                "reference": mandate.reference,
                "status": mandate.status,
                "scheme": mandate.scheme,
                "created_at": mandate.created_at,
                "metadata": mandate.metadata if hasattr(mandate, 'metadata') else {},
            },
            "customer": {
                "id": customer.id,
                "email": customer.email,
                "given_name": customer.given_name,
                "family_name": customer.family_name,
                "company_name": customer.company_name,
                "address_line1": customer.address_line1,
                "address_line2": customer.address_line2,
                "city": customer.city,
                "postal_code": customer.postal_code,
                "country_code": customer.country_code,
                "created_at": customer.created_at,
                "metadata": customer.metadata if hasattr(customer, 'metadata') else {},
            },
        }
        return [
            types.TextContent(type="text", text=_format_json(result))
        ]
  • Registration of the 'get_subscription_details' tool in the @server.list_tools() handler, including name, description, and input schema.
    types.Tool(
        name="get_subscription_details",
        description="Get complete subscription info including mandate and customer in one call",
        inputSchema={
            "type": "object",
            "properties": {
                "subscription_id": {
                    "type": "string",
                    "description": "The GoCardless subscription ID (e.g., SB123)",
                }
            },
            "required": ["subscription_id"],
        },
    ),
  • Input schema definition for the 'get_subscription_details' tool, specifying the required 'subscription_id' parameter.
    types.Tool(
        name="get_subscription_details",
        description="Get complete subscription info including mandate and customer in one call",
        inputSchema={
            "type": "object",
            "properties": {
                "subscription_id": {
                    "type": "string",
                    "description": "The GoCardless subscription ID (e.g., SB123)",
                }
            },
            "required": ["subscription_id"],
        },
    ),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), but doesn't mention any behavioral traits such as authentication requirements, rate limits, error conditions, or what 'complete' entails beyond mandate and customer info. This leaves significant gaps for a tool that likely interacts with payment/subscription data.

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 a single, efficient sentence that front-loads the key information ('Get complete subscription info') and adds clarifying details ('including mandate and customer in one call') without any wasted words. It's appropriately sized for a simple tool with one parameter.

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

Completeness3/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 (1 parameter, no nested objects) and high schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it fails to disclose important behavioral aspects like what data is returned or any operational constraints. This makes it incomplete for safe and effective use by an AI agent.

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 input schema has 100% description coverage, with the single parameter 'subscription_id' well-documented in the schema. The description doesn't add any parameter-specific details beyond what the schema provides, such as format examples or validation rules. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't need to.

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 tool's purpose with a specific verb ('Get') and resource ('subscription info'), and it specifies what information is included ('complete subscription info including mandate and customer'). However, it doesn't explicitly differentiate from the sibling 'get_subscription' tool, which appears to be a simpler version.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'in one call,' suggesting this tool should be used when you need comprehensive subscription data. However, it doesn't provide explicit guidance on when to use this versus the simpler 'get_subscription' sibling tool or other related tools like 'get_mandate' or 'get_customer.'

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