Skip to main content
Glama
block

Square MCP Server

by block

catalog

Manage Square catalog items, modifiers, taxes, and images through operations like create, update, search, and batch processing.

Instructions

Manage catalog operations

Args: operation: The operation to perform. Valid operations: - create_catalog_object - batch_delete_catalog_objects - batch_retrieve_catalog_objects - batch_upsert_catalog_objects - create_catalog_image - delete_catalog_object - retrieve_catalog_object - search_catalog_objects - update_catalog_object - update_item_modifier_lists - update_item_taxes params: Dictionary of parameters for the specific operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
paramsYes

Implementation Reference

  • The primary handler for the 'catalog' tool. Decorated with @mcp.tool() to register it with the MCP server. Dispatches to various Square Catalog API endpoints based on the 'operation' parameter.
    @mcp.tool() async def catalog( operation: str, params: Dict[str, Any] ) -> Dict[str, Any]: """Manage catalog operations Args: operation: The operation to perform. Valid operations: - create_catalog_object - batch_delete_catalog_objects - batch_retrieve_catalog_objects - batch_upsert_catalog_objects - create_catalog_image - delete_catalog_object - retrieve_catalog_object - search_catalog_objects - update_catalog_object - update_item_modifier_lists - update_item_taxes params: Dictionary of parameters for the specific operation """ try: match operation: case "create_catalog_object": result = square_client.catalog.create_catalog_object(params) case "batch_delete_catalog_objects": result = square_client.catalog.batch_delete_catalog_objects(params) case "batch_retrieve_catalog_objects": result = square_client.catalog.batch_retrieve_catalog_objects(params) case "batch_upsert_catalog_objects": result = square_client.catalog.batch_upsert_catalog_objects(params) case "create_catalog_image": result = square_client.catalog.create_catalog_image(params) case "delete_catalog_object": result = square_client.catalog.delete_catalog_object(**params) case "retrieve_catalog_object": result = square_client.catalog.retrieve_catalog_object(**params) case "search_catalog_objects": result = square_client.catalog.search_catalog_objects(params) case "update_catalog_object": result = square_client.catalog.update_catalog_object(**params) case "update_item_modifier_lists": result = square_client.catalog.update_item_modifier_lists(params) case "update_item_taxes": result = square_client.catalog.update_item_taxes(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 catalog function as an MCP tool.
    @mcp.tool()

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