list_jobs
Retrieve and display all Databricks jobs to monitor and manage scheduled workflows and automated tasks.
Instructions
List all Databricks jobs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Implementation Reference
- MCP tool handler for 'list_jobs': registers the tool and implements the execution logic by calling the jobs API and formatting the response as TextContent.@self.tool( name="list_jobs", description="List all Databricks jobs", ) async def list_jobs(params: Dict[str, Any]) -> List[TextContent]: logger.info(f"Listing jobs with params: {params}") try: result = await jobs.list_jobs() return [{"text": json.dumps(result)}] except Exception as e: logger.error(f"Error listing jobs: {str(e)}") return [{"text": json.dumps({"error": str(e)})}]
- src/api/jobs.py:54-66 (helper)Core helper function that performs the actual Databricks API call to list jobs using make_api_request.async def list_jobs() -> Dict[str, Any]: """ List all jobs. Returns: Response containing a list of jobs Raises: DatabricksAPIError: If the API request fails """ logger.info("Listing all jobs") return make_api_request("GET", "/api/2.0/jobs/list")