Skip to main content
Glama
block

Square MCP Server

by block

orders

Manage Square orders and checkout operations including creating, retrieving, updating, and processing payments for transactions.

Instructions

Manage orders and checkout operations

Args:
    operation: The operation to perform. Valid operations:
        Orders:
            - create_order
            - batch_retrieve_orders
            - calculate_order
            - clone_order
            - search_orders
            - pay_order
            - update_order
        Checkout:
            - create_checkout
            - create_payment_link
        Custom Attributes:
            - upsert_order_custom_attribute
            - list_order_custom_attribute_definitions
    params: Dictionary of parameters for the specific operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
paramsYes

Implementation Reference

  • The primary handler function for the 'orders' MCP tool. It is registered via @mcp.tool() decorator and implements multiple Square Orders API operations (create_order, batch_retrieve_orders, etc.) based on the 'operation' parameter, proxying calls to square_client.orders.* methods.
    @mcp.tool()
    async def orders(
        operation: str,
        params: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Manage orders and checkout operations
    
        Args:
            operation: The operation to perform. Valid operations:
                Orders:
                    - create_order
                    - batch_retrieve_orders
                    - calculate_order
                    - clone_order
                    - search_orders
                    - pay_order
                    - update_order
                Checkout:
                    - create_checkout
                    - create_payment_link
                Custom Attributes:
                    - upsert_order_custom_attribute
                    - list_order_custom_attribute_definitions
            params: Dictionary of parameters for the specific operation
        """
        try:
            match operation:
                # Orders
                case "create_order":
                    result = square_client.orders.create_order(params)
                case "batch_retrieve_orders":
                    result = square_client.orders.batch_retrieve_orders(params)
                case "calculate_order":
                    result = square_client.orders.calculate_order(params)
                case "clone_order":
                    result = square_client.orders.clone_order(params)
                case "search_orders":
                    result = square_client.orders.search_orders(params)
                case "pay_order":
                    result = square_client.orders.pay_order(params)
                case "update_order":
                    result = square_client.orders.update_order(**params)
                # Checkout
                case "create_checkout":
                    result = square_client.checkout.create_checkout(params)
                case "create_payment_link":
                    result = square_client.checkout.create_payment_link(params)
                # Custom Attributes
                case "upsert_order_custom_attribute":
                    result = square_client.orders.upsert_order_custom_attribute(**params)
                case "list_order_custom_attribute_definitions":
                    result = square_client.orders.list_order_custom_attribute_definitions(**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)))
  • The @mcp.tool() decorator registers the 'orders' function as an MCP tool.
    @mcp.tool()
  • Docstring defining the input schema: 'operation' (str, one of listed operations) and 'params' (Dict[str, Any] for the specific operation). FastMCP likely uses this for tool schema generation.
    """Manage orders and checkout operations
    
    Args:
        operation: The operation to perform. Valid operations:
            Orders:
                - create_order
                - batch_retrieve_orders
                - calculate_order
                - clone_order
                - search_orders
                - pay_order
                - update_order
            Checkout:
                - create_checkout
                - create_payment_link
            Custom Attributes:
                - upsert_order_custom_attribute
                - list_order_custom_attribute_definitions
        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 but offers minimal behavioral insight. It lists operation types but doesn't disclose permissions needed, side effects (e.g., whether 'pay_order' charges a card), error handling, or response formats. For a tool with multiple operations including mutations, this is inadequate.

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

Conciseness4/5

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

The description is efficiently structured with a brief header and organized bullet points for operations. Each sentence earns its place by listing operation categories and examples, though it could be more front-loaded with a clearer purpose statement.

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 tool's complexity (multiple operations including mutations), lack of annotations, no output schema, and nested parameters, the description is insufficient. It doesn't cover authentication needs, rate limits, error responses, or how to structure the 'params' dictionary for different operations, leaving critical gaps for an agent.

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 schema, which has 0% coverage. It enumerates valid operations for the 'operation' parameter and explains that 'params' is a dictionary for operation-specific parameters. This clarifies what would otherwise be completely undocumented parameters, though it doesn't detail the structure of 'params'.

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

Purpose3/5

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

The description states the tool manages orders and checkout operations, which provides a general purpose but lacks specificity about what 'manage' entails. It distinguishes from siblings like 'bookings' or 'inventory' by focusing on orders, but doesn't clearly articulate the core verb beyond the generic 'manage'.

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?

No guidance is provided on when to use this tool versus alternatives like 'payments' or 'invoices'. The description lists operations but doesn't explain which scenarios warrant 'create_order' versus 'pay_order' or how this tool relates to sibling tools in the ecosystem.

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