Skip to main content
Glama

hf_job_launch

Launch a Hugging Face GPU training script as a background job, returning immediately so you can monitor status, logs, metrics, and checkpoints while the rented machine runs.

Instructions

Run a training script on its own rented Hugging Face machine; returns immediately.

The machine is billed per minute and stops when the script ends, fails, or hits timeout — so set timeout generously for real trainings (e.g. "6h"). The script may use the injected helpers log_metric(step, **kv), save_checkpoint_file(path) (uploads a file or folder to the private Hub repo <you>/<run_name>) and SEED. Follow it with get_run_status / get_logs / get_metrics / plot_metrics, cancel with stop_run, fetch results with save_checkpoint.

flavor: machine type from hf_hardware, e.g. "t4-small", "a10g-small", "a100-large". timeout: time limit such as "30m", "2h", "1d". requirements: space-separated pip packages, e.g. "torch transformers peft datasets". env_json: JSON object of extra environment variables. image: optional Docker image that has uv installed (default: a plain Python image; pip-installed torch brings its own CUDA libraries).

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>",
      "run_name": "<run_name>"
    },
    "name": "hf_job_launch"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageNo
flavorNocpu-basic
scriptYes
timeoutNo1h
env_jsonNo
run_nameYes
requirementsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: per-minute billing, machine lifecycle (stops on completion, failure, or timeout), timeout-sizing advice, the injected helper API (log_metric, save_checkpoint_file, SEED), and the private Hub repo destination for checkpoints. This is exactly the cost and side-effect context an agent needs before a mutating, billable call.

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-sentence core behavior, then lifecycle/billing, then workflow, then a compact per-parameter glossary. Dense but every block earns its place; the trailing parameter list is slightly list-like but functional.

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 values need no explanation, and the description covers cost, lifecycle, helpers, and most parameters. The remaining gap is the semantics of the required 'script' argument, which an agent must guess at before it can call the tool correctly.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it documents five of seven parameters with concrete examples (flavor values like 'a10g-small', timeout formats like '6h', space-separated requirements, env_json as a JSON object, image needing uv). It leaves 'script' ambiguous (inline source vs. path) and 'run_name' only implicitly defined via the '<you>/<run_name>' repo path.

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 ('Run a training script on its own rented Hugging Face machine') plus the key async trait ('returns immediately'). It does not explicitly distinguish itself from the sibling launch_training, so an agent must infer the difference, but the purpose itself is unambiguous.

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?

Gives a concrete follow-up workflow: get_run_status / get_logs / get_metrics / plot_metrics after launch, stop_run to cancel, save_checkpoint to fetch results. It lacks explicit when-not-to-use guidance (e.g. versus launch_training or a local run), which keeps it below a 5.

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