Capability catalogue
evidenceread
db.jobs.history
Get SQL Agent job history
Recent SQL Agent job runs and step results from msdb (newest first, at most 200). Needs SQLAgentReaderRole in msdb; not available on Azure SQL Database. Internal evidence: for understanding only, never quoted.
Effect
read Fanout
no
Cache TTL
none
Traits
internal_evidence, read_only
Request arguments
Passed as the args parameter to ctx.capability.call("db.jobs.history", …).
| Field | Type | Required | Description |
|---|---|---|---|
| days | integer | no | default: 7 · min: 1 · max: 30 |
| jobNamePattern | string | no | LIKE pattern for the job name; default % (all jobs) |
Response
Returned by ctx.capability.call("db.jobs.history", …).
Array; each element is an object with the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
| job | string | yes | |
| step | string | yes | Step name; (job outcome) for the overall result row |
| runAt | string | null | no | Server local time, ISO-8601 without offset |
| status | string | yes | enum: ["succeeded","failed","retry","canceled","in_progress","unknown"] |
| message | string | null | no | Capped at 1000 characters |
| durationSeconds | integer | no |
Example call
From inside your agent's handle(). The kernel resolves db.jobs.history to the tenant's connector binding at invocation time.
response = await ctx.capability.call(
"db.jobs.history",
args={
"days": 7,
"jobNamePattern": "...",
},
)See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.