Skip to main content
Glama
block

Square MCP Server

by block

business

Manage Square business operations including merchants, locations, vendors, and sites through a unified interface for operational control.

Instructions

Manage business operations

Args:
    operation: The operation to perform. Valid operations:
        Merchants:
            - list_merchants
            - retrieve_merchant
        Locations:
            - list_locations
            - create_location
            - retrieve_location
            - update_location
        Vendors:
            - bulk_create_vendors
            - bulk_retrieve_vendors
            - create_vendor
            - search_vendors
            - update_vendor
        Sites:
            - list_sites
    params: Dictionary of parameters for the specific operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
paramsYes

Implementation Reference

  • The 'business' tool handler function, decorated with @mcp.tool(). It handles various Square API operations for merchants, locations, vendors, and sites based on the 'operation' parameter.
    @mcp.tool()
    async def business(
        operation: str,
        params: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Manage business operations
    
        Args:
            operation: The operation to perform. Valid operations:
                Merchants:
                    - list_merchants
                    - retrieve_merchant
                Locations:
                    - list_locations
                    - create_location
                    - retrieve_location
                    - update_location
                Vendors:
                    - bulk_create_vendors
                    - bulk_retrieve_vendors
                    - create_vendor
                    - search_vendors
                    - update_vendor
                Sites:
                    - list_sites
            params: Dictionary of parameters for the specific operation
        """
        try:
            match operation:
                # Merchants
                case "list_merchants":
                    result = square_client.merchants.list_merchants(**params)
                case "retrieve_merchant":
                    result = square_client.merchants.retrieve_merchant(**params)
                # Locations
                case "list_locations":
                    result = square_client.locations.list_locations()
                case "create_location":
                    result = square_client.locations.create_location(params)
                case "retrieve_location":
                    result = square_client.locations.retrieve_location(**params)
                case "update_location":
                    result = square_client.locations.update_location(**params)
                # Vendors
                case "bulk_create_vendors":
                    result = square_client.vendors.bulk_create_vendors(params)
                case "bulk_retrieve_vendors":
                    result = square_client.vendors.bulk_retrieve_vendors(params)
                case "create_vendor":
                    result = square_client.vendors.create_vendor(params)
                case "search_vendors":
                    result = square_client.vendors.search_vendors(params)
                case "update_vendor":
                    result = square_client.vendors.update_vendor(**params)
                # Sites
                case "list_sites":
                    result = square_client.sites.list_sites(**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)))
  • Input schema defined by function parameters (operation: str, params: Dict[str, Any]) and comprehensive docstring listing valid operations and parameters.
    async def business(
        operation: str,
        params: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Manage business operations
    
        Args:
            operation: The operation to perform. Valid operations:
                Merchants:
                    - list_merchants
                    - retrieve_merchant
                Locations:
                    - list_locations
                    - create_location
                    - retrieve_location
                    - update_location
                Vendors:
                    - bulk_create_vendors
                    - bulk_retrieve_vendors
                    - create_vendor
                    - search_vendors
                    - update_vendor
                Sites:
                    - list_sites
            params: Dictionary of parameters for the specific operation
        """
  • The @mcp.tool() decorator registers the 'business' function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'Manage business operations' which implies mutation capabilities, but doesn't disclose which operations are read-only vs. mutating, authentication requirements, rate limits, or error behaviors. The operation list suggests both read and write capabilities, but without behavioral context.

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?

Well-structured with clear headings and bullet points. The two-sentence introduction is followed by organized parameter documentation. While somewhat lengthy due to the operation list, every element serves a purpose. 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?

Inadequate for a complex multi-operation tool with no annotations and no output schema. The description doesn't explain what the tool returns, how errors are handled, or the scope of operations. For a tool that appears to be a gateway to multiple business subsystems, this leaves critical gaps in understanding.

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?

With 0% schema description coverage, the description compensates well by documenting the 'operation' parameter with a comprehensive list of valid values organized by category. It explains that 'params' is a dictionary for operation-specific parameters, though it doesn't detail what those parameters should contain. This adds significant value beyond the bare schema.

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

Purpose2/5

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

The description states 'Manage business operations' which is vague and tautological with the tool name 'business'. It lists specific operations but doesn't clearly articulate what the tool actually does beyond being a multi-operation container. The purpose isn't distinguished from sibling tools like 'customers' or 'inventory'.

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 on when to use this tool versus the sibling tools. While it lists available operations, it doesn't explain when to choose this multi-operation tool over more specialized sibling tools like 'customers', 'inventory', or 'orders'. No context about prerequisites or constraints is provided.

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