Galaxy Community Hub

The Galaxy agentic stack

Your agent decides what to run. Galaxy runs every step in a container and records it in your history. When no installed tool fits, the agent writes one, and Galaxy runs and records that too.

Replay of an agent run on Galaxy. Asked to rename the sequence names in a GFF3 file from a mapping and count reads per gene, the agent finds no installed tool for the rename, writes a user-defined tool, Galaxy runs it in a container, then runs featureCounts, and both jobs, their outputs and their provenance appear in the history 'ATAC run 3'.

agent · usegalaxy.org
Agent
reads.bam uses chrM and chr1-style names; genes.gff3 uses MT and 1. Rename the GFF sequence names with the mapping in chrom_map.tsv, then count reads per gene.
get_history_contentsATAC run 3✓
1: reads.bam · 2: genes.gff3 · 3: chrom_map.tsv
search_tools_by_keywordsrename sequence names gff mapping✓
no match · text replace tools only
No installed tool applies a name mapping to a GFF3 file and checks for unknown names. I will write a user-defined tool for that step and use featureCounts for the counting.
gff-seqname-map.yml
class: GalaxyUserTool
id: gff-seqname-map
version: "0.1.0"
name: Rename GFF sequence names
description: Rewrite column 1 of a GFF3 file from a mapping
container: python:3.11-slim
shell_command: python - '$(inputs.gff.path)' '$(inputs.mapping.path)' renamed.gff3 <<'PY' …
inputs: gff (data, gff3) · mapping (data, tabular)
outputs: renamed ← renamed.gff3
help: markdown …
create_user_toolgff-seqname-map 0.1.0✓
created · private to your account
run_user_toolgff = data 2 · mapping = data 3✓
job 8c1d2e7a4b9f0356 queued
get_job_details8c1d2e7a…✓
ok · exit 0 · 3 s
search_tools_by_namefeatureCounts✓
featureCounts 2.0.3+galaxy2
run_toolfeatureCounts · data 1 + data 4✓
job 5d0f9a2c71be4e08 queued
get_job_details5d0f9a2c…✓
ok · exit 0 · 41 s
Done. Job 1 ran Rename GFF sequence names 0.1.0 in python:3.11-slim; job 2 ran featureCounts 2.0.3. Counts are dataset 5. Both jobs are in 'ATAC run 3' with their commands, containers and logs.
History · ATAC run 3
Custom ToolsRename GFF sequence names · 0.1.0
6:featureCounts on data 1 and data 4: Summaryok
5:featureCounts on data 1 and data 4: Countsok
4:Rename GFF sequence names on data 2 and data 3okgff3 · 41,983 lines
Job information
Tool
Rename GFF sequence names · 0.1.0 · user-defined
Container
python:3.11-slim
Command
python - '…/dataset_2.dat' '…/dataset_3.dat' renamed.gff3 <<'PY' …
Inputs
2: genes.gff3 · 3: chrom_map.tsv
Parameters
gff = data 2 · mapping = data 3
stdout
renamed 41983 feature lines; 25 names mapped; 0 unknown
stderr
(empty)
Exit code
0 · 3 s
3:chrom_map.tsvtabular · ok
2:genes.gff3gff3 · ok
1:reads.bambam · ok
Share Extract workflow Rerun

A representative run. The MCP calls and the tool YAML are real; names, sizes and timings are illustrative.

What Galaxy keeps

An agent working on your laptop leaves behind scratch scripts, renamed files and a chat log. Here, every step it takes is a Galaxy job, and Galaxy records the same things for each one whether the tool was installed by an admin or written by the agent a minute ago.

You can watch the history fill in while the agent works, or ask the agent to read a job back with get_job_details.

The history that results is ordinary Galaxy: share it by link, extract it to a workflow, or rerun it on new data. If you use Orbit, it also keeps the plan you approved and its reasoning in notebook.md, so the analysis lives in Galaxy and the thinking lives next to it.

Recorded for every job

Tool
Name and exact version, installed or user-defined
Container
The image the job ran in
Command
The full command line, as executed
Inputs
Every dataset and parameter value
Output
New datasets in your history, with formats and sizes
Logs
stdout, stderr and the exit code

The tool the agent wrote

In the run above, no installed tool could rename GFF sequence names from a mapping file and fail on unknown ones, so the agent wrote one. That’s a user-defined tool (UDT): a short YAML file with a container image, a shell command, and typed inputs and outputs. No admin install, no Tool Shed.

