onto-mcp 0.4.1 → 0.4.2
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.
- package/dist/mcp/server.js +9 -2
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -507,6 +507,9 @@ function toReviewRequest(input) {
|
|
|
507
507
|
return request;
|
|
508
508
|
}
|
|
509
509
|
function formatToolResult(data) {
|
|
510
|
+
// Per MCP, `structuredContent` must be a JSON object. Callers that produce a
|
|
511
|
+
// top-level array (e.g. a list of domains/profiles) must wrap it in an object
|
|
512
|
+
// before calling this, or strict MCP clients reject the result.
|
|
510
513
|
const text = JSON.stringify(data, null, 2);
|
|
511
514
|
return {
|
|
512
515
|
content: [{ type: "text", text }],
|
|
@@ -963,11 +966,15 @@ async function callTool(name, args, options = {}) {
|
|
|
963
966
|
return formatToolResult(await reviewApi.listLenses());
|
|
964
967
|
case "onto.list_domains": {
|
|
965
968
|
const parsed = OntoListDomainsToolInputSchema.parse(args ?? {});
|
|
966
|
-
|
|
969
|
+
const domains = await reviewApi.listDomains(parsed.projectRoot);
|
|
970
|
+
// Wrap the array so structuredContent is a JSON object (MCP requirement).
|
|
971
|
+
return formatToolResult({ domains });
|
|
967
972
|
}
|
|
968
973
|
case "onto.list_source_profiles": {
|
|
969
974
|
const parsed = OntoListSourceProfilesToolInputSchema.parse(args ?? {});
|
|
970
|
-
|
|
975
|
+
const sourceProfiles = await reconstructApi.listSourceProfiles(parsed.projectRoot);
|
|
976
|
+
// Wrap the array so structuredContent is a JSON object (MCP requirement).
|
|
977
|
+
return formatToolResult({ sourceProfiles });
|
|
971
978
|
}
|
|
972
979
|
case "onto.observe_source": {
|
|
973
980
|
const parsed = OntoObserveSourceToolInputSchema.parse(args);
|
package/package.json
CHANGED