call_databricks_tool
Execute Databricks-hosted tools through the MCP proxy by specifying tool names and arguments for remote operations.
Instructions
Call a tool on the remote Databricks MCP server.
Args:
tool_name: Name of the tool to call (use list_databricks_tools to see available tools)
arguments: Arguments to pass to the tool
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool_name | Yes | ||
| arguments | No |
Implementation Reference
- The @mcp.tool()-decorated handler function that implements the core logic of 'call_databricks_tool' by checking authentication and proxying the tool call to the DatabricksMCPProxy instance.@mcp.tool() def call_databricks_tool(tool_name: str, arguments: dict = {}) -> str: """ Call a tool on the remote Databricks MCP server. Args: tool_name: Name of the tool to call (use list_databricks_tools to see available tools) arguments: Arguments to pass to the tool """ if not state.authenticated or not state.proxy: return "Not authenticated. Call 'authenticate' first." try: result = state.proxy.call_tool(tool_name, arguments) if hasattr(result, 'content') and result.content: texts = [c.text for c in result.content if hasattr(c, 'text')] if texts: return "\n".join(texts) return str(result) except Exception as e: return f"Error calling tool '{tool_name}': {e}"
- Supporting method in DatabricksMCPProxy class that performs the actual remote tool invocation via DatabricksMCPClient.call_tool in a thread pool.def call_tool(self, name: str, arguments: dict) -> Any: """Call a tool on the remote MCP server.""" if not self._mcp_client: raise RuntimeError("Not connected. Call connect() first.") with ThreadPoolExecutor() as executor: return executor.submit(self._mcp_client.call_tool, name, arguments or {}).result()
- src/databricks_mcp_proxy/server.py:84-84 (registration)The @mcp.tool() decorator registers the 'call_databricks_tool' function with the FastMCP server.@mcp.tool()