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.
@@ -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
- return formatToolResult(await reviewApi.listDomains(parsed.projectRoot));
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
- return formatToolResult(await reconstructApi.listSourceProfiles(parsed.projectRoot));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onto-mcp",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "MCP-native ontology review runtime with context-isolated lenses and controlled deliberation",
5
5
  "homepage": "https://github.com/kangminlee-maker/onto-mcp#readme",
6
6
  "bugs": {