@topolo/mcp 0.10.1 → 0.10.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/dispatch.js CHANGED
@@ -82,6 +82,17 @@ function optionalResourceContext(args) {
82
82
  }
83
83
  return { resourceType, resourceId };
84
84
  }
85
+ function summarizeActionCapabilities(service, actions) {
86
+ return {
87
+ service,
88
+ total: actions.length,
89
+ readOnly: actions.filter((action) => action.readOnly).length,
90
+ mutating: actions.filter((action) => !action.readOnly).length,
91
+ destructive: actions.filter((action) => action.destructive).length,
92
+ confirmationRequired: actions.filter((action) => action.requiresConfirmation).length,
93
+ resourceTypes: [...new Set(actions.map((action) => action.agentContract?.resource?.kind).filter(Boolean))].sort()
94
+ };
95
+ }
85
96
  function coerceObjectParam(value, name) {
86
97
  let candidate = value;
87
98
  if (typeof candidate === "string" && candidate.trim().startsWith("{")) {
@@ -423,13 +434,14 @@ var TOOLS = [
423
434
  {
424
435
  name: "topolo_discover_capabilities",
425
436
  title: "Discover one Topolo application capability contract",
426
- description: "Lists every action published by one application \u2014 its full capability contract, straight from the registry-canonical catalog. Use the actionService value returned by topolo_search_applications as service. Follow page.nextCursor via topolo_search_actions when the contract exceeds one page.",
437
+ description: "Lists every action published by one application \u2014 its full capability contract, straight from the registry-canonical catalog. Use the actionService value returned by topolo_search_applications as service.",
427
438
  requiredScopes: [],
428
439
  destructive: false,
429
440
  inputSchema: {
430
441
  type: "object",
431
442
  properties: {
432
443
  service: { type: "string", minLength: 1 },
444
+ summary: { type: "boolean", description: "Return compact counts without action rows." },
433
445
  detail: { type: "boolean", description: "Return full schemas and agent contracts. Defaults to compact capability guidance." }
434
446
  },
435
447
  required: ["service"],
@@ -438,8 +450,26 @@ var TOOLS = [
438
450
  handler: async (topolo, args) => {
439
451
  const service = typeof args["service"] === "string" ? args["service"].trim() : "";
440
452
  if (!service) throw new TopoloMcpPublicError("service is required.");
441
- const result = await topolo.client.searchActions({ service, limit: 100 });
442
- return args["detail"] === true ? result : { actions: result.actions.map(compactActionCatalogEntry), page: result.page };
453
+ if (args["summary"] === true && args["detail"] === true) {
454
+ throw new TopoloMcpPublicError("summary cannot be combined with detail.");
455
+ }
456
+ const actions = [];
457
+ const seenCursors = /* @__PURE__ */ new Set();
458
+ let cursor;
459
+ for (; ; ) {
460
+ const page = await topolo.client.searchActions({ service, limit: 100, ...cursor ? { cursor } : {} });
461
+ actions.push(...page.actions);
462
+ if (!page.page.hasMore) break;
463
+ const nextCursor = page.page.nextCursor?.trim();
464
+ if (!nextCursor || seenCursors.has(nextCursor)) {
465
+ throw new TopoloMcpPublicError("Capability discovery returned an invalid continuation cursor.");
466
+ }
467
+ seenCursors.add(nextCursor);
468
+ cursor = nextCursor;
469
+ }
470
+ if (args["summary"] === true) return summarizeActionCapabilities(service, actions);
471
+ const result = { actions, page: { nextCursor: null, hasMore: false } };
472
+ return args["detail"] === true ? result : { actions: actions.map(compactActionCatalogEntry), page: result.page };
443
473
  }
444
474
  },
445
475
  {
package/dist/http.js CHANGED
@@ -15916,6 +15916,17 @@ function optionalResourceContext(args) {
15916
15916
  }
15917
15917
  return { resourceType, resourceId };
15918
15918
  }
15919
+ function summarizeActionCapabilities(service, actions) {
15920
+ return {
15921
+ service,
15922
+ total: actions.length,
15923
+ readOnly: actions.filter((action) => action.readOnly).length,
15924
+ mutating: actions.filter((action) => !action.readOnly).length,
15925
+ destructive: actions.filter((action) => action.destructive).length,
15926
+ confirmationRequired: actions.filter((action) => action.requiresConfirmation).length,
15927
+ resourceTypes: [...new Set(actions.map((action) => action.agentContract?.resource?.kind).filter(Boolean))].sort()
15928
+ };
15929
+ }
15919
15930
  function coerceObjectParam(value, name) {
15920
15931
  let candidate = value;
15921
15932
  if (typeof candidate === "string" && candidate.trim().startsWith("{")) {
@@ -16257,13 +16268,14 @@ var TOOLS = [
16257
16268
  {
16258
16269
  name: "topolo_discover_capabilities",
16259
16270
  title: "Discover one Topolo application capability contract",
16260
- description: "Lists every action published by one application \u2014 its full capability contract, straight from the registry-canonical catalog. Use the actionService value returned by topolo_search_applications as service. Follow page.nextCursor via topolo_search_actions when the contract exceeds one page.",
16271
+ description: "Lists every action published by one application \u2014 its full capability contract, straight from the registry-canonical catalog. Use the actionService value returned by topolo_search_applications as service.",
16261
16272
  requiredScopes: [],
16262
16273
  destructive: false,
16263
16274
  inputSchema: {
16264
16275
  type: "object",
16265
16276
  properties: {
16266
16277
  service: { type: "string", minLength: 1 },
16278
+ summary: { type: "boolean", description: "Return compact counts without action rows." },
16267
16279
  detail: { type: "boolean", description: "Return full schemas and agent contracts. Defaults to compact capability guidance." }
16268
16280
  },
16269
16281
  required: ["service"],
@@ -16272,8 +16284,26 @@ var TOOLS = [
16272
16284
  handler: async (topolo, args) => {
16273
16285
  const service = typeof args["service"] === "string" ? args["service"].trim() : "";
16274
16286
  if (!service) throw new TopoloMcpPublicError("service is required.");
16275
- const result = await topolo.client.searchActions({ service, limit: 100 });
16276
- return args["detail"] === true ? result : { actions: result.actions.map(compactActionCatalogEntry), page: result.page };
16287
+ if (args["summary"] === true && args["detail"] === true) {
16288
+ throw new TopoloMcpPublicError("summary cannot be combined with detail.");
16289
+ }
16290
+ const actions = [];
16291
+ const seenCursors = /* @__PURE__ */ new Set();
16292
+ let cursor;
16293
+ for (; ; ) {
16294
+ const page = await topolo.client.searchActions({ service, limit: 100, ...cursor ? { cursor } : {} });
16295
+ actions.push(...page.actions);
16296
+ if (!page.page.hasMore) break;
16297
+ const nextCursor = page.page.nextCursor?.trim();
16298
+ if (!nextCursor || seenCursors.has(nextCursor)) {
16299
+ throw new TopoloMcpPublicError("Capability discovery returned an invalid continuation cursor.");
16300
+ }
16301
+ seenCursors.add(nextCursor);
16302
+ cursor = nextCursor;
16303
+ }
16304
+ if (args["summary"] === true) return summarizeActionCapabilities(service, actions);
16305
+ const result = { actions, page: { nextCursor: null, hasMore: false } };
16306
+ return args["detail"] === true ? result : { actions: actions.map(compactActionCatalogEntry), page: result.page };
16277
16307
  }
16278
16308
  },
16279
16309
  {
package/dist/index.js CHANGED
@@ -4525,6 +4525,17 @@ function optionalResourceContext(args) {
4525
4525
  }
4526
4526
  return { resourceType, resourceId };
4527
4527
  }
4528
+ function summarizeActionCapabilities(service, actions) {
4529
+ return {
4530
+ service,
4531
+ total: actions.length,
4532
+ readOnly: actions.filter((action) => action.readOnly).length,
4533
+ mutating: actions.filter((action) => !action.readOnly).length,
4534
+ destructive: actions.filter((action) => action.destructive).length,
4535
+ confirmationRequired: actions.filter((action) => action.requiresConfirmation).length,
4536
+ resourceTypes: [...new Set(actions.map((action) => action.agentContract?.resource?.kind).filter(Boolean))].sort()
4537
+ };
4538
+ }
4528
4539
  function coerceObjectParam(value, name) {
4529
4540
  let candidate = value;
4530
4541
  if (typeof candidate === "string" && candidate.trim().startsWith("{")) {
@@ -4866,13 +4877,14 @@ var TOOLS = [
4866
4877
  {
4867
4878
  name: "topolo_discover_capabilities",
4868
4879
  title: "Discover one Topolo application capability contract",
4869
- description: "Lists every action published by one application \u2014 its full capability contract, straight from the registry-canonical catalog. Use the actionService value returned by topolo_search_applications as service. Follow page.nextCursor via topolo_search_actions when the contract exceeds one page.",
4880
+ description: "Lists every action published by one application \u2014 its full capability contract, straight from the registry-canonical catalog. Use the actionService value returned by topolo_search_applications as service.",
4870
4881
  requiredScopes: [],
4871
4882
  destructive: false,
4872
4883
  inputSchema: {
4873
4884
  type: "object",
4874
4885
  properties: {
4875
4886
  service: { type: "string", minLength: 1 },
4887
+ summary: { type: "boolean", description: "Return compact counts without action rows." },
4876
4888
  detail: { type: "boolean", description: "Return full schemas and agent contracts. Defaults to compact capability guidance." }
4877
4889
  },
4878
4890
  required: ["service"],
@@ -4881,8 +4893,26 @@ var TOOLS = [
4881
4893
  handler: async (topolo, args) => {
4882
4894
  const service = typeof args["service"] === "string" ? args["service"].trim() : "";
4883
4895
  if (!service) throw new TopoloMcpPublicError("service is required.");
4884
- const result = await topolo.client.searchActions({ service, limit: 100 });
4885
- return args["detail"] === true ? result : { actions: result.actions.map(compactActionCatalogEntry), page: result.page };
4896
+ if (args["summary"] === true && args["detail"] === true) {
4897
+ throw new TopoloMcpPublicError("summary cannot be combined with detail.");
4898
+ }
4899
+ const actions = [];
4900
+ const seenCursors = /* @__PURE__ */ new Set();
4901
+ let cursor;
4902
+ for (; ; ) {
4903
+ const page = await topolo.client.searchActions({ service, limit: 100, ...cursor ? { cursor } : {} });
4904
+ actions.push(...page.actions);
4905
+ if (!page.page.hasMore) break;
4906
+ const nextCursor = page.page.nextCursor?.trim();
4907
+ if (!nextCursor || seenCursors.has(nextCursor)) {
4908
+ throw new TopoloMcpPublicError("Capability discovery returned an invalid continuation cursor.");
4909
+ }
4910
+ seenCursors.add(nextCursor);
4911
+ cursor = nextCursor;
4912
+ }
4913
+ if (args["summary"] === true) return summarizeActionCapabilities(service, actions);
4914
+ const result = { actions, page: { nextCursor: null, hasMore: false } };
4915
+ return args["detail"] === true ? result : { actions: actions.map(compactActionCatalogEntry), page: result.page };
4886
4916
  }
4887
4917
  },
4888
4918
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topolo/mcp",
3
- "version": "0.10.1",
4
- "topoloPublishedVersion": "0.10.1",
3
+ "version": "0.10.2",
4
+ "topoloPublishedVersion": "0.10.2",
5
5
  "description": "Model Context Protocol server for the Topolo platform. Exposes scope-gated tools that third-party agents (Claude, Codex, etc.) can call natively.",
6
6
  "type": "module",
7
7
  "bin": {