Skip to main content
Glama

ROBOT Ontology MCP

MCP server wrapping the ROBOT command-line tool for OWL ontology editing.

Prerequisites

ROBOT must be installed and available on your PATH:

robot --version

See ROBOT installation for setup instructions.

Related MCP server: @jingjingbox/mcp-cli-bridge

Installation

uvx robot-tool-mcp

From source

git clone https://github.com/<owner>/robot-mcp.git
cd robot-mcp
uv run robot-mcp

Claude Desktop Configuration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "robot-mcp": {
      "command": "uvx",
      "args": ["robot-tool-mcp"]
    }
  }
}

Or for local development:

{
  "mcpServers": {
    "robot-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/robot-tool-mcp", "robot-mcp"]
    }
  }
}

Tools

Individual Command Tools (25 tools)

Each ROBOT command is exposed as a dedicated MCP tool with typed parameters:

Tool

Description

robot_annotate

Add metadata annotations to an ontology

robot_collapse

Simplify class hierarchies by removing intermediates

robot_convert

Transform ontology between formats (OWL, OBO, TTL, etc.)

robot_diff

Compare two ontologies semantically

robot_expand

Convert shortcut annotations into OWL axioms

robot_explain

Debug inferred statements with minimal explanations

robot_export

Generate tabular output (CSV, TSV, JSON, HTML, XLSX)

robot_extract

Create a subset module (STAR, BOT, TOP, MIREOT)

robot_filter

Selectively copy axioms (inverse of remove)

robot_materialize

Assert inferred superclass relationships

robot_measure

Compute ontology metrics and statistics

robot_merge

Combine multiple ontologies into one

robot_mirror

Cache imported ontologies locally

robot_query

Execute SPARQL queries (SELECT, ASK, CONSTRUCT, UPDATE)

robot_reason

Run OWL reasoner (ELK, HermiT, JFact, Whelk)

robot_reduce

Remove redundant subClassOf axioms

robot_relax

Convert equivalence axioms to subclass axioms

robot_remove

Eliminate selected axioms (inverse of filter)

robot_rename

Modify entity IRIs

robot_repair

Fix common ontology problems

robot_report

Run quality control checks with violation report

robot_template

Convert tabular data (CSV/TSV) into OWL

robot_unmerge

Remove axioms of one ontology from another

robot_validate_profile

Check OWL 2 profile conformance (EL/RL/QL/DL)

robot_verify

Check ontology against SPARQL rules

Chain Tool

The robot_chain tool pipelines multiple commands in a single ROBOT process. Ontology objects pass in-memory between steps — no intermediate files needed.

{
  "steps": [
    {"command": "merge", "input": ["edit.owl", "base.owl"]},
    {"command": "reason", "reasoner": "ELK"},
    {"command": "annotate", "ontology_iri": "https://example.org/my.owl"},
    {"command": "convert", "format": "ofn", "output": "result.owl"}
  ]
}

This produces a single CLI call:

robot merge --input edit.owl --input base.owl \
      reason --reasoner ELK \
      annotate --ontology-iri https://example.org/my.owl \
      convert --format ofn --output result.owl

Argument mapping rules:

  • Underscores become hyphens: ontology_iri → --ontology-iri

  • Lists repeat the flag: {"input": ["a.owl", "b.owl"]} → --input a.owl --input b.owl

  • Booleans become strings: true → "true"

Common Workflows

Build a release:

{
  "steps": [
    {"command": "merge", "input": ["edit.owl"]},
    {"command": "reason", "reasoner": "ELK"},
    {"command": "relax"},
    {"command": "reduce", "reasoner": "ELK"},
    {"command": "annotate", "ontology_iri": "https://example.org/release.owl",
     "version_iri": "https://example.org/2024-01-01/release.owl"},
    {"command": "convert", "output": "release.owl"}
  ]
}

Extract a module:

