invoices
Create, search, update, and manage Square invoices through the Square MCP Server to handle billing and payment tracking.
Instructions
Manage invoice operations
Args:
operation: The operation to perform. Valid operations:
- create_invoice
- search_invoices
- get_invoice
- update_invoice
- cancel_invoice
- publish_invoice
- delete_invoice
params: Dictionary of parameters for the specific operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | ||
| params | Yes |
Implementation Reference
- src/square_mcp/server.py:382-421 (handler)The primary handler for the 'invoices' tool. It is registered with @mcp.tool() and handles multiple sub-operations by calling corresponding Square API methods based on the 'operation' parameter.@mcp.tool() async def invoices( operation: str, params: Dict[str, Any] ) -> Dict[str, Any]: """Manage invoice operations Args: operation: The operation to perform. Valid operations: - create_invoice - search_invoices - get_invoice - update_invoice - cancel_invoice - publish_invoice - delete_invoice params: Dictionary of parameters for the specific operation """ try: match operation: case "create_invoice": result = square_client.invoices.create_invoice(params) case "search_invoices": result = square_client.invoices.search_invoices(params) case "get_invoice": result = square_client.invoices.get_invoice(**params) case "update_invoice": result = square_client.invoices.update_invoice(**params) case "cancel_invoice": result = square_client.invoices.cancel_invoice(**params) case "publish_invoice": result = square_client.invoices.publish_invoice(**params) case "delete_invoice": result = square_client.invoices.delete_invoice(**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)))
- src/square_mcp/server.py:387-399 (schema)Docstring providing schema information: input parameters 'operation' (enum of sub-operations) and 'params' (dict for the specific API call)."""Manage invoice operations Args: operation: The operation to perform. Valid operations: - create_invoice - search_invoices - get_invoice - update_invoice - cancel_invoice - publish_invoice - delete_invoice params: Dictionary of parameters for the specific operation """
- src/square_mcp/server.py:382-382 (registration)The @mcp.tool() decorator registers the 'invoices' function as an MCP tool.@mcp.tool()