Skip to main content
Glama

slurm_submit

Submit a SLURM batch job from a command string and auto-register completion notifications, including array-task tallies and dependency chaining, to avoid SSH polling loops.

Instructions

Submit a SLURM batch job built from a command string. Auto-registers a completion watch: when the job (or, for arrays, EVERY task) finishes, a notification with an ok/failed tally is prepended to your next tool result — never poll with ssh loops. For many independent chunks use array (e.g. "1-20" or "1-100%10"; each task reads $SLURM_ARRAY_TASK_ID; logs go to slurm__.out). Chain jobs with dependency (e.g. "afterok:12345"). Checks past resource usage, and appends ⚠️ hints (non-blocking) when the partition has a per-user cap that will serialize your jobs or reject the request (gpus/mem/time over the cap).

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": {
      "script": "<script>"
    },
    "name": "slurm_submit"
  }
}

Input Schema

NameRequiredDescriptionDefault
memNoMemory, e.g. 4G / 512M (default: 4G)
gpusNoNumber of GPUs (default: 1; 0 = no --gres line). Some sites reject 0 (every job must request ≥1 GPU).
timeNoTime limit: M, M:S, H:M:S, D-H, D-H:M or D-H:M:S (default: 00:15:00)
arrayNoSLURM array spec: "1-10", "1,3,5-7", "1-100%5" (%N = max concurrent tasks). Each task gets $SLURM_ARRAY_TASK_ID.
scriptYesMain command(s) to run inside the job
job_nameNoJob name, [A-Za-z0-9_.-]{1,64} (default: slurm-job)
preambleNoInclude HPC_PREAMBLE (module loads/conda env) in the job script. Set false for generic jobs that do not need the project environment.
templateNoName of saved template to use as defaults (see template_list); unknown names are an error
partitionNoPartition (default: batch). Use cluster_info to see per-user caps; small debug partitions often allow 1 job at a time — for parallel chunks pick a partition without a per-user cap.
dependencyNoSLURM dependency, e.g. "afterok:12345", "afterany:12345_2", "singleton"
output_dirNoLog output dir (default: results/logs, under the workdir if set). Avoid /tmp — it is node-local.
cpus_per_taskNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it explains the auto-registered completion watch, the ok/failed tally notification, per-task array log naming, dependency behavior, and non-blocking resource-cap warnings. It stops short of stating what the immediate submission response contains, such as the job ID, but the important side effects are disclosed.

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 description is dense but front-loaded, leading with the core action and then covering the most important behavioral traits. It packs several ideas into one long paragraph, but each sentence carries relevant information rather than filler.

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

Completeness4/5

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

For a 12-parameter submission tool with no annotations and no output schema, the description covers the critical behavioral context: completion notifications, arrays, dependencies, and resource-cap warnings. It could be more complete by saying what the submission call immediately returns, but it is otherwise strong.

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 92%, so the input schema already documents nearly every parameter. The description adds useful usage context around `array`, `dependency`, and partition caps, but most parameter-level meaning is already present in the schema rather than added by the description.

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

Purpose5/5

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

The description states a specific verb and resource: submit a SLURM batch job built from a command string. That phrasing also distinguishes it from the sibling slurm_submit_file, which likely submits from a file instead of a command string.

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

Usage Guidelines4/5

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

It gives clear guidance on using `array` for many independent chunks and `dependency` for chaining jobs, and explicitly warns against polling with ssh loops. It does not directly name slurm_submit_file as the alternative for file-based jobs, but the command-string framing makes the distinction reasonably clear.

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