create_job
Create SQL Server Agent jobs with steps, schedules, and success/failure actions in one all-or-nothing transaction.
Instructions
Create an Agent job with steps and optional schedules in ONE transaction (all or nothing).
steps: [{"name": "Step 1", "command": "EXEC dbo.DoWork", "database": "MyDb", "subsystem": "TSQL" (default) | "CmdExec" | "PowerShell" | "SSIS", "on_success": "next"|"quit_success"|"quit_failure"|"goto:2", "on_fail": ..., "retry_attempts": 0, "retry_interval": 0, "output_file": null, "raw": {any extra sp_add_jobstep parameter}}] schedules: [{"name": "Nightly", "type": "daily"|"weekly"|"monthly"|"once"|"agent_start"|"idle", "start_time": "02:30", "every_n": 1, "days": ["mon","fri"] (weekly), "day_of_month": 1 (monthly), "repeat_every_minutes": 15 | "repeat_every_hours": 1 | "repeat_every_seconds": 30, "end_time": "23:59", "start_date": "2026-01-31", "end_date": ..., "enabled": true, "raw": {extra sp_add_jobschedule params}}] Default on_success: 'next' for every step except the last ('quit_success').
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_name": "<job_name>",
"steps": "<steps>"
},
"name": "create_job"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | ||
| enabled | No | ||
| category | No | ||
| job_name | Yes | ||
| schedules | No | ||
| connection | No | ||
| description | No | ||
| owner_login | No |