{
  "steps": [
    {"command": "merge", "input": ["full-ontology.owl"]},
    {"command": "extract", "method": "BOT", "term": ["GO:0005634", "GO:0005737"]},
    {"command": "annotate", "ontology_iri": "https://example.org/module.owl"},
    {"command": "convert", "output": "module.owl"}
  ]
}

Quality check:

{
  "steps": [
    {"command": "merge", "input": ["edit.owl"]},
    {"command": "report", "fail_on": "ERROR", "output": "report.tsv"}
  ]
}

Global Options

All tools support these global options:

Option

Description

catalog

XML catalog file for resolving imports

prefixes

JSON-LD prefix file

add_prefix

Add individual prefixes (list)

noprefixes

Disable default prefixes

verbose

Enable verbose logging

strict

Fail on unparsed triples

xml_entities

Use XML entities in RDF/XML output

working_directory

Working directory for file paths

extra_args

Escape hatch for rarely-used flags (list of strings)

How to Contribute

  1. Fork the repository

  2. Create a feature branch from main:

    git checkout -b feature/your-feature
  3. Install dev dependencies:

    uv sync --dev
  4. Make your changes and ensure code quality:

    uv run ruff format src/
    uv run ruff check src/
  5. Commit your changes and push to your fork

  6. Open a Pull Request against main

The main branch is protected — all changes must go through a PR.

License

BSD 2-Clause License

Available Tools

26 tools
robot_annotateB

Add metadata annotations to an ontology.

Set the ontology IRI, version IRI, and add annotation properties. Each annotation value is a string like "rdfs:comment 'Example ontology'". Use link_annotation for IRI-valued annotations and language_annotation for language-tagged literals.

Inputs: input, output, ontology_iri, version_iri, +17 more. Returns: object

robot_chainA

Execute a chain of ROBOT commands in a single process.

Ontology objects pass in-memory between steps — much more efficient than writing intermediate files. Only the first step typically needs an input key and only the last step needs an output key.

Each step is a dict with:

  • command: the ROBOT command name (e.g. "merge", "reason")

  • All other keys are command arguments. Use the long flag name without leading dashes, with hyphens replaced by underscores.

Argument mapping rules:

  • Underscores become hyphens: ontology_iri → --ontology-iri

  • list values repeat the flag: {"input": ["a.owl", "b.owl"]} → --input a.owl --input b.owl

  • bool values become "true" / "false" strings

  • str / int values become a single flag-value pair

Example steps::

[
    {"command": "merge", "input": ["edit.owl", "base.owl"]},
    {"command": "reason", "reasoner": "ELK"},
    {"command": "annotate", "ontology_iri": "https://example.org/my.owl"},
    {"command": "convert", "format": "ofn", "output": "result.owl"}
]

Tip: to discover available flags for a command, pass "help": true in a step, e.g. [{"command": "merge", "help": true}].

Inputs: steps (required), working_directory, catalog, prefixes, +5 more. Returns: object

robot_collapseB

Collapse class hierarchies by removing intermediate classes.

Classes with fewer than threshold (default 2) subclasses are removed, and their subclasses are promoted. Use precious or precious_terms to protect specific classes from removal.

Inputs: input, output, threshold, precious, +10 more. Returns: object

robot_convertA

Convert an ontology between formats.

Supported formats (by extension or format flag): owl (RDF/XML), ofn (OWL Functional), omn (Manchester), owx (OWL/XML), ttl (Turtle), obo (OBO Format), json (OBO Graphs JSON). Gzip compression is supported by appending .gz to the output path.

Inputs: input, output, format, check, +9 more. Returns: object

robot_diffA

Compare two ontologies and report semantic differences.

Specify ontologies via file paths (left/right) or IRIs (left_iri/right_iri). Output formats: plain (default), pretty, html, markdown. Use labels to include human-readable entity labels in the diff output.

Inputs: left, right, left_iri, right_iri, +14 more. Returns: object

robot_expandB

