@topolo/mcp 0.11.1 → 0.11.3
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 +12 -5
- package/dist/http.js +232 -672
- package/dist/index.js +111 -9
- package/package.json +5 -5
package/dist/dispatch.js
CHANGED
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
// src/tools.ts
|
|
11
11
|
import {
|
|
12
12
|
compactActionCatalogEntry,
|
|
13
|
+
compactActionResult,
|
|
13
14
|
compactActionPreparation,
|
|
14
15
|
compactActionPlan,
|
|
15
16
|
compactActionValidation,
|
|
17
|
+
preferExactActionMatches,
|
|
16
18
|
friendlyAppId,
|
|
17
19
|
resolveCatalogServiceUrl
|
|
18
20
|
} from "@topolo/sdk";
|
|
@@ -174,7 +176,8 @@ var TOOLS = [
|
|
|
174
176
|
},
|
|
175
177
|
query: { type: "string" },
|
|
176
178
|
cursor: { type: "string" },
|
|
177
|
-
limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }
|
|
179
|
+
limit: { type: "integer", minimum: 1, maximum: 100, default: 25 },
|
|
180
|
+
detail: { type: "boolean", description: "Return full schemas and agent contracts. Defaults to compact action guidance." }
|
|
178
181
|
},
|
|
179
182
|
required: ["service"],
|
|
180
183
|
additionalProperties: false
|
|
@@ -182,13 +185,15 @@ var TOOLS = [
|
|
|
182
185
|
handler: async (topolo, args) => {
|
|
183
186
|
const service = typeof args["service"] === "string" ? args["service"].trim() : "";
|
|
184
187
|
if (!service) throw new TopoloMcpPublicError("service is required for bounded action discovery.");
|
|
188
|
+
const query = typeof args["query"] === "string" ? args["query"] : void 0;
|
|
185
189
|
const result = await topolo.client.searchActions({
|
|
186
190
|
service,
|
|
187
|
-
query
|
|
191
|
+
query,
|
|
188
192
|
cursor: typeof args["cursor"] === "string" ? args["cursor"] : void 0,
|
|
189
193
|
limit: typeof args["limit"] === "number" ? args["limit"] : void 0
|
|
190
194
|
});
|
|
191
|
-
|
|
195
|
+
const actions = preferExactActionMatches(result.actions, query);
|
|
196
|
+
return args["detail"] === true ? { ...result, actions } : { actions: actions.map(compactActionCatalogEntry), page: result.page };
|
|
192
197
|
}
|
|
193
198
|
},
|
|
194
199
|
{
|
|
@@ -276,7 +281,8 @@ var TOOLS = [
|
|
|
276
281
|
input: { type: "object", additionalProperties: true },
|
|
277
282
|
resourceType: { type: "string", description: "Optional resource-scoping alias published in the app resource catalog (e.g. workspace, brand, merchant)." },
|
|
278
283
|
resourceId: { type: "string", description: "Resource id. Required when resourceType is provided." },
|
|
279
|
-
confirm: { type: "boolean" }
|
|
284
|
+
confirm: { type: "boolean" },
|
|
285
|
+
detail: { type: "boolean", description: "Return the complete action response. Defaults to a bounded agent projection." }
|
|
280
286
|
},
|
|
281
287
|
required: ["actionId"],
|
|
282
288
|
additionalProperties: false
|
|
@@ -286,7 +292,7 @@ var TOOLS = [
|
|
|
286
292
|
if (!actionId) throw new TopoloMcpPublicError("actionId is required.");
|
|
287
293
|
const input = coerceObjectParam(args["input"], "input");
|
|
288
294
|
const resource = optionalResourceContext(args);
|
|
289
|
-
|
|
295
|
+
const result = await topolo.client.callAction(
|
|
290
296
|
actionId,
|
|
291
297
|
input,
|
|
292
298
|
{
|
|
@@ -294,6 +300,7 @@ var TOOLS = [
|
|
|
294
300
|
...resource ? { resource } : {}
|
|
295
301
|
}
|
|
296
302
|
);
|
|
303
|
+
return args["detail"] === true ? result : compactActionResult(actionId, result);
|
|
297
304
|
}
|
|
298
305
|
},
|
|
299
306
|
{
|