Skip to main content
Glama

get_mandate

Retrieve a specific payment authorization (mandate) by its unique ID to access details for managing recurring payments through GoCardless.

Instructions

Get a specific mandate by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mandate_idYesThe GoCardless mandate ID (e.g., MD123)

Implementation Reference

  • The handler logic for the 'get_mandate' tool within the @server.call_tool() function. It retrieves the mandate using the GoCardless client API and formats the response as JSON text content.
    elif name == "get_mandate":
        mandate_id = arguments["mandate_id"]
        mandate = client.mandates.get(mandate_id)
        result = {
            "id": mandate.id,
            "status": mandate.status,
            "scheme": mandate.scheme,
            "created_at": mandate.created_at,
            "reference": mandate.reference,
            "metadata": mandate.metadata if hasattr(mandate, 'metadata') else {},
            "links": {
                "customer": mandate.links.customer if hasattr(mandate, 'links') else None,
            },
        }
        return [
            types.TextContent(type="text", text=_format_json(result))
        ]
  • Registration of the 'get_mandate' tool in the @server.list_tools() function, defining its name, description, and input schema.
    types.Tool(
        name="get_mandate",
        description="Get a specific mandate by ID",
        inputSchema={
            "type": "object",
            "properties": {
                "mandate_id": {
                    "type": "string",
                    "description": "The GoCardless mandate ID (e.g., MD123)",
                }
            },
            "required": ["mandate_id"],
        },
    ),
  • Input schema definition for the 'get_mandate' tool, specifying the required 'mandate_id' parameter.
    types.Tool(
        name="get_mandate",
        description="Get a specific mandate by ID",
        inputSchema={
            "type": "object",
            "properties": {
                "mandate_id": {
                    "type": "string",
                    "description": "The GoCardless mandate ID (e.g., MD123)",
                }
            },
            "required": ["mandate_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 the tool retrieves a mandate but doesn't cover aspects like authentication requirements, rate limits, error handling, or what data is returned (e.g., mandate details, status). For a read operation without annotations, this is a significant gap in transparency.

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 directly states the tool's purpose with zero waste. It's appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete for a tool that retrieves data. It doesn't explain what information is returned (e.g., mandate attributes, status), potential errors, or usage constraints. For a read operation with no structured output, more context is needed to guide the agent effectively.

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%, with the parameter 'mandate_id' documented in the schema as 'The GoCardless mandate ID (e.g., MD123)'. The description adds no additional meaning beyond this, such as format constraints or examples, so it meets the baseline for high schema coverage without compensating value.

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 verb ('Get') and resource ('a specific mandate by ID'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list_mandates' or 'get_customer', which would require mentioning it retrieves a single mandate by unique identifier rather than listing multiple mandates or fetching other resource types.

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. It doesn't mention using 'list_mandates' for multiple mandates or 'get_customer' for customer data, nor does it specify prerequisites like needing a valid mandate ID. This leaves the agent with minimal context for tool selection.

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