Expand shortcut annotation properties (macros) into OWL axioms.

Use expand_term to specify which macro properties to expand. Use no_expand_term to exclude specific properties. Set annotate_expansion_axioms to mark generated axioms.

Inputs: input, output, expand_term, no_expand_term, +10 more. Returns: object

robot_explainA

Compute minimal axiom explanations for inferred statements.

Useful for debugging classification issues. Modes: entailment (explain why an axiom is entailed), inconsistency (explain why the ontology is inconsistent), unsatisfiability (explain why a class is unsatisfiable).

The axiom parameter takes a Manchester-syntax axiom string like "'uvular muscle' SubClassOf 'muscle organ'".

Inputs: input, reasoner, axiom, explanation, +12 more. Returns: object

robot_exportC

Export ontology data to a table (CSV, TSV, JSON, HTML, XLSX).

The header defines columns using pipe-separated names like "ID|LABEL|SubClass Of". Use include to specify entity types (classes, individuals, properties). Use sort to order by column.

Inputs: input, header, export, format, +14 more. Returns: object

robot_extractB

Extract a subset module from a larger ontology.

Methods:

  • STAR: minimal module with seed terms and direct relationships

  • BOT: seed terms plus all superclasses

  • TOP: seed terms plus all subclasses

  • MIREOT: hierarchy-preserving extraction with upper/lower boundaries

  • subset: seed terms with materialized existential relationships

Specify seed terms via term (list of CURIEs/IRIs) or term_file.

Inputs: input, output, method, term, +19 more. Returns: object

robot_filterB

Selectively copy axioms from an ontology (inverse of remove).

Specify terms to include via term or term_file. Use select to control which related terms to include (e.g. "self parents descendants annotations"). The trim flag controls whether axioms require ALL or ANY objects in the target set.

Inputs: input, output, term, term_file, +17 more. Returns: object

robot_materializeB

Materialize inferred superclass relationships using a reasoner.

Similar to reason but focused on asserting existential restrictions. Use term or term_file to restrict which properties to materialize.

Inputs: input, output, reasoner, term, +10 more. Returns: object

robot_measureA

Compute ontology metrics (entity counts, axiom counts, complexity).

Metric sets: essential (default), extended, all, reasoner-essential, reasoner-extended, reasoner-all. Output formats: tsv, csv, json, yaml, html.

Inputs: input, output, metrics, format, +9 more. Returns: object

robot_mergeA

Merge one or more OWL ontology files into a single ontology.

Combine multiple ontology files. Each input path or input_iri IRI is loaded and merged. Use inputs for glob patterns like "edit*.owl". By default, import closures are merged and owl:imports statements are removed.

Inputs: input, input_iri, inputs, output, +13 more. Returns: object

robot_mirrorA

Mirror (cache) external ontology imports locally.

Downloads all imported ontologies to directory and generates a catalog XML file at output for offline use. Prevents network failures from breaking builds.

Inputs: input, output, directory, working_directory, +8 more. Returns: object

robot_queryA

Execute SPARQL queries against an ontology.

Use query for pairs of query-file and output-file (e.g. ["cell_part.sparql", "results/cell_part.csv"]). Use queries with output_dir for batch execution. Use update for SPARQL UPDATE operations that modify the ontology.

Query types: ASK (true/false), SELECT (tabular CSV), CONSTRUCT (RDF). Use tdb for large ontologies to use disk-backed storage.

Inputs: input, output, query, queries, +14 more. Returns: object

robot_reasonB

Run an OWL reasoner to classify the ontology and check consistency.

Reasoner choices: ELK (default, fast, OWL 2 EL), HermiT (full OWL 2 DL), JFact, Whelk, EMR (Expression Materializing Reasoner), Structural. The axiom_generators flag controls which inferred axioms to assert (e.g. "SubClass EquivalentClass DisjointClasses").

Inputs: input, output, reasoner, axiom_generators, +17 more. Returns: object

robot_reduceA

