Skip to main content
Glama
sql-mcp
by ohankay

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

NameRequiredDescriptionDefault
stepsYes
enabledNo
categoryNo
job_nameYes
schedulesNo
connectionNo
descriptionNo
owner_loginNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=false, destructiveHint=false and idempotentHint=false, so the safety profile is already known. The description adds real behavioral context beyond that: the all-or-nothing transactional guarantee and the default routing rules ('Default on_success: next for every step except the last (quit_success)') are exactly the kind of detail an agent needs and cannot get from annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The one-sentence purpose is front-loaded, followed by a compact schema-like spec block. Given that the nested step and schedule objects are typed only as additionalProperties in the schema, the denser payload format is functional rather than redundant, with minimal wasted wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no output schema, the definition covers structure but omits behavior an agent would want: what happens when a job with that name already exists, what is returned on success, and what the connection parameter selects. It is adequate to construct a valid call, but incomplete for anticipating outcomes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does a thorough job on the two hardest parameters: steps and schedules get field-by-field enumerations (subsystem, on_success/on_fail, retry fields, schedule types, repeat intervals) and defaults. However, five of the eight top-level parameters (enabled, category, connection, description, owner_login) are never mentioned in the description and have no schema documentation at all, leaving a real gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Create an Agent job') and adds the scope qualifier that the job, its steps, and schedules are created atomically in one transaction. That atomicity framing implicitly separates it from the incremental siblings add_job_step and add_job_schedule, though it never names them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'in ONE transaction (all or nothing)' phrasing implies this is the tool to pick when steps and schedules must succeed together, but there is no explicit when-to-use/when-not statement and no mention of the alternative path (create the job, then call add_job_step/add_job_schedule). Guidance is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.