@ontology-kit/mcp 0.0.0-stage → 0.3.0-alpha.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: query-kb
3
+ description: Answer questions from an okb knowledge base that an okb-mcp server serves, using its describe_ontology, find, get, traverse and list_rules tools, and quote the rule and source behind each answer. Use it whenever the okb-mcp tools are connected and someone asks what a KB says, which things match, how things relate, or what must hold. Not for building or changing a KB.
4
+ ---
5
+
6
+ # Query a KB
7
+
8
+ **Version 0.2.0.** It matches the `@ontology-kit/mcp` version it ships with.
9
+
10
+ Answer questions from a knowledge base served by `okb-mcp`. The KB is the only source. Say what it says, show where it says it, and say plainly when it says nothing. The server only reads: nothing here changes the KB. To build or fix one, use the ontology skills that ship with okb.
11
+
12
+ ## 1. Pick the tool
13
+
14
+ 1. **`describe_ontology` first, once.** It lists what the KB covers, the class tree, the properties and relationships (with the exact names you will pass to other tools) and how many rules it holds. Keep it in mind; don't call it again.
15
+ 2. **`find`, then `get`.** `find` finds candidates: `query` for words, `class` for the members of a class (subclasses included), `where` for values a thing has (`"*"` for any value), `allows` for values a class permits, `type` to narrow to classes, instances, properties, rules or sources. Use it for "which" and "list every" questions. Then `get` the one or two best matches for the full picture. A query is not an answer.
16
+ 3. **`traverse` for links.** To follow one relationship from a starting point ("what is preferred over X", "what is built on Y"), name the relationship exactly as `describe_ontology` shows it. Add `direction: "in"` to read it backwards and `depth` (up to 3) to go further.
17
+ 4. **`list_rules` for what must hold.** Filter by `about` (a class or instance), `modality` or `query`. A class includes the rules of its parent classes.
18
+
19
+ Names are forgiving (`Segmented Control`, `segmentedcontrol` and an id all work), and a name that matches nothing comes back with similar names.
20
+
21
+ ## 2. Read what you get
22
+
23
+ - **Inverse relationships are one set of edges.** If `wrote` and `writtenBy` are inverses, "Ann wrote Tides" and "Tides is writtenBy Ann" are the same fact. Ask from whichever end you have, by either name, or with `direction: "in"`. Never conclude "no link" from one end alone.
24
+ - **Members inherit.** A class's fixed values and the rules that govern it apply to its subclasses and instances. A rule on `Overlay` covers `Modal`. When you answer for a member, check its parent classes with `get` or `list_rules`.
25
+ - **Filters mean different things.** `where` finds things that have a value. `allows` finds classes that permit one. A class that permits `size: large` has no `size` value until an instance sets one.
26
+ - **Read the modality.** MUST and MUST_NOT are requirements. SHOULD is a recommendation with exceptions. MAY is permission. Don't turn a SHOULD into "must", or the reverse.
27
+ - **Read the caveat.** A rule marked unverified, corrected, unsupported or overreach is weaker than one with no mark. Say so in your answer. Relationship links can carry a condition (`{condition: ...}`) and the rule behind them. Include the condition, because without it the answer overstates.
28
+
29
+ ## 3. Answer with evidence
30
+
31
+ For each claim, give the rule's statement, its modality, and where it came from. What you can show depends on how the server was started (`--quotes`), so look at what the results contain and don't assume:
32
+
33
+ | You see | Say |
34
+ | ----------------------------- | --------------------------------------------------------------------------------------------- |
35
+ | A quote and a location | Quote it, with the document, heading and line, such as “…” (Button › Accessibility, line 18). |
36
+ | Only `source: …` under a rule | The quote is the rule's own statement. Quote the statement and give that location. |
37
+ | A location and no quote | Give the rule's statement, and point to the document, heading and line. |
38
+ | Neither | Give the rule's statement and its modality, and say the source isn't shown to you. |
39
+
40
+ Quote only text the tools returned, and never write a quote from memory. If `read_source` is among the tools (the server was started with `--read-source`), use it to read the cited section when the quote or the context matters: give it the document and heading or lines from a result. If it isn't there, don't look for it.
41
+
42
+ ## 4. When the KB can't answer
43
+
44
+ - **Ambiguous name.** If a name matches several things (a class and a rule, say), `get` the likeliest, say which you chose, and mention the other.
45
+ - **Unknown name.** Read the suggestions the error gives, try one, and tell the person what you used. If nothing close exists, search with `find` and different words once or twice, not more.
46
+ - **No result.** Say "the KB doesn't cover this", name what you searched (tool, words, class) and, if useful, what it does cover nearby. Don't fill the gap from general knowledge. If you do add outside knowledge, label it as not from the KB.
47
+ - **No rule found** means the KB holds none, not that none exists. Say it that way. The server may also hold back unverified rules, so a missing rule is not proof that a source is silent.
48
+ - **Partial answer.** Give what the KB supports, and mark what it doesn't.