Skip to main content
Glama
block

Square MCP Server

by block

inventory

Manage inventory operations in Square by tracking stock levels, adjusting quantities, and retrieving inventory data for accurate business management.

Instructions

Manage inventory operations

Args: operation: The operation to perform. Valid operations: - batch_change_inventory - batch_retrieve_inventory_changes - batch_retrieve_inventory_counts - retrieve_inventory_adjustment - retrieve_inventory_changes - retrieve_inventory_count - retrieve_inventory_physical_count - retrieve_inventory_transfer params: Dictionary of parameters for the specific operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
paramsYes

Implementation Reference

  • The handler function for the 'inventory' tool. It is registered via @mcp.tool() decorator and handles multiple inventory operations by dispatching to the corresponding Square API methods based on the 'operation' parameter provided.
    @mcp.tool() async def inventory( operation: str, params: Dict[str, Any] ) -> Dict[str, Any]: """Manage inventory operations Args: operation: The operation to perform. Valid operations: - batch_change_inventory - batch_retrieve_inventory_changes - batch_retrieve_inventory_counts - retrieve_inventory_adjustment - retrieve_inventory_changes - retrieve_inventory_count - retrieve_inventory_physical_count - retrieve_inventory_transfer params: Dictionary of parameters for the specific operation """ try: match operation: case "batch_change_inventory": result = square_client.inventory.batch_change_inventory(params) case "batch_retrieve_inventory_changes": result = square_client.inventory.batch_retrieve_inventory_changes(params) case "batch_retrieve_inventory_counts": result = square_client.inventory.batch_retrieve_inventory_counts(params) case "retrieve_inventory_adjustment": result = square_client.inventory.retrieve_inventory_adjustment(**params) case "retrieve_inventory_changes": result = square_client.inventory.retrieve_inventory_changes(**params) case "retrieve_inventory_count": result = square_client.inventory.retrieve_inventory_count(**params) case "retrieve_inventory_physical_count": result = square_client.inventory.retrieve_inventory_physical_count(**params) case "retrieve_inventory_transfer": result = square_client.inventory.retrieve_inventory_transfer(**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)))

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