You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tools/group-k.ts
+88-11Lines changed: 88 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -150,10 +150,14 @@ server.registerTool(
150
150
title: "Inspect Concept in Local / Uploaded Ontology",
151
151
description: `Get a full profile of a class or concept from a local or uploaded ontology.
152
152
153
-
**Args (provide exactly one of file_path or upload_id):**
153
+
**CRITICAL — file access workflow:**
154
+
1. Try \`file_path\` first (works only if the file is readable by the MCP server process).
155
+
2. If file_path fails for any reason → call \`get_upload_instructions\` with the local path, execute the returned curl command via Bash tool, parse the \`id\` from the JSON response, then call this tool again with \`upload_id\`.
156
+
3. NEVER read the file content and pass it through the conversation. NEVER attempt to parse or analyse the TTL text manually. The upload workflow sends raw bytes directly from disk to server without the AI ever seeing the content — it is always faster, cheaper, and more reliable.
157
+
158
+
**Args:**
154
159
- uri: URI of the class/concept to inspect
155
-
- file_path: Absolute path on the MCP server filesystem
156
-
- upload_id: UUID returned by POST /upload (HTTP/remote mode)
160
+
- file_path / upload_id: exactly one (see workflow above)
**mode: "raw"** — only triples explicitly present in the local file:
@@ -175,8 +179,8 @@ server.registerTool(
175
179
**Unicode SPARQL note:** oxigraph rejects prefixed names with non-ASCII local parts (e.g. \`myont:modalità_cup\`). Always use full URIs in angle brackets (\`<https://...#modalità_cup>\`) for properties or classes with Unicode in the local name.`,
176
180
inputSchema: {
177
181
uri: z.string().describe("URI of the class or concept to inspect"),
178
-
file_path: z.string().optional().describe("Absolute path to the ontology file on the server filesystem"),
179
-
upload_id: z.string().optional().describe("Upload UUID returned by POST /upload (HTTP mode)"),
182
+
file_path: z.string().optional().describe("Absolute path readable by the MCP server process. If this fails, do NOT read the file — use get_upload_instructions + Bash curl + upload_id instead."),
183
+
upload_id: z.string().optional().describe("UUID from POST /upload. Preferred when the file is on the client machine or file_path failed."),
'"raw": only asserted triples (own_properties, no ancestor traversal). '+
182
186
'"effective" (default): adds inherited_properties via rdfs:subClassOf+/skos:broader+ and data-level incoming/outgoing.'
@@ -290,10 +294,10 @@ server.registerTool(
290
294
title: "Inspect Property in Local / Uploaded Ontology",
291
295
description: `Get the full semantic profile of a property from a local or uploaded ontology, resolving inherited domain and range via rdfs:subPropertyOf+.
292
296
293
-
**Args (provide exactly one of file_path or upload_id):**
294
-
- uri: URI of the property to inspect
295
-
- file_path: Absolute path on the MCP server filesystem
296
-
- upload_id: UUID returned by POST /upload (HTTP mode)
297
+
**CRITICAL — file access workflow:**
298
+
1. Try \`file_path\` first (works only if the file is readable by the MCP server process).
299
+
2. If file_path fails for any reason → call \`get_upload_instructions\` with the local path, execute the returned curl command via Bash tool, parse the \`id\` from the JSON response, then call this tool again with \`upload_id\`.
300
+
3. NEVER read the file content and pass it through the conversation. NEVER attempt to parse or analyse the TTL text manually. The upload workflow sends raw bytes directly from disk to server without the AI ever seeing the content — it is always faster, cheaper, and more reliable.
297
301
298
302
**Returns:**
299
303
- definition: direct attributes from the local store (type, label, comment, subPropertyOf, inverseOf, functional flags)
@@ -307,6 +311,11 @@ server.registerTool(
307
311
- inheritedRange: range values collected from super-properties, each annotated with ancestor URI and source
308
312
- effectiveDomain: deduplicated union of assertedDomain + inheritedDomain
309
313
- effectiveRange: deduplicated union of assertedRange + inheritedRange
314
+
- redundancy_analysis: diagnostic view of each asserted value:
315
+
- "redundant": identical to an inherited value — the axiom can be dropped without semantic loss
316
+
- "specialization": a rdfs:subClassOf of an inherited value — genuinely narrows the domain/range
317
+
- "new": not present in any inherited value — adds information not implied by the super-property chain
318
+
- summary counts per category for quick overview
310
319
- warnings: super-properties not resolved, remote lookup failures
311
320
312
321
**owl:imports handling:** The local store typically does NOT contain imported ontologies (owl:imports declarations are not followed automatically). Super-properties from external namespaces (e.g. l0:name, l0:description from OntoPiA) are resolved against schema.gov.it automatically, making the effective semantics complete without requiring the full import chain to be loaded.
@@ -316,8 +325,8 @@ server.registerTool(
316
325
**Unicode SPARQL note:** oxigraph rejects prefixed names with non-ASCII local parts. For properties with Unicode in the local name (e.g. \`myont:modalità_cup\`), always pass the full URI in angle brackets (\`<https://...#modalità_cup>\`).`,
317
326
inputSchema: {
318
327
uri: z.string().describe("URI of the property to inspect"),
319
-
file_path: z.string().optional().describe("Absolute path to the ontology file on the server filesystem"),
320
-
upload_id: z.string().optional().describe("Upload UUID returned by POST /upload (HTTP mode)"),
328
+
file_path: z.string().optional().describe("Absolute path readable by the MCP server process. If this fails, do NOT read the file — use get_upload_instructions + Bash curl + upload_id instead."),
329
+
upload_id: z.string().optional().describe("UUID from POST /upload. Preferred when the file is on the client machine or file_path failed."),
0 commit comments