list_job_runs
Retrieve the execution history of a Databricks job to monitor its performance and track past runs for analysis.
Instructions
List job run history
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"job_id": "<job_id>"
},
"name": "list_job_runs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/jobs.py:30-47 (handler)Implementation of the list_job_runs MCP tool which fetches job run history for a given job_id.
def list_job_runs(ctx: Context, job_id: int, limit: int = 10) -> List[Dict[str, Any]]: """List job run history""" w = get_workspace_client() runs_iter = w.jobs.list_runs(job_id=job_id, expand_tasks=False) results = [] for i, run in enumerate(runs_iter): if i >= limit: break run_d = run.as_dict() results.append({ "run_id": run_d.get("run_id"), "job_id": run_d.get("job_id"), "state": run_d.get("state"), "start_time": run_d.get("start_time"), "end_time": run_d.get("end_time"), "run_page_url": run_d.get("run_page_url") }) return results