Skip to main content
Glama
samhavens

Databricks MCP Server

by samhavens

get_sql_status

Retrieve the status and results of a Databricks SQL statement using its statement_id for monitoring and analysis.

Instructions

Get the status and results of a SQL statement by statement_id

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statement_idYes

Implementation Reference

  • MCP tool handler for get_sql_status: logs the request, calls the sql.get_statement_status helper, returns JSON result or error.
    @mcp.tool() async def get_sql_status(statement_id: str) -> str: """Get the status and results of a SQL statement by statement_id""" logger.info(f"Getting status for SQL statement: {statement_id}") try: result = await sql.get_statement_status(statement_id) return json.dumps(result) except Exception as e: logger.error(f"Error getting SQL status: {str(e)}") return json.dumps({"error": str(e)})
  • Helper function implementing the Databricks SQL Statements API call to retrieve statement status.
    async def get_statement_status(statement_id: str) -> Dict[str, Any]: """ Get the status of a SQL statement. Args: statement_id: ID of the statement to check Returns: Response containing statement status Raises: DatabricksAPIError: If the API request fails """ logger.info(f"Getting status of SQL statement: {statement_id}") return make_api_request("GET", f"/api/2.0/sql/statements/{statement_id}", params={})

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/samhavens/databricks-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server