Galaxy validates the tool when it’s created and runs it like any other. The $(...) expressions that build the command can only see the declared inputs, which keeps what an agent can write narrow. Beyond that, how isolated the job is (network access, for example) depends on how the Galaxy server runs jobs.

The tool is saved under Custom Tools in your account, where you can read and revise it. It’s private unless you embed it in a workflow you share, and then it travels with the workflow.

A UDT is for filling gaps. When a Tool Shed tool already does the job, the agent should use it, the way it used featureCounts for the counting.

class: GalaxyUserTool
id: gff-seqname-map
version: "0.1.0"
name: Rename GFF sequence names
description: Rewrite column 1 of a GFF3 file from a two-column mapping; fail on unknown names
container: python:3.11-slim
shell_command: |
  python - '$(inputs.gff.path)' '$(inputs.mapping.path)' renamed.gff3 <<'PY'
  import sys
  gff, mapfile, out = sys.argv[1:4]
  names = {}
  with open(mapfile) as fh:
      for line in fh:
          if line.startswith('#') or not line.strip():
              continue
          old, new = line.rstrip('\n').split('\t')[:2]
          names[old] = new
  renamed = unknown = 0
  missing = set()
  with open(gff) as fin, open(out, 'w') as fout:
      for line in fin:
          if line.startswith('#') or not line.strip():
              fout.write(line)
              continue
          cols = line.split('\t')
          if cols[0] in names:
              cols[0] = names[cols[0]]
              renamed += 1
          else:
              unknown += 1
              missing.add(cols[0])
          fout.write('\t'.join(cols))
  print(f'renamed {renamed} feature lines; {len(names)} names mapped; {unknown} unknown')
  if unknown:
      print('unknown sequence names: ' + ', '.join(sorted(missing)), file=sys.stderr)
      sys.exit(2)
  PY
inputs:
  - name: gff
    type: data
    format: gff3
    label: GFF3 annotation
  - name: mapping
    type: data
    format: tabular
    label: Two-column mapping (old name, new name)
outputs:
  - name: renamed
    type: data
    format: gff3
    from_work_dir: renamed.gff3
help:
  format: markdown
  content: |
    Rewrites the sequence name (column 1) of every feature line in a GFF3 file
    using a two-column tab-separated mapping of old name to new name. Comment
    and blank lines pass through unchanged. The job fails if a sequence name is
    missing from the mapping; stdout reports how many lines changed.

Get started

  1. Request UDT access

    User-defined tools are in beta on usegalaxy.org and turned on per account by an administrator, so start here. Signing in with ORCID is optional but usually speeds review. Once you’re enabled, Custom Tools shows up in your Activity Bar. On another Galaxy server, ask its administrators.

    The next two steps work without this; your agent just can’t write tools until it’s on.

  2. Create a Galaxy API key

    Log in to usegalaxy.org and open User › Preferences › Manage API Key. The key gives full access to your account, so put it in your agent’s settings rather than pasting it into chat.

  3. Connect an agent

    Orbit

    A desktop app with Galaxy already wired in. Paste your server URL and key into its preferences and it fetches the Galaxy skills on first use. It drafts a plan, waits for your approval and keeps a git-tracked notebook of the analysis.

    Your own coding agent

    Claude Code, Codex, Antigravity or Pi. Install two plugins: the Galaxy connection (galaxy-mcp) and the Galaxy skills, including udt-authoring, which the agent follows when it writes a tool. Claude Desktop gets the connection without the skills.

  4. Try it

    Paste this into the agent:

    Write a user-defined tool that counts the lines in a dataset, run it on a dataset in my current history, and show me the job's command and container.

    It’ll call create_user_tool, run_user_tool and get_job_details, and you’ll see the tool and the job appear in Galaxy as it goes. If Galaxy refuses to create or run the tool, your account isn’t enabled for UDTs yet.

Limits

  • UDTs are in beta, on usegalaxy.org, and enabled per account.
  • A UDT can’t see Galaxy reference data, dataset metadata files (such as BAM indexes) or a tool’s extra_files, and test cases aren’t supported yet.
  • Galaxy checks the YAML but not whether the container tag exists, so a wrong tag only fails at run time. The udt-authoring skill looks images up instead of guessing.
  • There’s no in-place update through the API. Each revision is a new version of the tool; you can deactivate the old ones.

Need help?