Skip to main content
Glama

submit_job

Submit a SLURM job by defining the shell command plus resource and environment options; omitted arguments inherit the cluster's configured defaults.

Instructions

Submit a SLURM job.

Omitted resource / environment arguments come from the cluster's
configured defaults (user config, and the project's when ``project`` is
given), not from fixed values.

Args:
    command: Shell command to execute (e.g. "python train.py --epochs 100")
    name: Job name for identification in SLURM queue
    nodes: Number of compute nodes to allocate
    gpus_per_node: Number of GPUs per node (0 for CPU-only)
    ntasks_per_node: Number of tasks per node
    cpus_per_task: Number of CPUs per task
    memory_per_node: Memory per node (e.g. "32GB", "64G")
    time_limit: Wall time limit (e.g. "4:00:00", "1-00:00:00")
    partition: SLURM partition name (e.g. "gpu", "cpu")
    nodelist: Specific nodes to use (e.g. "node001,node002")
    conda: Conda environment name to activate before running
    venv: Path to Python virtual environment to activate
    env_vars: Additional environment variables as key-value pairs
    log_dir: Directory for stdout/stderr log files
    work_dir: Working directory for the job (defaults to cwd)
    cluster: Cluster name (required; see ``list_clusters``).
    project: Project root whose ``.srunx/config.toml`` defaults apply.

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": {
      "command": "<command>"
    },
    "name": "submit_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNojob
venvNo
condaNo
nodesNo
clusterNo
commandYes
log_dirNo
projectNo
env_varsNo
nodelistNo
work_dirNo
partitionNo
time_limitNo
cpus_per_taskNo
gpus_per_nodeNo
memory_per_nodeNo
ntasks_per_nodeNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv6.0.0
    • addedInput schema / properties / cluster
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Cluster"
      +}
    • addedInput schema / properties / cpus_per_task / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / cpus_per_task / default
      Previous value: -1New value: +null
    • removedInput schema / properties / cpus_per_task / type
      Removed value: -"integer"
    • addedInput schema / properties / gpus_per_node / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / gpus_per_node / default
      Previous value: -0New value: +null
    • removedInput schema / properties / gpus_per_node / type
      Removed value: -"integer"
    • addedInput schema / properties / log_dir / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / log_dir / default
      Previous value: -"logs"New value: +null
    • removedInput schema / properties / log_dir / type
      Removed value: -"string"
    • addedInput schema / properties / nodes / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / nodes / default
      Previous value: -1New value: +null
    • removedInput schema / properties / nodes / type
      Removed value: -"integer"
    • addedInput schema / properties / ntasks_per_node / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / ntasks_per_node / default
      Previous value: -1New value: +null
    • removedInput schema / properties / ntasks_per_node / type
      Removed value: -"integer"
    • addedInput schema / properties / project
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Project"
      +}
    • removedInput schema / properties / transport
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Transport"
      -}
  2. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / transport
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Transport"
      +}
    • removedInput schema / properties / use_ssh
      Removed value: -{
      -  "default": false,
      -  "title": "Use Ssh",
      -  "type": "boolean"
      -}
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does disclose a genuine behavioral trait that annotations could not: unspecified resources are inherited from cluster/user/project config rather than fixed values. But it says nothing about whether submission is blocking or async, what happens on partition/resource rejection, or whether a duplicate job can be created, leaving the mutation's failure and waiting semantics opaque.

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?

Front-loaded with the one-line purpose, then the non-obvious defaults rule, then a parameter-by-parameter list. The length is justified by 17 undocumented parameters, though the Args block is a flat enumeration with no grouping of the resource-allocation parameters versus the environment parameters, which would aid scanning.

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?

An output schema exists, so return-value explanation is rightly omitted, and every parameter is documented for a complex 17-parameter tool. The remaining gap is behavioral rather than structural: the description never states whether the call blocks until the job starts or returns immediately after submission.

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

Parameters5/5

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

Schema coverage is 0% and the description compensates fully: all 17 parameters get a one-line meaning plus concrete formats where the schema gives only a type (memory_per_node "32GB"/"64G", time_limit "4:00:00"/"1-00:00:00", nodelist "node001,node002", gpus_per_node 0 for CPU-only, env_vars as key-value pairs, work_dir defaulting to cwd).

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?

Opens with a specific verb and resource: "Submit a SLURM job." That cleanly separates it from list_jobs, cancel_job, get_job_status, and the workflow tools without needing to name them.

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 defaults paragraph explains an important usage condition (omitted args resolve from user config and the project's .srunx/config.toml when project is given), and it points to list_clusters for the cluster argument. However, it never says when to prefer this over run_workflow/create_workflow for multi-step work, and it labels cluster as "required" while the schema marks it nullable with a null default — an unresolved conflict the agent must guess about.

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