update-schema
Modify and update an existing schema in Apache Pinot using JSON input, with options to reload or force changes as needed.
Instructions
Update an existing schema
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| reload | No | ||
| schemaJson | Yes | ||
| schemaName | Yes |
Implementation Reference
- mcp_pinot/server.py:147-161 (handler)The primary MCP tool handler for 'update_schema'. Decorated with @mcp.tool for automatic registration. Calls PinotClient.update_schema and returns formatted JSON response or error.
@mcp.tool def update_schema( schemaName: str, schemaJson: str, reload: bool = False, force: bool = False ) -> str: """Update an existing schema""" try: results = pinot_client.update_schema( schemaName, schemaJson, reload, force, ) return json.dumps(results, indent=2) except Exception as e: return f"Error: {str(e)}" - mcp_pinot/pinot_client.py:414-442 (helper)Helper method in PinotClient class that performs the actual HTTP PUT request to update the schema on the Pinot controller.
def update_schema( self, schemaName: str, schemaJson: str, reload: bool = False, force: bool = False, ) -> dict[str, Any]: url = f"{self.config.controller_url}/{PinotEndpoints.SCHEMAS}/{schemaName}" params = {"reload": str(reload).lower(), "force": str(force).lower()} headers = self._create_auth_headers() headers["Content-Type"] = "application/json" response = requests.put( url, headers=headers, params=params, data=schemaJson, timeout=(self.config.connection_timeout, self.config.request_timeout), verify=True, ) response.raise_for_status() try: return response.json() except requests.exceptions.JSONDecodeError: return { "status": "success", "message": "Schema update request processed.", "response_body": response.text, }