Prompts
MCP prompts are reusable, guided ontology workflows you pick in your MCP client (Claude Code, Codex, Antigravity, OpenCode, VS Code, Claude Desktop). Each one expands to a single user message that tells the model which Protégé MCP tools to call and in what safe order — orient with context first, preview destructive edits, confirm before writing, and verify with the reasoner. Prompts are pure templates: they carry no model access and cause no side effects; all real work happens through the tools they instruct.
Table of contents
audit_ontologyexplain_classadd_subclass_safelyfind_and_fix_unsatisfiableauthor_sparql_querymodel_domainauthor_competency_questionauthor_swrl_rulerefactor_entity_safelybootstrap_ontologyrelease_readiness_check
audit_ontology
Audits the ontology currently open in Protégé for modelling-quality, governance, and logical problems and proposes fixes, without changing anything until you approve. Reach for it when you want a full health check of the active ontology before doing further work.
Arguments
None.
Workflow
- Call
get_ontology_contextto orient (size, roots, reasoner state). - Call
get_project_policy; when loaded, runrun_project_qcand treatgate=erroras an incomplete audit, never a pass/fail policy verdict. With no policy, run the legacyvalidate_ontology+validate_governanceaudit and say that it is not a reproducible project gate. - If project QC did not already run a current reasoner stage, call
run_reasonerfor logical problems. If it reports the ontology INCONSISTENT, callexplain_inconsistencyto find the contradicting axioms; otherwise callget_unsatisfiable_classes. - For the most important findings, call
get_entity_contexton the offending terms to understand them before suggesting changes. - Summarise the issues by severity and propose concrete fixes with
preview_change_set. After approval, pass its exact id/revision tocommit_change_set; a revision conflict is reported rather than merged.preview_changesthenapply_changeswithverify=rollbackremains the older-server fallback.
explain_class
Explains a single class in plain language — its definition, its neighbourhood in the hierarchy, and what the reasoner infers about it beyond the asserted axioms. Reach for it to understand an unfamiliar or imported term before working with it.
Arguments
| Name | Required | Description |
|---|---|---|
class |
yes | Class IRI or display name. |
Workflow
- Call
get_entity_contextwithentityset to the class for its labels, annotations, asserted parents/children/equivalents and disjoints. - Call
get_axioms_for_entityfor the exact axioms (include_imports=trueif it is an imported term). - Call
run_reasoner, thenget_inferred_superclasseswithentityset to the class, to see what is inferred beyond what is asserted. - Summarise what the class means, where it sits in the hierarchy, its key restrictions, and anything surprising the reasoner derived.
add_subclass_safely
Adds a subclass relationship safely: it confirms both terms exist (to avoid minting a new entity from a typo), previews the change with an isolated gate that — when a reasoner is selected — refuses to commit an edit that breaks satisfiability, then commits the reviewed preview (on servers without change sets it falls back to apply with automatic verify=rollback; with no reasoner available the edit is labelled UNVERIFIED). Reach for it when you want to assert child SubClassOf parent with full guardrails.
Arguments
| Name | Required | Description |
|---|---|---|
child |
yes | Subclass — IRI, name, or Manchester class expression. |
parent |
yes | Superclass — IRI, name, or Manchester class expression. |
Workflow
- Confirm both terms with
get_entity(orsearch_entitiesif a name is ambiguous) — resolve to exact IRIs and avoid creating an unintended new entity from a typo. - Call
preview_change_setwith{op:add, axiom_type:subclass_of, sub:child, super:parent}and show its normalized delta, complete base revision, and isolated preflight gate. - After approval, call
commit_change_setwith the exact id/revision. Report its Undo/new-revision result or a conflict; never rebuild a stale preview automatically. - If
satisfiability_checked=false, inspectpolicy_loadedand the preflight reasoner row before retrying. With no policy, or when policy requires a reasoner but reports none/wrong selection, uselist_reasoners/set_reasonerand create a fresh preview; fix a reported reasoner error first. If a loaded policy intentionally omits the reasoner stage, selecting a reasoner alone will not add it: disclose that satisfiability was not checked and ask whether to update/include the policy stage or explicitly approve committing the reviewed change set as UNVERIFIED. Use the same explicit approval when no reasoner is available. Only on a server without change-set tools fall back topreview_changesthenapply_changes verify=rollback.
find_and_fix_unsatisfiable
Finds unsatisfiable classes, explains why each one is unsatisfiable using minimal justifications, and proposes the smallest set of changes to restore satisfiability — including the wholly-inconsistent case, where it switches to explain_inconsistency. Reach for it to debug logical contradictions in the active ontology.
Arguments
None.
Workflow
- Call
run_reasoner, thenget_unsatisfiable_classes. If the ontology is wholly INCONSISTENT the per-class tools refuse to run — callexplain_inconsistencyinstead for a set of contradicting axioms (itsminimalflag reports whether the set was fully minimised;undo_changewithpeek=trueshows whether the last edit is the likely culprit). - For each unsatisfiable class C, call
get_explanations(axiom_type=subclass_of,sub=C,super="owl:Nothing") to get the minimal justifications. - For terms in the justifications, call
get_entity_contextto understand them. - Propose the smallest set of axiom removals/changes that restores satisfiability; use
preview_changes(op:remove) to show exactly what would be removed, and only after you approve apply the batch withapply_changes(the same operations array — one undoable transaction) withverify=report, which re-classifies and flags anything the fix makes newly unsatisfiable or inconsistent.get_unsatisfiable_classesconfirms the classes are fixed; a singleundo_changereverts the whole batch if not.
author_sparql_query
Authors a SPARQL query that answers a plain-language question: it discovers the available vocabulary, drafts a query using only real terms, validates it, and runs it — refining until the results are right. Reach for it to query the active ontology without hand-writing prefixes or guessing CURIEs.
Arguments
| Name | Required | Description |
|---|---|---|
question |
yes | The question to answer in plain words. |
Workflow
- Call
sparql_schema(passkeyword=a key term from the question to focus it) to get the prefixes and the exact classes, properties (with their domains/ranges) and individuals to use — note the CURIEs and example queries. - Draft a SELECT/ASK/CONSTRUCT/DESCRIBE query using ONLY those CURIEs/IRIs (do not invent term names); the ontology’s prefixes are auto-prepended, so CURIEs work without PREFIX lines.
- Call
sparql_validateon the draft; fix anything inunknown_terms(a typo or wrong vocabulary) and anyparse_erroruntilexecutable=true, and setdry_run=trueto also run it with a small LIMIT and sanity-check sample results. - Run it with
sparql_query; if you need triples the reasoner derives (e.g. inferred types or subclasses), setinclude_inferred=true(runrun_reasonerfirst). Refine the pattern and repeat if results are empty or too broad. - Summarise the answer and show the final query used.
model_domain
Models a described domain incrementally: it proposes a small set of terms that fit what already exists, shows the exact batches before applying, applies them atomically with verification, and gates the result with the QC suite. Reach for it to grow the active ontology in small, reviewable batches from a plain-language description.
Arguments
| Name | Required | Description |
|---|---|---|
description |
yes | What to model (the domain in plain words). |
Workflow
- Call
get_ontology_contextto see what already exists (reuse terms, match the naming and IRI style, don’t duplicate). - Propose a small set of classes, properties (with domains/ranges) and any individuals, explaining the modelling choices.
- Preview classes with
create_terms preview=true, properties withcreate_properties preview=true, and remaining axioms withpreview_change_set; show each complete base revision and preflight gate. - After approval, commit each reviewed preview with
commit_change_set, refreshing later previews after every commit. Older servers fall back topreview_changes/direct batches/apply_changes, followed byrun_project_qcor no-policyrun_qc_suite.
author_competency_question
Turns a plain-language requirement into a stored, executable competency question: it discovers the vocabulary, drafts and validates the query, stores it following the project’s existing convention, and runs it once to confirm. Reach for it to grow the CQ regression suite one requirement at a time.
Arguments
| Name | Required | Description |
|---|---|---|
question |
yes | The requirement/competency question in plain words. |
expected |
no | Pass condition: nonEmpty (default) | empty | count OP N. |
Workflow
- Call
list_competency_questionsto see the existing CQ ids and which storage convention the project already uses — and follow it (ontology-annotations is the fallback when the ontology is unsaved; robot-sparql-dir writes*.rqfiles for ROBOT/CI interop). - Call
sparql_schema(keyword=a key term from the question) to get the exact classes/properties and CURIEs; use only those. - Draft a SELECT or ASK query that answers the question, and choose the pass condition — the one under which a silent regression would FAIL the suite.
- Call
sparql_validateon the draft; fix anything inunknown_termsand anyparse_erroruntilexecutable=true. - Show the query, the expected condition and the target store; after you approve, call
add_competency_questionwith the query,text=the requirement and the expected condition (omitconventionto follow the existing store; noteinclude_inferreddefaults to true — setinclude_inferred=falseunless the check should also hold over reasoner-derived triples). - Call
run_competency_questionswithids=[the new id]to confirm it passes now (aninclude_inferredCQ needs a classified reasoner —run_reasonerfirst). If it fails, either refine the query or report the real ontology gap it exposed.
author_swrl_rule
Authors a SWRL rule from a plain-language description, with the two reasoner-compatibility footguns checked up front: ELK silently ignores SWRL rules, and swrlb: built-in atoms make some DL reasoners fail classification. Reach for it to add a rule that actually fires instead of a silent no-op.
Arguments
| Name | Required | Description |
|---|---|---|
rule |
yes | The rule to express, in plain words (if X then Y). |
Workflow
- Resolve every class, property and individual the rule mentions with
search_entities/get_entityand collect their exact IRIs — used as the atoms’predicatevalues so a typo cannot mint a new entity. - Call
list_rulesto match the existing rules’ style and avoid duplicating one. - Build the structured body/head atoms for
add_rule(atom types:class {predicate, arg1},object_property {predicate, arg1, arg2},data_property {predicate, arg1, arg2|value},same_as/different_from {arg1, arg2},builtin {builtin, args[]}; an argument starting with?is a variable), show them with a readable body → head rendering, and include anrdfs:labelviaannotations. - Check reasoner compatibility BEFORE applying (
list_reasoners): ELK silently ignores SWRL rules (run_reasonerattaches a warning), andswrlb:built-in atoms make some DL reasoners (e.g. HermiT) fail classification — surfaced as an error. If the current reasoner cannot honour the rule, aset_reasonerswitch is proposed for your approval. - After you approve the rule and the reasoner choice, call
add_rulewith the body/head (and annotations). - Verify the rule fires:
run_reasoner(heed any warning/error), then confirm one expected inference withget_inferred_superclassesorsparql_querywithinclude_inferred=true; if nothing is inferred, the reason is explained instead of reporting success.
refactor_entity_safely
Renames, deprecates, deletes or moves a term the safe way: blast radius first, the right tool for the intent (rename rewrites references, deprecate keeps them, delete removes them, move reparents), dry-run previews, your confirmation, then verification. Reach for it before any high-blast-radius change to a term.
Arguments
| Name | Required | Description |
|---|---|---|
entity |
yes | The term to refactor: IRI or display name. |
goal |
yes | What to achieve: rename | deprecate | delete | move (plain words are fine). |
Workflow
- Call
get_entity_contextandget_axioms_for_entityto establish the blast radius (how much references the term). - Pick the right tool and confirm the semantics first:
rename_entityrewrites every reference (ifnew_irialready exists in the signature the two entities MERGE);deprecate_entitykeeps the term and its axioms, addsowl:deprecatedplus an optionalreplaced_bypointer;delete_entityremoves its declaration and every referencing axiom;move_classreplaces its asserted named parents (unlesskeep_other_parents=true) and the subtree follows. - Prefer
preview_change_set/commit_change_setfor exact axiom add/remove portions. For high-level macros,rename_entityanddelete_entitytakepreview=true; review their blast radius. Show exact arguments formove_classanddeprecate_entity, which do not yet emit change sets. - Apply only after you approve; each operation is a single undo transaction, and
undo_changewithpeek=trueshows what an undo would revert. - Verify with
run_reasonerandget_unsatisfiable_classes(plusvalidate_ontologyfor a broad change), and report exactly what changed.
bootstrap_ontology
Starts a new ontology module correctly: creates it bound to a file, sets prefixes and metadata, adds imports that actually resolve, saves, and writes the catalog so the module re-opens offline. Reach for it to begin a new module without the classic dangling-import and missing-catalog mistakes.
Arguments
| Name | Required | Description |
|---|---|---|
ontology_iri |
yes | IRI of the new ontology. |
path |
no | File path to bind the ontology to (optional but recommended). |
Workflow
- Confirm the plan first: ontology IRI (+ version IRI?), the term namespace, the file location, and which upstream ontologies to import.
- Call
create_ontologywith theontology_iri(andpath— binding a path now means an argument-lesssave_ontologyworks andwrite_cataloghas a folder). It becomes the active edit target; note it is not undoable. - Call
set_prefixfor the term namespace (and each upstream namespace) so CURIEs render/parse and the saved file is readable. - Add metadata with
add_ontology_annotation(e.g.dcterms:title,rdfs:comment,owl:versionInfo). - For each upstream ontology call
add_importwith its IRI, passingdocument(a path/URL) so the import resolves now — then check the result’sresolvedflag: an unresolved import’s terms stay invisible to lookups and reasoning until its document is loaded. - Call
save_ontology(passingpathhere if the ontology is still untitled — an argument-less save has nowhere to write), thenwrite_catalogso the local imports re-open offline in Protégé. - Verify with
get_ontology_context(imports resolved, prefixes right), and once the first terms exist runvalidate_governancewithrequired_namespaces=[the term namespace]to catch IRIs minted outside it.
release_readiness_check
Runs the full quality gate over the active ontology — reasoner, OWL 2 profile, structural checks, competency questions, governance policy, and a diff against the last saved document — and only saves the artifacts after your approval. Reach for it before shipping a version.
Arguments
| Name | Required | Description |
|---|---|---|
profile |
no | OWL 2 profile the project must stay in: DL (default), EL, QL or RL. |
namespace |
no | The project’s required term namespace, for the governance IRI policy. |
Workflow
- Call
get_ontology_context, andlist_ontologiesto see which loaded ontologies have unsaved changes. - Call
get_project_policy; if loaded, callrun_project_qc. Any required stage that skips/errors, uses the wrong reasoner, or lacks an asset makesgate=errorand the verdict DO NOT SHIP. - Only when no policy exists, call
run_reasoner, thenrun_qc_suitewithstages=["reasoner","profile","governance","structural","cqs"], the project’sowl_profile, the samerequired_stages, anderror_on_missing_required=true; do not waive missing backing data as a benign skip. - In that no-policy fallback, call
validate_governancewith the project’sowl_profile,required_annotations=["label","definition"]and (when known)required_namespaces— policy violations are reported per check. - If the active ontology has a saved document, call
diff_ontologieswithright_document=that file to summarise exactly what changed since the last save. - Summarise every gate and finding by severity with a clear ship / do-not-ship verdict. Nothing is saved until you approve; after approval,
save_ontology(all=trueif several ontologies are dirty) and — when there are locally-loaded imports —write_catalogso the module re-opens offline.