Skip to main content
Glama
block

Square MCP Server

by block

terminal

Process payments and manage devices for Square Terminal, including checkout creation, refund processing, and device configuration.

Instructions

Manage Square Terminal operations

Args:
    operation: The operation to perform. Valid operations:
        Checkout:
            - create_terminal_checkout
            - search_terminal_checkouts
            - get_terminal_checkout
            - cancel_terminal_checkout
        Devices:
            - create_terminal_device
            - get_terminal_device
            - search_terminal_devices
        Refunds:
            - create_terminal_refund
            - search_terminal_refunds
            - get_terminal_refund
            - cancel_terminal_refund
    params: Dictionary of parameters for the specific operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
paramsYes

Implementation Reference

  • The 'terminal' tool handler function, registered via @mcp.tool() decorator. It handles various Square Terminal API operations (checkouts, devices, refunds) by dispatching based on the 'operation' parameter to the corresponding square_client.terminal methods.
    @mcp.tool()
    async def terminal(
        operation: str,
        params: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Manage Square Terminal operations
    
        Args:
            operation: The operation to perform. Valid operations:
                Checkout:
                    - create_terminal_checkout
                    - search_terminal_checkouts
                    - get_terminal_checkout
                    - cancel_terminal_checkout
                Devices:
                    - create_terminal_device
                    - get_terminal_device
                    - search_terminal_devices
                Refunds:
                    - create_terminal_refund
                    - search_terminal_refunds
                    - get_terminal_refund
                    - cancel_terminal_refund
            params: Dictionary of parameters for the specific operation
        """
        try:
            match operation:
                # Checkout
                case "create_terminal_checkout":
                    result = square_client.terminal.create_terminal_checkout(params)
                case "search_terminal_checkouts":
                    result = square_client.terminal.search_terminal_checkouts(params)
                case "get_terminal_checkout":
                    result = square_client.terminal.get_terminal_checkout(**params)
                case "cancel_terminal_checkout":
                    result = square_client.terminal.cancel_terminal_checkout(**params)
                # Devices
                case "create_terminal_device":
                    result = square_client.terminal.create_terminal_device(params)
                case "get_terminal_device":
                    result = square_client.terminal.get_terminal_device(**params)
                case "search_terminal_devices":
                    result = square_client.terminal.search_terminal_devices(params)
                # Refunds
                case "create_terminal_refund":
                    result = square_client.terminal.create_terminal_refund(params)
                case "search_terminal_refunds":
                    result = square_client.terminal.search_terminal_refunds(params)
                case "get_terminal_refund":
                    result = square_client.terminal.get_terminal_refund(**params)
                case "cancel_terminal_refund":
                    result = square_client.terminal.cancel_terminal_refund(**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)))
  • Registration of the 'terminal' tool using the FastMCP @mcp.tool() decorator.
    @mcp.tool()
  • Docstring defining the input schema and valid operations for the 'terminal' tool.
    """Manage Square Terminal operations
    
    Args:
        operation: The operation to perform. Valid operations:
            Checkout:
                - create_terminal_checkout
                - search_terminal_checkouts
                - get_terminal_checkout
                - cancel_terminal_checkout
            Devices:
                - create_terminal_device
                - get_terminal_device
                - search_terminal_devices
            Refunds:
                - create_terminal_refund
                - search_terminal_refunds
                - get_terminal_refund
                - cancel_terminal_refund
        params: Dictionary of parameters for the specific operation
    """
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It lists operation types but doesn't describe what these operations do, their side effects, authentication requirements, rate limits, or error conditions. For example, it doesn't clarify that 'create_terminal_checkout' initiates a payment or that 'cancel_terminal_refund' might be irreversible. The description provides structure but minimal behavioral insight.

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 appropriately sized but could be better structured. The opening sentence is clear, but the parameter documentation uses a bulleted list that might be less efficient than a table. All content is relevant, but it could be more front-loaded with a clearer summary of what 'manage' entails before diving into parameter details.

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 operation types, nested params object) and lack of both annotations and output schema, the description is partially complete. It documents the parameter structure and valid operation values, which is essential, but doesn't explain what each operation does, what the params should contain, or what the tool returns. For a multi-operation tool with no other documentation, this leaves significant gaps.

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 significant value beyond the input schema, which has 0% description coverage. It explains that 'operation' accepts specific string values categorized into Checkout, Devices, and Refunds operations, and that 'params' is a dictionary for the chosen operation. This clarifies what would otherwise be completely undocumented parameters, though it doesn't detail what parameters each operation expects.

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: 'Manage Square Terminal operations' with a verb ('Manage') and resource ('Square Terminal operations'). It distinguishes from siblings by focusing specifically on Terminal operations rather than other Square services like bookings, payments, or customers. However, it doesn't specify what 'manage' entails beyond listing operation categories.

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 lists operation categories but doesn't explain when to choose Terminal operations over other sibling tools like payments or orders, nor does it provide any context about prerequisites, typical use cases, or exclusions. The agent must infer usage from the operation list 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