Remove redundant subClassOf axioms using a reasoner.

After reasoning, some asserted subclass relationships become redundant because they can be inferred through other paths. This command strips those redundancies to keep the ontology minimal.

Inputs: input, output, reasoner, preserve_annotated_axioms, +10 more. Returns: object

robot_relaxA

Relax equivalence axioms into weaker subclass axioms.

Converts EquivalentClasses axioms to SubClassOf axioms, making the ontology less restrictive while preserving the subclass hierarchy. Commonly used before reduce in pipelines like reason → relax → reduce.

Inputs: input, output, exclude_named_classes, include_subclass_of, +10 more. Returns: object

robot_removeA

Remove selected axioms from an ontology (inverse of filter).

Specify terms whose axioms should be removed via term or term_file. Use select to control which related terms are included in the removal set (e.g. "self descendants").

Inputs: input, output, term, term_file, +17 more. Returns: object

robot_renameB

Rename entity IRIs via full replacement or prefix-based renaming.

Use mapping for individual IRI replacements (e.g. "obo:BFO_0000051 ex:partOf"). Use mappings to point to a TSV file of old→new mappings. Use prefix_mappings for bulk prefix replacement.

Inputs: input, output, mapping, mappings, +12 more. Returns: object

robot_repairB

Fix common ontology problems.

Repairs include: updating references to deprecated classes (replacing them with their replacements), merging duplicate axiom annotations, and fixing invalid references.

Inputs: input, output, invalid_references, annotation_property, +10 more. Returns: object

robot_reportA

Run quality control SPARQL checks and generate a violation report.

Executes a set of QC queries (default or custom profile) and reports violations at three severity levels: ERROR, WARN, INFO. Use fail_on to set the threshold (e.g. "ERROR" or "WARN").

Inputs: input, output, fail_on, labels, +14 more. Returns: object

robot_templateA

Convert tabular data (CSV/TSV) into OWL ontology format.

The template file has: row 1 = headers, row 2 = template strings (e.g. ID, LABEL, SC % for subclass), rows 3+ = data. Use merge_before or merge_after to control how template output combines with the input ontology.

Inputs: input, output, template, prefix, +14 more. Returns: object

robot_unmergeA

Remove axioms from the first ontology that appear in subsequent ontologies.

Provide multiple input files: the first is the base ontology, and axioms from the remaining inputs are subtracted from it.

Inputs: input, output, working_directory, catalog, +7 more. Returns: object

robot_validate_profileA

Check ontology conformance to an OWL 2 profile.

Profiles: EL, RL, QL, DL, Full. The output contains any violations found. ROBOT exits with non-zero code if the ontology does not conform to the specified profile.

Inputs: input, output, profile, working_directory, +8 more. Returns: object

robot_verifyB

Check an ontology for rule violations using SPARQL SELECT queries.

Each query file should contain a SPARQL SELECT. If the query returns any results, those are violations. ROBOT exits with a non-zero code when violations are found (controllable via fail_on_violation).

Inputs: input, queries, output_dir, fail_on_violation, +9 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 26 tools

    Disambiguation5/5

    Each tool corresponds to a distinct ROBOT command with a clearly defined function. Despite some similarities (e.g., filter/remove, report/verify), descriptions provide enough detail to differentiate them. No two tools have overlapping primary purposes.

    Naming Consistency5/5

    All tools follow a consistent 'robot_<verb>' pattern in lowercase snake_case. The naming is predictable and uniform throughout the entire set.

    Tool Count4/5

    With 26 tools, the server covers a comprehensive set of ontology operations. While on the higher side, each tool serves a necessary function for the domain, and the count is justified by the complexity of ontology management.

    Completeness4/5

    The tool surface covers most major ROBOT commands including creation, conversion, reasoning, querying, and validation. Minor gaps exist (e.g., no explicit 'create' tool, but template covers it), but overall the set enables full ontology lifecycle management.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers