Skip to main content
Glama
block

Square MCP Server

by block

subscriptions

Manage Square subscription operations including creation, updates, cancellation, and event tracking for recurring billing services.

Instructions

Manage subscription operations

Args:
    operation: The operation to perform. Valid operations:
        - create_subscription
        - search_subscriptions
        - retrieve_subscription
        - update_subscription
        - cancel_subscription
        - list_subscription_events
        - pause_subscription
        - resume_subscription
        - swap_plan
    params: Dictionary of parameters for the specific operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
paramsYes

Implementation Reference

  • The handler function for the 'subscriptions' tool, decorated with @mcp.tool() for registration. It handles various subscription operations by dispatching to the corresponding Square client methods based on the 'operation' parameter.
    async def subscriptions(
        operation: str,
        params: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Manage subscription operations
    
        Args:
            operation: The operation to perform. Valid operations:
                - create_subscription
                - search_subscriptions
                - retrieve_subscription
                - update_subscription
                - cancel_subscription
                - list_subscription_events
                - pause_subscription
                - resume_subscription
                - swap_plan
            params: Dictionary of parameters for the specific operation
        """
        try:
            match operation:
                case "create_subscription":
                    result = square_client.subscriptions.create_subscription(params)
                case "search_subscriptions":
                    result = square_client.subscriptions.search_subscriptions(params)
                case "retrieve_subscription":
                    result = square_client.subscriptions.retrieve_subscription(**params)
                case "update_subscription":
                    result = square_client.subscriptions.update_subscription(**params)
                case "cancel_subscription":
                    result = square_client.subscriptions.cancel_subscription(**params)
                case "list_subscription_events":
                    result = square_client.subscriptions.list_subscription_events(**params)
                case "pause_subscription":
                    result = square_client.subscriptions.pause_subscription(**params)
                case "resume_subscription":
                    result = square_client.subscriptions.resume_subscription(**params)
                case "swap_plan":
                    result = square_client.subscriptions.swap_plan(**params)
                case _:
                    raise McpError(INVALID_PARAMS, ErrorData(message=f"Invalid operation: {operation}"))
    
            return result.body
        except Exception as e:
            raise McpError(INTERNAL_ERROR, ErrorData(message=str(e)))
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. It lists operations but doesn't describe behavioral traits such as permissions required, rate limits, side effects (e.g., 'cancel_subscription' might be irreversible), or response formats. For a tool with multiple mutation operations (e.g., create, update, cancel), this lack of detail is a significant gap, though it at least implies the tool can perform both read and write actions.

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

Conciseness3/5

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

The description is structured with a brief purpose statement followed by a parameter list, which is front-loaded but could be more concise. The operation list is detailed but necessary given the schema gaps. However, the initial sentence 'Manage subscription operations' is somewhat vague and could be more specific, and the overall text is moderately efficient but not minimal.

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 complexity (multiple operations with a nested 'params' object), no annotations, and no output schema, the description is partially complete. It covers the high-level purpose and parameter semantics adequately but lacks behavioral details, usage context, and output information. For a tool with such varied operations, more guidance on behavior and integration would improve completeness.

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

Parameters4/5

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

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It enumerates valid operations for the 'operation' parameter and explains that 'params' is a dictionary for operation-specific parameters, clarifying their roles. This compensates well for the schema's lack of descriptions, though it doesn't detail the structure or content of the 'params' dictionary for each operation.

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 states the tool's purpose as 'Manage subscription operations' which clearly indicates it handles subscription-related tasks. While it distinguishes itself from siblings like 'customers' or 'payments' by focusing on subscriptions, it doesn't specify what 'manage' entails beyond listing operations in the parameters section. The verb 'manage' is somewhat broad but the operational list provides concrete actions.

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 'invoices' or 'orders' for related financial operations, or how it interacts with sibling tools. It lists operations but doesn't specify contexts, prerequisites, or exclusions for choosing this tool over others, leaving the agent to infer usage based on the operation names alone.

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/block/square-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server