@axonity-ai/mcp 0.2.2 → 0.3.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/README.md CHANGED
@@ -70,6 +70,9 @@ Plus:
70
70
  edges) via mutation commands, sequenced and version-threaded for you.
71
71
  - `replace_workflow_document` for one-shot full-document replacement in a single
72
72
  atomic PUT.
73
+ - `read_workflow_trigger_parameters` — what input a workflow's triggers expect.
74
+ - `bulk_delete_workflows` — soft-delete several at once (each with its own
75
+ `expectedVersion`).
73
76
 
74
77
  ### Version history, rollback, and version-level delete
75
78
 
@@ -84,6 +87,7 @@ For the ten versioned entities (including `flow`):
84
87
  | `list_deleted_<entity>_versions` | Restore candidates for the row above. |
85
88
  | `restore_deleted_<entity>_version` | Undo the delete above. No version check. |
86
89
  | `read_<entity>_published` | The live snapshot, as opposed to the draft. |
90
+ | `name_<entity>_major_version` | Give a major version a name (label a release). |
87
91
 
88
92
  `{version}` (an int) and `{versionId}` (a UUID) are two different identifiers
89
93
  across these routes — the tool parameter names say which.
@@ -101,7 +105,24 @@ across these routes — the tool parameter names say which.
101
105
  - **Attach / detach memory**: `attach_skill_to_agent`,
102
106
  `attach_skill_to_workflow`, `attach_policy_to_agent`,
103
107
  `attach_reference_to_agent`, and a `detach_*_from_*` for each. Detaching
104
- removes the link only — the skill or policy itself is untouched.
108
+ removes the link only — the skill or policy itself is untouched. Read the
109
+ links back with `list_agent_skills`, `list_agent_policies`,
110
+ `list_agent_reference_docs`.
111
+ - **Prompt elements (placement)**: a `prompt_snippet` is a library item; it only
112
+ takes effect once placed into a flow step's prompt stack.
113
+ `read_workflow_prompt_stacks` / `read_flow_prompt_stacks` resolve a
114
+ workflow/flow to its steps and each step's `system`/`user` stacks (this is how
115
+ you find the `flowStepId`s). Then `attach_prompt_snippet_to_flow_step`
116
+ (`target` = `system`|`user`, with an order), `update_flow_step_prompt`,
117
+ `reorder_flow_step_prompts`, `detach_prompt_snippet_from_flow_step`, and
118
+ `list_flow_step_prompts` / `list_wildcard_prompts`.
119
+ - **Company** (the tenant's single company document — a singleton, no id):
120
+ `read_company`, `update_company` (whole-document save with `expectedVersion`),
121
+ `list_company_versions`, `read_company_version`, `restore_company_version`,
122
+ `name_company_major_version`, `read_company_published`, and
123
+ `request_publish_company` (takes no id — the
124
+ server resolves your tenant's one company; direct company publish is closed to
125
+ service tokens).
105
126
  - **Catalog & cloning**: `list_system_tools` (read-only catalog — enabling one
106
127
  for an agent is `update_agent` with the id added to `systemToolIds`),
107
128
  `clone_flow`, `clone_prompt_snippet`.
@@ -129,10 +150,12 @@ no restore, and a webhook token is shown **once** at create or rotate.
129
150
 
130
151
  ### Runs — evaluating what you built
131
152
 
132
- `list_runs`, `list_workflow_runs`, `read_run`, `read_run_trace`,
133
- `read_run_cost`, `read_runs_summary`, `archive_run` / `unarchive_run`,
134
- `bulk_archive_runs` / `bulk_delete_runs`. There is no findings endpoint —
135
- evaluation means reading a run's validator verdicts and its trace.
153
+ `start_workflow_run` (test a workflow you built — it runs the **published**
154
+ workflow and really executes), `cancel_run`, `delete_run`, `list_runs`,
155
+ `list_workflow_runs`, `read_run`, `read_run_trace`, `read_run_cost`,
156
+ `read_runs_summary`, `archive_run` / `unarchive_run`, `bulk_archive_runs` /
157
+ `bulk_delete_runs`. There is no findings endpoint — evaluation means reading a
158
+ run's validator verdicts and its trace.
136
159
 
137
160
  ### Approvals
138
161
 
@@ -176,6 +199,13 @@ These are enforced by the backend, not merely by convention:
176
199
  stale write (retry) or a live reference conflict (don't — see
177
200
  `axonity_conventions`); the connector tells them apart by `code`, never by
178
201
  matching the message text.
202
+ - **No tool crosses the authority boundary.** A test drives the whole registered
203
+ surface and fails the build if any tool targets a publish / approve / secret /
204
+ service-token / deploy route (`test/exclusions.test.ts`).
205
+ - **Guidance can't silently drift from the backend.** The field/enum facts the
206
+ connector states are pinned to a vendored snapshot of the backend OpenAPI
207
+ schema; `test/conformance.test.ts` fails if a route or documented enum
208
+ diverges (see `test/fixtures/README.md`).
179
209
 
180
210
  **One known exception, not enforced:** a framework-provided `flow` is meant to
181
211
  be read-only to a tenant, but the backend does not actually block
@@ -190,3 +220,31 @@ npm run typecheck
190
220
  npm test
191
221
  npm run build # emits dist/
192
222
  ```
223
+
224
+ ## Releasing
225
+
226
+ Publishing runs from a maintainer's machine, not from CI. npm restricts tokens
227
+ that bypass 2FA for direct publishing, so a stored `NPM_TOKEN` cannot ship this
228
+ package; `npm login` is the supported path.
229
+
230
+ Run `npm login` in a real terminal — it prints a URL and waits for you to finish
231
+ in the browser, so it needs a session that stays attached (an editor's 2-minute
232
+ command timeout will kill it mid-flow).
233
+
234
+ ```bash
235
+ npm login # browser flow; must complete in an attached terminal
236
+ npm whoami # confirm the account
237
+
238
+ git checkout main && git pull
239
+ npm version <x.y.z> -m "%s" # commits + tags, so the tag matches the tarball
240
+ git push origin main --follow-tags
241
+ npm publish # prepublishOnly builds dist/ fresh
242
+ npm view @axonity-ai/mcp version # confirm
243
+ ```
244
+
245
+ Then cut a GitHub release for the tag. That triggers `Verify release`, which
246
+ rebuilds and packs the tagged commit without publishing — it catches a tag that
247
+ was cut from a state CI cannot install.
248
+
249
+ Keep npm 11 locally: Node 20 bundles npm 10, whose resolver writes an
250
+ incompatible lockfile tree. CI pins npm 11 for the same reason.
package/dist/index.d.ts CHANGED
@@ -17,6 +17,15 @@
17
17
  */
18
18
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
19
19
  import { AxonityClient } from "./client.js";
20
+ /**
21
+ * Register the whole tool surface onto a server. Split out from `buildServer`
22
+ * so a test can drive the real registration against a recording server — e.g.
23
+ * to assert no tool ever targets a deny-listed route (publish/approve/secret/…).
24
+ * `ServerLike` is the minimal `.tool()` surface both `McpServer` and a test
25
+ * double satisfy.
26
+ */
27
+ type ServerLike = Pick<McpServer, "tool">;
28
+ export declare function registerAll(server: ServerLike, client: AxonityClient): void;
20
29
  export declare function buildServer(client: AxonityClient): McpServer;
21
30
  /**
22
31
  * True when this module is the process entry point.
@@ -29,3 +38,4 @@ export declare function buildServer(client: AxonityClient): McpServer;
29
38
  */
30
39
  export declare function isEntryPoint(moduleUrl: string, argv1: string | undefined): boolean;
31
40
  export declare function assertNoExtraArguments(argv: string[]): void;
41
+ export {};
package/dist/index.js CHANGED
@@ -24,6 +24,8 @@ import { loadConfig } from "./config.js";
24
24
  import { registerConventions } from "./tools/conventions.js";
25
25
  import { assertPlaceholderCredentials } from "./tools/credentials.js";
26
26
  import { registerAttachTools, registerCatalogTools, registerConnectorTools, registerPersonaTools, } from "./tools/extras.js";
27
+ import { registerCompanyTools } from "./tools/company.js";
28
+ import { registerPromptPlacementTools } from "./tools/promptPlacement.js";
27
29
  import { registerEntityTools } from "./tools/register.js";
28
30
  import { registerRunTools } from "./tools/runs.js";
29
31
  import { registerTriggerTools } from "./tools/triggers.js";
@@ -117,8 +119,9 @@ const ENTITIES = [
117
119
  },
118
120
  ];
119
121
  /**
120
- * Entities with version history. Not the same list as ENTITIES: `flow` has no
121
- * `/versions*` routes at all, so it is excluded here.
122
+ * Entities with version history. Every authored entity here exposes the
123
+ * `/versions*` routes, `flow` included (verified against the backend:
124
+ * `/api/v1/flows/{id}/versions…`), so all ten get the version tools.
122
125
  */
123
126
  const VERSIONED = [
124
127
  { singular: "workflow", basePath: "/api/v1/workflows", publishedPath: "entity" },
@@ -144,8 +147,7 @@ const VERSIONED = [
144
147
  },
145
148
  { singular: "flow", basePath: "/api/v1/flows", publishedPath: "entity" },
146
149
  ];
147
- export function buildServer(client) {
148
- const server = new McpServer({ name: "axonity", version: "0.1.0" });
150
+ export function registerAll(server, client) {
149
151
  registerConventions(server);
150
152
  for (const def of ENTITIES) {
151
153
  registerEntityTools(server, client, def);
@@ -163,6 +165,12 @@ export function buildServer(client) {
163
165
  registerConnectorTools(server, client);
164
166
  registerAttachTools(server, client);
165
167
  registerCatalogTools(server, client);
168
+ registerPromptPlacementTools(server, client);
169
+ registerCompanyTools(server, client);
170
+ }
171
+ export function buildServer(client) {
172
+ const server = new McpServer({ name: "axonity", version: "0.1.0" });
173
+ registerAll(server, client);
166
174
  return server;
167
175
  }
168
176
  async function main() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAwB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE;;;;GAIG;AACH,MAAM,QAAQ,GAAgB;IAC5B;QACE,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,mBAAmB;QAC7B,YAAY,EAAE,OAAO;QACrB,KAAK,EAAE,gCAAgC;QACvC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AC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The company entity — a tenant's single company document (mission, value
3
+ * streams, org structure). Unlike the other authored entities it is a
4
+ * SINGLETON: one per tenant, addressed at `/api/v1/company` with no id, so it
5
+ * has no list / create / delete / restore / discard routes. It is
6
+ * version-controlled like the memory entities, and edited as a whole document
7
+ * (a full-document PUT under optimistic locking), not field-by-field.
8
+ *
9
+ * Publishing: company is currently NOT a publish-approval entity type on the
10
+ * backend, so there is no request_publish_company — a company change is
11
+ * published directly by a human/admin in Axonity. (Tracked in axonity-flow: the
12
+ * decision on whether company joins the approval queue.)
13
+ */
14
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
15
+ import type { AxonityClient } from "../client.js";
16
+ export declare function registerCompanyTools(server: McpServer, client: AxonityClient): void;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The company entity — a tenant's single company document (mission, value
3
+ * streams, org structure). Unlike the other authored entities it is a
4
+ * SINGLETON: one per tenant, addressed at `/api/v1/company` with no id, so it
5
+ * has no list / create / delete / restore / discard routes. It is
6
+ * version-controlled like the memory entities, and edited as a whole document
7
+ * (a full-document PUT under optimistic locking), not field-by-field.
8
+ *
9
+ * Publishing: company is currently NOT a publish-approval entity type on the
10
+ * backend, so there is no request_publish_company — a company change is
11
+ * published directly by a human/admin in Axonity. (Tracked in axonity-flow: the
12
+ * decision on whether company joins the approval queue.)
13
+ */
14
+ import { z } from "zod";
15
+ import { guard, jsonResult } from "./result.js";
16
+ export function registerCompanyTools(server, client) {
17
+ server.tool("read_company", "Read this tenant's company document (its current draft and version). There " +
18
+ "is one company per tenant — no id. Read it before you update, to get the " +
19
+ "version for optimistic locking.", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/company"))));
20
+ server.tool("read_company_published", "Read the LIVE published company document — what the runtime uses, as opposed " +
21
+ "to the draft read_company returns. Diff the two to see what a publish would change.", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/company/published"))));
22
+ server.tool("update_company", "Save the company draft as a WHOLE document (full-document PUT, not a field " +
23
+ "merge). Read it first for its version; on a 409 conflict re-read and retry. " +
24
+ "This writes the draft only — a human publishes it in Axonity (company is " +
25
+ "not part of the request_publish_* approval flow).", {
26
+ expectedVersion: z
27
+ .number()
28
+ .int()
29
+ .describe("The version you last read — rejected with 409 if stale."),
30
+ document: z
31
+ .record(z.unknown())
32
+ .describe("The complete company document to persist (as read_company returns it)."),
33
+ }, async ({ expectedVersion, document }) => guard(async () => jsonResult(await client.put("/api/v1/company", { expectedVersion, document }))));
34
+ server.tool("list_company_versions", "List the company document's version history — checkpoints and major versions.", {
35
+ type: z
36
+ .enum(["checkpoint", "major", "all"])
37
+ .optional()
38
+ .describe("Which kind to list. Defaults to all."),
39
+ limit: z.number().int().min(1).max(200).optional().describe("Default 50."),
40
+ offset: z.number().int().min(0).optional().describe("Default 0."),
41
+ }, async ({ type, limit, offset }) => guard(async () => jsonResult(await client.get("/api/v1/company/versions", { type, limit, offset }))));
42
+ server.tool("read_company_version", "Read one historical company version by its CHECKPOINT NUMBER (the integer " +
43
+ "`version` from list_company_versions), including its document.", { version: z.number().int().describe("The integer checkpoint number, e.g. 3.") }, async ({ version }) => guard(async () => jsonResult(await client.get(`/api/v1/company/versions/${version}`))));
44
+ server.tool("restore_company_version", "Roll the company draft back to an earlier version. Takes the versionId (a " +
45
+ "UUID from list_company_versions), not the checkpoint number. Changes only " +
46
+ "the draft; what is live stays live until a human publishes.", {
47
+ versionId: z.string().describe("The version row's UUID."),
48
+ expectedVersion: z
49
+ .number()
50
+ .int()
51
+ .describe("The draft version you last read — 409 if stale."),
52
+ }, async ({ versionId, expectedVersion }) => guard(async () => jsonResult(await client.post(`/api/v1/company/versions/${versionId}/restore`, {
53
+ expectedVersion,
54
+ }))));
55
+ server.tool("name_company_major_version", "Give one of the company document's major versions a name — label a release " +
56
+ "so it is easy to find in history. Targets a MAJOR version by its integer " +
57
+ "number (from list_company_versions), not a checkpoint or a versionId. Like " +
58
+ "everything else on this singleton it takes no id. This only renames; it " +
59
+ "does not create, publish, or roll anything back.", {
60
+ majorVersion: z
61
+ .number()
62
+ .int()
63
+ .describe("The major version's integer number, e.g. 2."),
64
+ name: z.string().min(1).max(255).describe("The new name for that major version."),
65
+ }, async ({ majorVersion, name }) => guard(async () => jsonResult(await client.patch(`/api/v1/company/versions/major/${majorVersion}`, { name }))));
66
+ server.tool("request_publish_company", "Request that the company document be published. Like request_publish_* for " +
67
+ "every other entity, this does NOT publish — it creates a pending approval " +
68
+ "a human approves in Axonity. Company is a singleton, so unlike the others " +
69
+ "this takes NO id: the server resolves the one company from your tenant. " +
70
+ "(Direct company publish is closed to service tokens — this is the only " +
71
+ "path.)", {
72
+ changeSummary: z
73
+ .string()
74
+ .optional()
75
+ .describe("A short note for the approver on what changed and why."),
76
+ }, async ({ changeSummary }) => guard(async () => jsonResult(await client.post("/api/v1/publish-approvals", {
77
+ entityType: "company",
78
+ ...(changeSummary ? { changeSummary } : {}),
79
+ }))));
80
+ }
81
+ //# sourceMappingURL=company.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company.js","sourceRoot":"","sources":["../../src/tools/company.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,MAAqB;IAErB,MAAM,CAAC,IAAI,CACT,cAAc,EACd,6EAA6E;QAC3E,2EAA2E;QAC3E,iCAAiC,EACnC,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC/E,CAAC;I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AY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,CAAC,6CAA6C,CAAC;QAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KAClF,EACD,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,CAC/B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,KAAK,CAAC,kCAAkC,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAC/E,CACF,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,6EAA6E;QAC3E,4EAA4E;QAC5E,4EAA4E;QAC5E,0EAA0E;QAC1E,yEAAyE;QACzE,QAAQ,EACV;QACE,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAC1B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;QAC7C,UAAU,EAAE,SAAS;QACrB,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC,CACH,CACF,CACJ,CAAC;AACJ,CAAC"}
@@ -2,10 +2,16 @@
2
2
  * The `axonity_conventions` guidance tool.
3
3
  *
4
4
  * An external agent needs the same authoring rules the internal Builder team
5
- * carries, or its drafts will be low quality. This is a static conventions
6
- * reference for the MLP; a single-sourced `discover_<entity>_operations` tool
7
- * backed by the platform's own discovery contract is a planned refinement
8
- * (epic #652 C4 — "prefer a thin backend read endpoint").
5
+ * carries, or its drafts will be low quality. This is agent-facing GUIDANCE:
6
+ * build order, "complete when…" bars, wiring, and the prompt-placement / Memory
7
+ * V2 model — the parts a schema can't express.
8
+ *
9
+ * The hard facts it references (field names, enum values, required-ness) are NOT
10
+ * a second source of truth: the backend OpenAPI schema is authoritative
11
+ * (axonity-flow#722, Option 1). `test/conformance.test.ts` pins the routes here
12
+ * and the enums quoted below to a vendored snapshot of that schema, so a drift
13
+ * between this prose and the backend fails CI rather than misleading an agent.
14
+ * Keep enum lists in this doc in step with what that test asserts.
9
15
  */
10
16
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
17
  export declare function registerConventions(server: McpServer): void;
@@ -2,22 +2,36 @@
2
2
  * The `axonity_conventions` guidance tool.
3
3
  *
4
4
  * An external agent needs the same authoring rules the internal Builder team
5
- * carries, or its drafts will be low quality. This is a static conventions
6
- * reference for the MLP; a single-sourced `discover_<entity>_operations` tool
7
- * backed by the platform's own discovery contract is a planned refinement
8
- * (epic #652 C4 — "prefer a thin backend read endpoint").
5
+ * carries, or its drafts will be low quality. This is agent-facing GUIDANCE:
6
+ * build order, "complete when…" bars, wiring, and the prompt-placement / Memory
7
+ * V2 model — the parts a schema can't express.
8
+ *
9
+ * The hard facts it references (field names, enum values, required-ness) are NOT
10
+ * a second source of truth: the backend OpenAPI schema is authoritative
11
+ * (axonity-flow#722, Option 1). `test/conformance.test.ts` pins the routes here
12
+ * and the enums quoted below to a vendored snapshot of that schema, so a drift
13
+ * between this prose and the backend fails CI rather than misleading an agent.
14
+ * Keep enum lists in this doc in step with what that test asserts.
9
15
  */
10
16
  const CONVENTIONS = `# Authoring conventions for Axonity entities
11
17
 
12
18
  Read this before creating or updating anything.
13
19
 
14
20
  ## What this connector is for
15
- - AUTHORING: composing an entity from intent — drafting a workflow, an agent, a
16
- tool, and wiring them together. That is what these tools are good at.
17
- - NOT bulk migration. Do not use this to move many entities verbatim from
18
- somewhere else; Axonity's config import/export moves bytes without a model in
19
- the path. Content can be subtly altered in transit through an agent, which is
20
- exactly what you cannot afford in a fidelity migration.
21
+ - AUTHORING: composing an entity from intent — drafting a tool, an agent, a
22
+ workflow, and wiring them together so the result is CORRECT and COMPLETE
23
+ (every required field set, every reference pointing at something real).
24
+ - REPRODUCING a setup is just authoring it again, from scratch. To recreate an
25
+ agent/workflow/tool, CREATE NEW entities and wire them by their NEW ids —
26
+ never reuse an id you read. There is no "migration" and no "import an id":
27
+ this connector only ever acts in the ONE tenant its token points at (see
28
+ Tenant), and ids are tenant-local, so an id from anywhere else points at
29
+ nothing (or the wrong thing) here. Read the source for its SHAPE and intent —
30
+ names, field values, which tools an agent uses, which agents a workflow's
31
+ steps run — then build fresh and capture the ids the create calls return.
32
+ Recreating into a DIFFERENT tenant means running that build while the
33
+ connector is configured with THAT tenant's token — a separate session. See
34
+ "Reproducing a setup" below.
21
35
 
22
36
  ## The authoring loop
23
37
  1. \`read_*\` the entity (and \`read_*_published\` if you need to see what is live).
@@ -87,11 +101,20 @@ Read this before creating or updating anything.
87
101
 
88
102
  ## Field shape
89
103
  - All fields are camelCase JSON (e.g. \`capabilityTier\`, not \`capability_tier\`).
104
+ ONE documented exception: validator specs (\`permissions.outputValidators\`,
105
+ \`permissions.exposedValidatorTools\`) use snake_case keys (\`function\`,
106
+ \`target\`, \`args\`, \`error_message\`, \`tool_name\`, \`validator_name\`) — they are
107
+ the same shape at every level and are stored verbatim, so they are NOT
108
+ camel-aliased. Send them in snake_case.
90
109
  - \`update_*\` is a partial change for agents/tools and a partial patch for
91
- workflows: send only the fields you are changing.
110
+ workflows: send only the fields you are changing (plus \`expectedVersion\`).
92
111
  - The backend validates fields; a 422 error names the offending field and why
93
- (e.g. \`body.capabilityTier: Input should be 'standard' or 'advanced'\`). Fix
94
- that field and retry — do not guess at the whole shape.
112
+ (e.g. \`body.capabilityTier: Input should be 'economy', 'standard', 'smart' or
113
+ 'reasoning'\`). Fix that field and retry — do not guess at the whole shape.
114
+ - **create/update for tool and agent are STRICT** (\`extra="forbid"\`): an
115
+ undeclared OR MISSPELLED key is a 422 that names it, not a silent drop. So
116
+ spelling matters and you get told when it is wrong — good. Other entities are
117
+ more lenient and may drop an unknown key silently; never rely on that.
95
118
  - \`agent.tags\` is not cosmetic: it drives which policies apply to the agent at
96
119
  runtime. An untagged agent looks correct everywhere in the UI and silently
97
120
  skips policies scoped to those tags. If you create or update an agent that
@@ -99,8 +122,23 @@ Read this before creating or updating anything.
99
122
 
100
123
  ## After you write, verify
101
124
  - A 200 means the request was accepted, NOT that it did what you meant. Re-read
102
- the entity after a mutation and diff it against your intent — unknown fields
103
- can be dropped silently, and a partial update only changes what you sent.
125
+ the entity after a mutation and diff it against your intent — a partial update
126
+ only changes what you sent, and on the lenient (non-tool/agent) entities an
127
+ unknown key can be dropped silently rather than rejected.
128
+ - Re-reading the ENTITY is not enough for an \`attach_*\`: those links are stored
129
+ outside the entity body and never appear in \`read_agent\`. Read them back with
130
+ \`list_agent_skills\` / \`list_agent_policies\` / \`list_agent_reference_docs\`
131
+ (see Wiring, mechanism B).
132
+ - "Complete" is your job, not the backend's. A create succeeds with only the
133
+ required fields set; it does not tell you the entity is USABLE. An agent with
134
+ no \`toolIds\` runs with no tools; a connector tool with an empty
135
+ \`implementation\` has no endpoint to call; a workflow with steps but no
136
+ trigger never fires. After creating, check the entity has everything its
137
+ purpose needs — see the per-entity and wiring sections.
138
+ - To test a whole workflow end to end, \`start_workflow_run\` then read the result
139
+ (\`read_run\` / \`read_run_trace\` / \`read_run_cost\`). Note it runs the PUBLISHED
140
+ workflow and really executes (cost, connector side effects), so publish first,
141
+ and only test-run when a human is expecting it.
104
142
 
105
143
  ## Delete is recoverable — but not everything is
106
144
  - \`delete_*\` soft-deletes: the entity disappears from \`list_*\` but is not gone.
@@ -118,39 +156,224 @@ Read this before creating or updating anything.
118
156
  - There is no "archive" state for these ten entities — delete + restore IS the
119
157
  lifecycle. Runs are the one exception with a true archive/unarchive (see below).
120
158
 
121
- ## Per entity
122
- - **workflow**: \`create_workflow\` makes a stub (name, description). Edit its
123
- document with either
124
- - \`apply_workflow_mutations\` (LIST of command mutations, preserved order), or
125
- - \`replace_workflow_document\` (full-document atomic PUT).
126
- - **agent**: fields include name, avatar, capabilityTier, creativityTier,
127
- learningMode, permissions, delegationTargetIds, toolIds, systemToolIds, tags,
128
- status. \`list_system_tools\` shows what can go in \`systemToolIds\` — there is
129
- no separate grant/revoke tool, you set it via \`update_agent\`.
130
- - **tool**: fields include name, description, type
131
- ("function" | "connector" | "validator" | "evaluator"), inputSchema,
132
- outputSchema, implementation, authConfig, status. For a connector, set
133
- \`type: "connector"\`; NEVER put real credentials in authConfig — use
134
- placeholders and let a human fill secrets in the Axonity tool editor. Test it
135
- with \`execute_tool\` (runs code you supply) or \`execute_stored_connector\`
136
- (runs an already-saved connector using its real, server-side-decrypted
137
- secret — you never see the secret, only the result).
138
- - **persona**: an agent's character — 1:1 with an agent. Created only through
139
- its agent (\`create_agent_persona\`); once created it's a normal entity
140
- (\`list_personas\`, \`read_persona\`, \`update_persona\`, delete/restore/versions).
141
- - **prompt_snippet**: reusable prompt fragments. A normal entity in every
142
- respect now (\`read_prompt_snippet\`, \`discard_prompt_snippet_draft\`,
143
- everything else). Only wire-level oddity: \`list_deleted_prompt_snippets\`
144
- uses a dedicated deleted collection and returns the backend \`items\` envelope.
145
- - **output_schema**: a reusable output contract, fully version-controlled and
146
- publishable like the other memory entities. A tool's \`outputValidators\` (or
147
- an agent's \`permissions.expected_output_schema_id\`) references one by id —
148
- create it before you need to point something at it.
149
- - **flow**: a reusable workflow fragment in the authored-entity lifecycle.
150
- \`create_flow\` and \`update_flow\` write draft state; execution uses
151
- \`read_flow_published\` until approval completes. Use
152
- \`request_publish_flow\` to request publish approval, and \`discard_flow_draft\`
153
- when you need to reset the draft to last published state.
159
+ ## Per entity — what to create, and what "complete" means
160
+
161
+ Build in dependency order: a thing you will REFERENCE must exist before the
162
+ thing that references it. So: tools and output-schemas first, then agents (which
163
+ list tool ids), then workflows (whose steps name agents and tools), then
164
+ triggers (which make a workflow fire). Skills/policies/reference-docs can be
165
+ made any time before you attach them.
166
+
167
+ ### tool (\`create_tool\`, strict body)
168
+ - Required: \`name\`. Also: \`description\`, \`type\`, \`inputSchema\`,
169
+ \`outputSchema\`, \`implementation\`, \`authConfig\`, \`surfacing\`.
170
+ - \`type\`: \`"function"\` (default) | \`"connector"\` | \`"validator"\` |
171
+ \`"evaluator"\`. \`surfacing\`: \`"always"\` (in the agent's tool list) |
172
+ \`"on_demand"\`.
173
+ - \`inputSchema\` / \`outputSchema\` are JSON-Schema objects describing the tool's
174
+ params and result. Set them — an agent binds to a tool by its declared I/O; a
175
+ tool with no inputSchema is hard to call correctly.
176
+ - \`implementation\` is what makes the tool DO something, and its shape depends on
177
+ \`type\`:
178
+ - **function** — carries the Python. Author and check the code with
179
+ \`validate_tool_code\` and \`format_tool_code\`, and prove it runs with
180
+ \`execute_tool\`, BEFORE \`create_tool\`. A function tool whose
181
+ \`implementation\` is empty is an inert stub.
182
+ - **connector** — carries the HTTP call: typically \`connectorType\`
183
+ ("rest"/"graphql"), \`baseUrl\`, \`method\`, \`path\`, \`headers\`,
184
+ \`queryParams\`, \`body\`, \`responseMapping\`, \`pagination\`. Prefer the
185
+ \`create_connector\` tool, which sets \`type:"connector"\` for you. NEVER put
186
+ a real credential in \`authConfig\` — placeholders only ("{{ MY_SECRET }}"
187
+ or ""); a human fills the secret in Axonity. Test with
188
+ \`execute_stored_connector\` (uses the real, server-side-decrypted secret;
189
+ you see only the result).
190
+ - **validator / evaluator** — a constrained kind that wraps a builtin;
191
+ \`implementation\` names the builtin registry key plus its args. Look at the
192
+ tenant's existing validator/evaluator tools (\`list_tools\`) for the keys in
193
+ use rather than inventing one.
194
+ - Complete check: the tool has the I/O schemas its callers need AND a non-empty
195
+ implementation of the right shape for its type.
196
+
197
+ ### agent (\`create_agent\`, strict body)
198
+ - Required: \`name\`. Enumerated fields, with their ONLY valid values:
199
+ - \`capabilityTier\`: \`economy\` | \`standard\` (default) | \`smart\` | \`reasoning\`
200
+ - \`creativityTier\`: \`low\` | \`medium\` (default) | \`high\`
201
+ - \`learningMode\`: \`none\` (default) | \`adaptive\` | \`strict\`
202
+ - \`avatar\`, \`tags\` (role tags — see Field shape; set them or policies silently
203
+ skip the agent), \`canOwnProcess\` (bool; must be true for an agent to own a
204
+ workflow step's flow), \`episodicMemoryEnabled\` (bool).
205
+ - \`permissions\` (object): \`planning\`, \`delegation\`, \`verboseOutput\` (bools);
206
+ \`outputValidators\` / \`exposedValidatorTools\` (snake_case specs, see Field
207
+ shape); \`expectedOutputSchemaId\` (an output_schema id — MANDATORY whenever you
208
+ attach validators here).
209
+ - Wiring fields — see the Wiring section: \`toolIds\`, \`systemToolIds\`,
210
+ \`delegationTargetIds\`.
211
+ - Complete check: an agent with no \`toolIds\`/\`systemToolIds\` has no tools and
212
+ can only reason/talk. If it is meant to DO something, give it the tools.
213
+
214
+ ### workflow (\`create_workflow\`, then edit the document)
215
+ - \`create_workflow\` makes a STUB (name, description) with an empty document.
216
+ You then build the graph with either
217
+ - \`apply_workflow_mutations\` — a LIST of command mutations applied in order
218
+ (preferred: the backend validates each and threads the version), or
219
+ - \`replace_workflow_document\` — a full-document atomic PUT.
220
+ - The document is a graph: \`steps.all[]\` (each \`{ id, type, name, ... }\`) and
221
+ \`steps.edges[]\` (each \`{ id, from, to, type? }\`) plus \`triggers\`. Step
222
+ \`type\` is one of: \`manual\`, \`agent\`, \`automation\`, \`subprocess\`,
223
+ \`connector\`, \`decision\`, \`loop\`, \`for_each\`, \`end\`.
224
+ - Referential integrity is enforced: step and trigger ids must be unique, and
225
+ every edge \`from\`/\`to\` must reference an id that exists in the document
226
+ (\`from\` may be a trigger or step; \`to\` must be a step). A dangling edge is a
227
+ hard error.
228
+ - Complete check: run \`validate_workflow\` on the document — it returns
229
+ \`launchable\` plus an \`issues\` list. A workflow is not done until it is
230
+ launchable AND has a trigger (see Triggers).
231
+
232
+ ### persona
233
+ - An agent's character — 1:1 with an agent. Created only through its agent
234
+ (\`create_agent_persona\`: \`name\`, \`characterText\`); then a normal entity
235
+ (\`read_persona\`, \`update_persona\`, delete/restore/versions).
236
+
237
+ ### output_schema
238
+ - A reusable output contract, versioned and publishable. Referenced BY id from a
239
+ tool's validators or an agent's \`permissions.expectedOutputSchemaId\` — so
240
+ create it first, then point things at the id the create call returns.
241
+
242
+ ### skill / policy / reference_doc
243
+ - Memory entities attached to agents (and skills also to workflows). Create them,
244
+ then wire with the \`attach_*\` tools — see Wiring.
245
+
246
+ ### prompt_snippet
247
+ - Reusable prompt fragments; a normal entity. Wire-level oddity:
248
+ \`list_deleted_prompt_snippets\` returns the backend \`items\` envelope.
249
+
250
+ ### flow
251
+ - A reusable workflow fragment in the authored-entity lifecycle. \`create_flow\` /
252
+ \`update_flow\` write draft state; runtime uses \`read_flow_published\` until
253
+ approval. \`request_publish_flow\` to publish, \`discard_flow_draft\` to reset.
254
+
255
+ ### company
256
+ - The tenant's single company document (mission, value streams, org structure).
257
+ A SINGLETON — one per tenant, no id, so there is no list/create/delete:
258
+ \`read_company\`, \`update_company\` (a WHOLE-document save with
259
+ \`expectedVersion\`, like \`replace_workflow_document\`), \`list_company_versions\`,
260
+ \`read_company_version\`, \`restore_company_version\`, \`read_company_published\`.
261
+ Publish it like anything else with \`request_publish_company\` — but because it
262
+ is a singleton this takes NO id (the server resolves your tenant's one
263
+ company). Direct company publish is closed to machine tokens, so the approval
264
+ queue is the only path.
265
+
266
+ ## Wiring — how the pieces connect
267
+ There are THREE mechanisms, and using the wrong one silently no-ops. Know which
268
+ each link uses.
269
+
270
+ **A) Set a field on the entity (via create/update)** — an id or id-array that
271
+ lives in the entity body:
272
+ - tool → agent: add the tool's id to the agent's \`toolIds\`. This is how an
273
+ agent gets a (non-system) tool. There is no attach_tool_to_agent route.
274
+ - system tool → agent: add the catalog id to \`systemToolIds\`. Get ids from
275
+ \`list_system_tools\`. No grant/revoke tool — you set the array via
276
+ \`update_agent\`. \`toolIds\` and \`systemToolIds\` are DIFFERENT lists; a
277
+ system-tool id does not go in \`toolIds\`.
278
+ - agent → agent (delegation): add the callee agent's id to the caller's
279
+ \`delegationTargetIds\` (and set \`permissions.delegation: true\`).
280
+ - output_schema → agent: \`permissions.expectedOutputSchemaId\` (a single id).
281
+ - Changing any of these is read-then-write under optimistic locking: read the
282
+ agent, edit the field — an id-array is a FULL replace, so include the ids you
283
+ are keeping — then \`update_agent\` with \`expectedVersion\`.
284
+
285
+ **B) Call an attach route (a link, not a field).** \`attach_*\`/\`detach_*\` POST/
286
+ DELETE a link and do NOT touch the entity body:
287
+ - skill → agent: \`attach_skill_to_agent\`; skill → workflow:
288
+ \`attach_skill_to_workflow\`.
289
+ - policy → agent: \`attach_policy_to_agent\`.
290
+ - reference_doc → agent: \`attach_reference_to_agent\` (agents only — there is no
291
+ workflow-scoped reference-doc route).
292
+ - VERIFY every one of these with the read-back before \`request_publish_*\`:
293
+ \`list_agent_skills\`, \`list_agent_policies\`, \`list_agent_reference_docs\`.
294
+ This is not optional politeness — because a link lives OUTSIDE the entity body,
295
+ \`read_agent\` will not show it, so the read-back is the only way to tell an
296
+ attach that landed from one that silently did nothing. (Mechanism A is
297
+ different: those ids ARE in the body, so re-reading the agent proves them.
298
+ \`attach_skill_to_workflow\` has no read-back — the backend has no list route
299
+ for it.)
300
+
301
+ **C) Reference an id INSIDE the workflow document** (this is how agents and tools
302
+ get "into" a workflow — there is no attach route for it):
303
+ - agent → workflow: an \`agent\` step names its agent in the step's
304
+ \`contract.owners[]\` as \`{ "type": "agent", "id": "<agentId>" }\`.
305
+ - tool → workflow: on an \`agent\` step, list tool ids under
306
+ \`contract.tools.toolIds[]\` (and/or per plan-step \`contract.activities[]\`
307
+ entries of \`{ "kind": "tool", "toolId": "<id>" }\`). On an \`automation\` step,
308
+ set \`config.automationType: "tool"\` and \`config.toolId\`. A \`connector\` step
309
+ references a connector tool the same way.
310
+ - Every id you place in a document must be a REAL id in THIS tenant. The workflow
311
+ validator flags a step whose owner agent or referenced tool no longer exists —
312
+ \`validate_workflow\` is how you catch a bad reference before publishing.
313
+ - Prefer \`apply_workflow_mutations\` (e.g. \`add_step\`, \`update_step\`,
314
+ \`add_edge\`) over hand-building this JSON: the backend fills defaults and
315
+ validates each edit. Read the returned document to see the exact shape it
316
+ produced, then adjust.
317
+
318
+ ## Prompt elements & placement (Memory V2)
319
+ A prompt snippet is a LIBRARY item — creating it changes nothing on its own. It
320
+ only shapes a run once it is PLACED into a flow step's prompt stack. Placement is
321
+ per flow step, in one of two channels, at an order:
322
+ - \`read_workflow_prompt_stacks(workflowId)\` (or \`read_flow_prompt_stacks(flowId)\`)
323
+ resolves a workflow/flow to its steps and each step's system/user stacks — this
324
+ is how you DISCOVER the \`flowStepId\`s you place against. Start here.
325
+ - \`attach_prompt_snippet_to_flow_step(flowStepId, snippetId, target, displayOrder?)\`
326
+ — \`target\` is \`"system"\` (instructions the model is steered by) or \`"user"\`
327
+ (content presented as the user turn).
328
+ - \`list_flow_step_prompts\` shows a step's current system/user stacks (with each
329
+ attachment's \`linkId\`); \`update_flow_step_prompt(linkId, …)\` moves/reorders one;
330
+ \`reorder_flow_step_prompts(flowStepId, snippetIds)\` sets the whole order;
331
+ \`detach_prompt_snippet_from_flow_step(linkId)\` unlinks (the snippet survives).
332
+ - A WILDCARD snippet applies to EVERY step (top of every stack) — use it for
333
+ cross-cutting instructions instead of attaching the same snippet everywhere.
334
+ \`list_wildcard_prompts\` shows them.
335
+
336
+ Where each kind of instruction belongs — the decision map:
337
+ - reusable voice/character for one agent → a **persona** (1:1 with the agent), or a
338
+ reusable **snippet** if it is shared prompt text.
339
+ - a rule that must hold everywhere → a **wildcard** snippet, or a **policy** if it
340
+ is a guardrail (policies are governance; snippets are prompt text).
341
+ - a step-specific instruction → a flow-step **\`system\`** prompt.
342
+ - user-turn scaffolding for a step → a flow-step **\`user\`** prompt.
343
+ - background knowledge the agent reads → a **reference doc** (attach to the agent).
344
+ - a capability the agent uses → a **tool** (\`agent.toolIds\`) or **skill** (attach).
345
+ - long-term recall for an agent → the agent's **\`episodicMemoryEnabled\`** flag
346
+ (Memory V2, opt-in). Session/workflow memory are RUNTIME, not authored: they are
347
+ written by a run, never set here. This connector does not expose them — the
348
+ backend serves them per run, but no tool wraps those reads yet, so do not
349
+ promise a user you can show them.
350
+
351
+ ## Reproducing a setup (recreate, never copy ids)
352
+ To rebuild an agent/workflow/tool graph as NEW entities — in this tenant, or in
353
+ another tenant by pointing the connector at THAT tenant's token in a separate
354
+ session — author it fresh and wire by the NEW ids. An id from a read is
355
+ meaningful only in the tenant it came from; sending it back in a create/update
356
+ elsewhere points at nothing. Do this instead:
357
+ 1. Read the source graph (in the session pointed at it) for its SHAPE: names,
358
+ field values, which tools each agent lists, which agents/tools each workflow
359
+ step references. For each source agent also read its LINKS —
360
+ \`list_agent_skills\`, \`list_agent_policies\`, \`list_agent_reference_docs\` —
361
+ they are not in the agent body, so a plain \`read_agent\` misses them and you
362
+ would rebuild an agent that quietly lost its skills and guardrails.
363
+ 2. Create the leaf dependencies first (tools, output_schemas). Keep a map from
364
+ each OLD id to the NEW id the create call returns.
365
+ 3. Create agents, translating every referenced id through your map:
366
+ old toolId → new toolId in \`toolIds\`, etc. Never send an old id. If the
367
+ source agent has a persona, recreate it with \`create_agent_persona\` on the
368
+ new agent.
369
+ 4. Create workflows; when you add agent/tool references into the document,
370
+ translate through the map the same way.
371
+ 5. Attach skills/policies/reference-docs by the new ids, then read them back
372
+ (\`list_agent_*\`) and diff against what you read in step 1.
373
+ 6. \`validate_workflow\` and re-read each entity to confirm every reference
374
+ resolved, then \`request_publish_*\`.
375
+ The connector never carries a secret across: \`authConfig\` stays placeholders in
376
+ the new tenant too, and a human fills the real value there.
154
377
 
155
378
  ## Structural workflow edits
156
379
  - \`apply_workflow_mutations\` takes a LIST of commands and applies them in order,
@@ -185,7 +408,11 @@ Read this before creating or updating anything.
185
408
  tenant id in a body.
186
409
  `;
187
410
  export function registerConventions(server) {
188
- server.tool("axonity_conventions", "Read the authoring conventions (drafts vs live, optimistic locking, field " +
189
- "shapes per entity). Call this before creating or updating entities.", {}, async () => ({ content: [{ type: "text", text: CONVENTIONS }] }));
411
+ server.tool("axonity_conventions", "Read the authoring conventions BEFORE creating or updating anything: the " +
412
+ "draft→publish lifecycle, optimistic locking, per-entity create contracts " +
413
+ "(required fields, valid enum values, what 'complete' means), how to WIRE " +
414
+ "tools→agents, agents/tools→workflows and delegation, and how to reproduce " +
415
+ "a setup by creating new entities and remapping ids (never copy an id " +
416
+ "across tenants).", {}, async () => ({ content: [{ type: "text", text: CONVENTIONS }] }));
190
417
  }
191
418
  //# sourceMappingURL=conventions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgLnB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,4EAA4E;QAC1E,qEAAqE,EACvE,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAC1E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyYnB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,2EAA2E;QACzE,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,uEAAuE;QACvE,kBAAkB,EACpB,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAC1E,CAAC;AACJ,CAAC"}
@@ -57,12 +57,24 @@ export function registerAttachTools(server, client) {
57
57
  * generated from one definition — that is what keeps them from drifting apart
58
58
  * again (only attach existed before, so nothing could be unwired).
59
59
  */
60
- const link = (subject, target, path, firstArg, secondArg) => {
60
+ const link = (subject, target, path, firstArg, secondArg,
61
+ /**
62
+ * The read-back tool for this link, when one exists. A 200 here does not
63
+ * prove the link resolved, so the description points at the tool that does —
64
+ * agent-scoped links have one, `skill → workflow` has no list route.
65
+ */
66
+ readBack) => {
61
67
  const shape = { [firstArg]: z.string(), [secondArg]: z.string() };
62
- server.tool(`attach_${subject}_to_${target}`, `Scope a ${subject.replace("_", " ")} to a ${target} so the ${target} uses it.`, shape, async (args) => guard(async () => jsonResult(await client.post(path(args[firstArg], args[secondArg])))));
68
+ server.tool(`attach_${subject}_to_${target}`, `Scope a ${subject.replace("_", " ")} to a ${target} so the ${target} uses it.` +
69
+ (readBack
70
+ ? ` Verify it landed with \`${readBack}\` before request_publish_${target} — ` +
71
+ `the link lives outside the entity body, so re-reading the ${target} will ` +
72
+ `not show it.`
73
+ : ""), shape, async (args) => guard(async () => jsonResult(await client.post(path(args[firstArg], args[secondArg])))));
63
74
  server.tool(`detach_${subject}_from_${target}`, `Unscope a ${subject.replace("_", " ")} from a ${target}. This only ` +
64
75
  `removes the link — the ${subject.replace("_", " ")} itself is not deleted ` +
65
- `and stays available to attach elsewhere.`, shape, async (args) => guard(async () => {
76
+ `and stays available to attach elsewhere.` +
77
+ (readBack ? ` Confirm what is left with \`${readBack}\`.` : ""), shape, async (args) => guard(async () => {
66
78
  await client.del(path(args[firstArg], args[secondArg]));
67
79
  return jsonResult({
68
80
  detached: true,
@@ -71,12 +83,28 @@ export function registerAttachTools(server, client) {
71
83
  });
72
84
  }));
73
85
  };
74
- link("skill", "agent", (agentId, skillId) => `/api/v1/agents/${agentId}/skills-v2/${skillId}`, "agentId", "skillId");
86
+ link("skill", "agent", (agentId, skillId) => `/api/v1/agents/${agentId}/skills-v2/${skillId}`, "agentId", "skillId", "list_agent_skills");
87
+ // No read-back for the workflow-scoped variant: the backend has no
88
+ // GET /workflows/{id}/skills-v2, so there is nothing to point at.
75
89
  link("skill", "workflow", (workflowId, skillId) => `/api/v1/workflows/${workflowId}/skills-v2/${skillId}`, "workflowId", "skillId");
76
- link("policy", "agent", (agentId, policyId) => `/api/v1/agents/${agentId}/policies/${policyId}`, "agentId", "policyId");
90
+ link("policy", "agent", (agentId, policyId) => `/api/v1/agents/${agentId}/policies/${policyId}`, "agentId", "policyId", "list_agent_policies");
77
91
  // Reference docs attach to agents only — there is no workflow-scoped
78
92
  // reference-doc route on the backend, so no `*_to_workflow` pair here.
79
- link("reference", "agent", (agentId, refId) => `/api/v1/agents/${agentId}/reference-docs/${refId}`, "agentId", "refId");
93
+ link("reference", "agent", (agentId, refId) => `/api/v1/agents/${agentId}/reference-docs/${refId}`, "agentId", "refId", "list_agent_reference_docs");
94
+ /**
95
+ * The read side of the links above. `attach_*`/`detach_*` write a link but
96
+ * return nothing you can list later, so these are how an agent verifies a
97
+ * link landed — and how it reads a source agent's wiring to reproduce it as
98
+ * new. All three are plain GETs, safe for read-only tokens.
99
+ */
100
+ const listLinks = (subject, plural, path) => {
101
+ server.tool(`list_agent_${plural}`, `List the ${subject} currently scoped to an agent — the read-back for ` +
102
+ `attach_${subject}_to_agent. Use it to confirm a link took, or to read a ` +
103
+ `source agent's wiring before recreating it. Read-only.`, { agentId: z.string().describe("The agent's id.") }, async ({ agentId }) => guard(async () => jsonResult(await client.get(path(agentId)))));
104
+ };
105
+ listLinks("skill", "skills", (id) => `/api/v1/agents/${id}/skills-v2`);
106
+ listLinks("policy", "policies", (id) => `/api/v1/agents/${id}/policies`);
107
+ listLinks("reference_doc", "reference_docs", (id) => `/api/v1/agents/${id}/reference-docs`);
80
108
  }
81
109
  /**
82
110
  * Small standalone tools that don't fit any of the other groupings: the
@@ -1 +1 @@
1
- {"version":3,"file":"extras.js","sourceRoot":"","sources":["../../src/tools/extras.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,MAAqB;IAErB,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,8EAA8E;QAC5E,sCAAsC,EACxC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EACnD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CACpB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAA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,IAAI,CACT,sBAAsB,EACtB,0DAA0D,EAC1D,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,EAC9D,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CACtB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,SAAS,QAAQ,CAAC,CAAC,CAC5E,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Prompt-element placement — where a prompt snippet actually takes effect.
3
+ *
4
+ * A snippet (the `prompt_snippet` entity) is a LIBRARY item: creating it does
5
+ * nothing on its own. It only shapes a run once it is PLACED into a flow step's
6
+ * prompt stack — in the `system` or `user` channel, at a chosen order — or made
7
+ * a tenant-wide "wildcard" that sits at the top of every step's stack.
8
+ *
9
+ * These tools wrap the placement routes in the backend's `prompt_snippets.py`.
10
+ * The snippet CRUD itself is the generic `*_prompt_snippet` entity family; this
11
+ * module is only the linking layer that the generic registrar can't express.
12
+ */
13
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
14
+ import type { AxonityClient } from "../client.js";
15
+ export declare function registerPromptPlacementTools(server: McpServer, client: AxonityClient): void;
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Prompt-element placement — where a prompt snippet actually takes effect.
3
+ *
4
+ * A snippet (the `prompt_snippet` entity) is a LIBRARY item: creating it does
5
+ * nothing on its own. It only shapes a run once it is PLACED into a flow step's
6
+ * prompt stack — in the `system` or `user` channel, at a chosen order — or made
7
+ * a tenant-wide "wildcard" that sits at the top of every step's stack.
8
+ *
9
+ * These tools wrap the placement routes in the backend's `prompt_snippets.py`.
10
+ * The snippet CRUD itself is the generic `*_prompt_snippet` entity family; this
11
+ * module is only the linking layer that the generic registrar can't express.
12
+ */
13
+ import { z } from "zod";
14
+ import { guard, jsonResult } from "./result.js";
15
+ /** The two prompt channels a snippet can be placed in. */
16
+ const TARGET = z
17
+ .enum(["system", "user"])
18
+ .describe("Which prompt channel to place the snippet in: 'system' (instructions the " +
19
+ "model is steered by) or 'user' (content presented as the user turn).");
20
+ export function registerPromptPlacementTools(server, client) {
21
+ server.tool("list_flow_step_prompts", "List the prompt snippets attached to a flow step — its `system` and `user` " +
22
+ "prompt stacks, each entry with its link id and display order. This is how " +
23
+ "you see a step's current prompt composition before changing it. Excludes " +
24
+ "wildcard snippets (see list_wildcard_prompts). Read-only.", { flowStepId: z.string().describe("The flow step's id.") }, async ({ flowStepId }) => guard(async () => jsonResult(await client.get(`/api/v1/flow-steps/${flowStepId}/prompts`))));
25
+ server.tool("attach_prompt_snippet_to_flow_step", "Place a library prompt snippet into a flow step's prompt stack. Choose the " +
26
+ "channel (`target`: system/user) and its order in that channel. This is " +
27
+ "what makes a snippet actually shape the step's prompt — creating the " +
28
+ "snippet alone does nothing. Returns the created link (with its linkId) so " +
29
+ "you can reorder or detach it later.", {
30
+ flowStepId: z.string().describe("The flow step's id."),
31
+ snippetId: z.string().describe("The prompt snippet's id (a UUID)."),
32
+ target: TARGET,
33
+ displayOrder: z
34
+ .number()
35
+ .int()
36
+ .min(0)
37
+ .optional()
38
+ .describe("Position within the chosen channel (0 = first). Defaults to 0."),
39
+ }, async ({ flowStepId, snippetId, target, displayOrder }) => guard(async () => jsonResult(await client.post(`/api/v1/flow-steps/${flowStepId}/prompts`, {
40
+ snippetId,
41
+ target,
42
+ ...(displayOrder === undefined ? {} : { displayOrder }),
43
+ }))));
44
+ server.tool("update_flow_step_prompt", "Change an existing flow-step prompt attachment: move it between the system " +
45
+ "and user channel, and/or change its display order. Identify it by its " +
46
+ "linkId (from list_flow_step_prompts or the attach response), NOT the " +
47
+ "snippet id. Send only what you are changing.", {
48
+ linkId: z.string().describe("The attachment's link id (not the snippet id)."),
49
+ target: z
50
+ .enum(["system", "user"])
51
+ .optional()
52
+ .describe("New channel. Omit to leave it unchanged."),
53
+ displayOrder: z
54
+ .number()
55
+ .int()
56
+ .min(0)
57
+ .optional()
58
+ .describe("New position in its channel. Omit to leave it unchanged."),
59
+ }, async ({ linkId, target, displayOrder }) => guard(async () => {
60
+ const body = {};
61
+ if (target !== undefined)
62
+ body.target = target;
63
+ if (displayOrder !== undefined)
64
+ body.displayOrder = displayOrder;
65
+ return jsonResult(await client.patch(`/api/v1/flow-step-prompts/${linkId}`, body));
66
+ }));
67
+ server.tool("reorder_flow_step_prompts", "Set the full ordering of a flow step's prompt snippets in one call. Pass the " +
68
+ "snippet ids in the order you want them; the backend replaces the step's " +
69
+ "ordering with this list. Read the step first (list_flow_step_prompts) so " +
70
+ "you include every snippet — omitting one is a reorder, not a safe no-op.", {
71
+ flowStepId: z.string().describe("The flow step's id."),
72
+ snippetIds: z
73
+ .array(z.string())
74
+ .min(1)
75
+ .max(512)
76
+ .describe("Snippet ids (UUIDs) in the desired order."),
77
+ }, async ({ flowStepId, snippetIds }) => guard(async () => jsonResult(await client.put(`/api/v1/flow-steps/${flowStepId}/prompts/order`, {
78
+ snippetIds,
79
+ }))));
80
+ server.tool("detach_prompt_snippet_from_flow_step", "Remove a prompt snippet from a flow step's stack. This only unlinks it — the " +
81
+ "snippet itself is not deleted and stays available to place elsewhere. " +
82
+ "Identify the link by its linkId (from list_flow_step_prompts).", { linkId: z.string().describe("The attachment's link id (not the snippet id).") }, async ({ linkId }) => guard(async () => {
83
+ await client.del(`/api/v1/flow-step-prompts/${linkId}`);
84
+ return jsonResult({ detached: true, linkId });
85
+ }));
86
+ server.tool("read_workflow_prompt_stacks", "Resolve a workflow to its flow steps and each step's prompt stack in one " +
87
+ "read: per step you get its flowStepId, name, and its system/user prompt " +
88
+ "snippets (with link ids and order). This is how you discover the " +
89
+ "flowStepIds you need before placing prompts, and how you see a workflow's " +
90
+ "whole prompt composition. Read-only.", { workflowId: z.string().describe("The workflow's id.") }, async ({ workflowId }) => guard(async () => jsonResult(await client.get(`/api/v1/workflows/${workflowId}/prompt-stacks`))));
91
+ server.tool("read_flow_prompt_stacks", "The flow-scoped counterpart of read_workflow_prompt_stacks: resolve a flow " +
92
+ "to its steps and their system/user prompt stacks (flowStepId, link ids, " +
93
+ "order). Read-only.", { flowId: z.string().describe("The flow's id.") }, async ({ flowId }) => guard(async () => jsonResult(await client.get(`/api/v1/flows/${flowId}/prompt-stacks`))));
94
+ server.tool("list_wildcard_prompts", "List the tenant's wildcard prompt snippets — those that apply to EVERY flow " +
95
+ "step (they sit at the top of each step's prompt stack). Use this for " +
96
+ "cross-cutting instructions that should hold everywhere, rather than " +
97
+ "attaching the same snippet to every step by hand. Read-only.", {}, async () => guard(async () => jsonResult(await client.get("/api/v1/wildcard-prompts"))));
98
+ }
99
+ //# sourceMappingURL=promptPlacement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptPlacement.js","sourceRoot":"","sources":["../../src/tools/promptPlacement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,0DAA0D;AAC1D,MAAM,MAAM,GAAG,CAAC;KACb,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KACxB,QAAQ,CACP,2EAA2E;IACzE,sEAAsE,CACzE,CAAC;AAEJ,MAAM,UAAU,4BAA4B,CAC1C,MAAiB,EACjB,MAAqB;IAErB,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,6EAA6E;QAC3E,4EAA4E;QAC5E,2EAA2E;QAC3E,2DAA2D,EAC7D,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAC1D,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CACvB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,sBAAsB,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AC"}
@@ -39,9 +39,10 @@ export interface EntityDef {
39
39
  */
40
40
  guardFields?: (fields: Record<string, unknown>) => void;
41
41
  /**
42
- * Whether this entity can be published. Default true. `flow` has no publish
43
- * route and is not a valid `entityType` for a publish approval, so generating
44
- * this tool is suppressed there.
42
+ * Whether `request_publish_<entity>` is generated. Default true, and true for
43
+ * every current entity: all ten (flow included) are valid `entityType`s for a
44
+ * publish approval on the backend (`ApprovalEntityType`). Set false only for a
45
+ * future entity that genuinely cannot be publish-approved.
45
46
  */
46
47
  publishable?: boolean;
47
48
  /**
@@ -52,7 +53,12 @@ export interface EntityDef {
52
53
  plural?: string;
53
54
  /** Whether `create_<entity>` is generated. Default true. False for `persona`, whose create is agent-scoped (`create_agent_persona`). */
54
55
  creatable?: boolean;
55
- /** Whether `read_<entity>` is generated. Default true. False for `prompt_snippet`, which has no single-read route. */
56
+ /**
57
+ * Whether `read_<entity>` is generated. Default true, and true for every
58
+ * current entity — `prompt_snippet` does have a single-read route
59
+ * (`GET /api/v1/prompt-snippets/{id}`). Kept as an escape hatch for a future
60
+ * entity with no single-read route.
61
+ */
56
62
  readable?: boolean;
57
63
  /**
58
64
  * The query-string key DELETE expects for the optimistic lock. Its presence
@@ -64,15 +70,17 @@ export interface EntityDef {
64
70
  */
65
71
  deleteVersionParam?: "expectedVersion" | "expected_version";
66
72
  /**
67
- * Whether `discard_<entity>_draft` is generated. Default true when the
68
- * entity is deletable. False for `flow` and `prompt_snippet`, neither of
69
- * which has a discard-draft route.
73
+ * Whether `discard_<entity>_draft` is generated. Default true when the entity
74
+ * is deletable, and true for every current entity — both `flow` and
75
+ * `prompt_snippet` have a discard-draft route
76
+ * (`POST .../{id}/discard-draft`). Escape hatch for a future entity lacking one.
70
77
  */
71
78
  hasDiscardDraft?: boolean;
72
79
  /**
73
80
  * How to list soft-deleted rows. `"collection"` (default) is `GET
74
- * <basePath>/deleted`, used by every entity except `prompt_snippet`, which
75
- * instead takes `?deleted=true` on the main list route (`"query"`).
81
+ * <basePath>/deleted` and is what every current entity uses, `prompt_snippet`
82
+ * included (`GET /api/v1/prompt-snippets/deleted`). `"query"` (`?deleted=true`
83
+ * on the main list) is retained for a future entity that needs it.
76
84
  */
77
85
  deletedListPath?: "collection" | "query";
78
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/tools/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,+EAA+E;AAC/E,MAAM,OAAO,GAAG,CAAC;KACd,OAAO,CAAC,IAAI,CAAC;KACb,QAAQ,CAAC,gEAAgE,CAAC,CAAC;AAwD9E,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,MAAqB,EACrB,GAAc;IAEd,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;IACrE,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC;IAC5C,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,KAAK,KAAK,CAAC;IAC9C,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,KAAK,KAAK,CAAC;IAC1C,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,KAAK,CAAC;IAExC,MAAM,CAAC,IAAI,CACT,QAAQ,MAAM,EAAE,EAChB,YAAY,KAAK,sDAAsD,EACvE,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CACtE,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CACT,QAAQ,QA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AC,IAAI,CACT,mBAAmB,QAAQ,EAAE,EAC7B,kBAAkB,QAAQ,+CAA+C;QACvE,sEAAsE;QACtE,wCAAwC,EAC1C;QACE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,CAAC;QAChD,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;KACtE,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAC9B,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;QAC7C,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,EAAE;QACZ,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC,CACH,CACF,CACJ,CAAC;AACJ,CAAC"}
@@ -15,6 +15,36 @@ const CONFIRM = z
15
15
  .literal(true)
16
16
  .describe("Must be true. Destructive and irreversible — ask your human first.");
17
17
  export function registerRunTools(server, client) {
18
+ server.tool("start_workflow_run", "Start a real run of a workflow — the way to TEST a workflow you just " +
19
+ "authored. This EXECUTES: it runs the PUBLISHED workflow against live " +
20
+ "infrastructure (models, connectors), so it can incur cost and cause real " +
21
+ "side effects. It does not run your unpublished draft. After starting, " +
22
+ "follow it with read_run / read_run_trace / read_run_cost. Optionally pass " +
23
+ "triggerInput to feed the workflow's trigger.", {
24
+ workflowId: z.string().describe("The workflow's id."),
25
+ triggerInput: z
26
+ .record(z.unknown())
27
+ .optional()
28
+ .describe("Input payload for the workflow's trigger. Omit for none."),
29
+ manualPhases: z
30
+ .boolean()
31
+ .optional()
32
+ .describe("Run with manual phase gating. Defaults to false."),
33
+ }, async ({ workflowId, triggerInput, manualPhases }) => guard(async () => jsonResult(await client.post(`/api/v1/workflows/${workflowId}/runs`, {
34
+ ...(triggerInput ? { triggerInput } : {}),
35
+ ...(manualPhases === undefined ? {} : { manualPhases }),
36
+ }))));
37
+ server.tool("cancel_run", "Cancel an in-flight run. Stops further steps; already-completed steps and " +
38
+ "their side effects are not undone.", { runId: z.string().describe("The run's id.") }, async ({ runId }) => guard(async () => jsonResult(await client.post(`/api/v1/runs/${runId}/cancel`))));
39
+ server.tool("delete_run", "Delete ONE run. IRREVERSIBLE — the run and its trace and cost history go " +
40
+ "with it. Prefer archive_run unless a human has asked for deletion. For " +
41
+ "many at once use bulk_delete_runs.", {
42
+ runId: z.string().describe("The run's id."),
43
+ confirm: CONFIRM,
44
+ }, async ({ runId }) => guard(async () => {
45
+ await client.del(`/api/v1/runs/${runId}`);
46
+ return jsonResult({ deleted: true, runId });
47
+ }));
18
48
  server.tool("list_runs", "List workflow runs across the tenant, newest first. Archived runs are " +
19
49
  "excluded unless includeArchived is true. To list runs of ONE workflow, " +
20
50
  "use list_workflow_runs instead — this route has no workflow filter.", {
@@ -1 +1 @@
1
- {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/tools/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,GAAG,CAAC;KACd,OAAO,CAAC,IAAI,CAAC;KACb,QAAQ,CAAC,oEAAoE,CAAC,CAAC;AAElF,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAqB;IACvE,MAAM,CAAC,IAAI,CACT,WAAW,EACX,wEAAwE;QACtE,yEAAyE;QACzE,qEAAqE,EACvE;QACE,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,gEAAgE,CACjE;QACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAA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MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CACvE,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,0EAA0E;QACxE,yEAAyE;QACzE,6EAA6E;QAC7E,wEAAwE,EAC1E;QACE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC9E,OAAO,EAAE,OAAO;KACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CACnB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CACtE,CACJ,CAAC;AACJ,CAAC"}
@@ -84,6 +84,17 @@ export function registerVersionTools(server, client, { singular, basePath, publi
84
84
  .string()
85
85
  .describe(`The version row's UUID, from list_deleted_${singular}_versions.`),
86
86
  }, async ({ id, versionId }) => guard(async () => jsonResult(await client.post(`${basePath}/${id}/versions/${versionId}/restore-deleted`))));
87
+ server.tool(`name_${singular}_major_version`, `Give a ${singular}'s major version a name — label a release so it is easy to ` +
88
+ `find in history. Targets a MAJOR version by its integer number (from ` +
89
+ `list_${singular}_versions), not a checkpoint or a versionId. This only ` +
90
+ `renames; it does not create, publish, or roll anything back.`, {
91
+ id: z.string().describe(`The ${singular}'s id.`),
92
+ majorVersion: z
93
+ .number()
94
+ .int()
95
+ .describe("The major version's integer number, e.g. 2."),
96
+ name: z.string().min(1).max(255).describe("The new name for that major version."),
97
+ }, async ({ id, majorVersion, name }) => guard(async () => jsonResult(await client.patch(`${basePath}/${id}/versions/major/${majorVersion}`, { name }))));
87
98
  server.tool(`read_${singular}_published`, `Read the LIVE published version of a ${singular} — what the runtime ` +
88
99
  `actually uses, as opposed to the draft that read_${singular} returns. ` +
89
100
  `Diff the two to see what a pending publish would change.`, { id: z.string().describe(`The ${singular}'s id.`) }, async ({ id }) => guard(async () => jsonResult(await client.get(publishedPath === "entity"
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/tools/versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,+EAA+E;AAC/E,MAAM,OAAO,GAAG,CAAC;KACd,OAAO,CAAC,IAAI,CAAC;KACb,QAAQ,CAAC,gEAAgE,CAAC,CAAC;AAe9E,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,MAAqB,EACrB,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAmB;IAEtD,MAAM,CAAC,IAAI,CACT,QAAQ,QAAQ,WAAW,EAC3B,UAAU,QAAQ,0DAA0D;QAC1E,yEAAyE;QACzE,WAAW,QAAQ,WAAW,EAChC;QACE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,CAAC;QAChD,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;aACpC,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;QACnD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC1E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,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AA0D,EAC5D,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,QAAQ,QAAQ,CAAC,EAAE,EACpD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CACf,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,GAAG,CACd,aAAa,KAAK,QAAQ;QACxB,CAAC,CAAC,GAAG,QAAQ,IAAI,EAAE,YAAY;QAC/B,CAAC,CAAC,GAAG,QAAQ,IAAI,EAAE,qBAAqB,CAC3C,CACF,CACF,CACJ,CAAC;AACJ,CAAC"}
@@ -20,6 +20,10 @@
20
20
  import { z } from "zod";
21
21
  import { AxonityApiError } from "../errors.js";
22
22
  import { guard, jsonResult } from "./result.js";
23
+ /** A required literal — an agent cannot satisfy it by filling in a default. */
24
+ const CONFIRM = z
25
+ .literal(true)
26
+ .describe("Must be true. Acknowledges you understand this is destructive.");
23
27
  /**
24
28
  * Split one command into the `{ type, payload }` pair the backend expects.
25
29
  *
@@ -113,5 +117,24 @@ export function registerWorkflowMutations(server, client) {
113
117
  expectedVersion,
114
118
  document,
115
119
  }))));
120
+ server.tool("read_workflow_trigger_parameters", "Read the input parameters a workflow's triggers expect — what a caller must " +
121
+ "supply to start it. Use this before authoring a webhook/cron/conditional " +
122
+ "trigger, or before start_workflow_run, so the trigger input matches. Read-only.", { workflowId: z.string().describe("The workflow's id.") }, async ({ workflowId }) => guard(async () => jsonResult(await client.get(`/api/v1/workflows/${workflowId}/trigger-parameters`))));
123
+ server.tool("bulk_delete_workflows", "Soft-delete several workflows at once (each recoverable with " +
124
+ "restore_workflow, like single delete_workflow). Each target needs its own " +
125
+ "current version for optimistic locking — read each first. Returns a " +
126
+ "per-workflow success/error result; a partial failure is possible.", {
127
+ workflows: z
128
+ .array(z.object({
129
+ id: z.string().describe("The workflow's id."),
130
+ expectedVersion: z
131
+ .number()
132
+ .int()
133
+ .describe("That workflow's last-read version — 409 if stale."),
134
+ }))
135
+ .min(1)
136
+ .describe("The workflows to delete, each with its expectedVersion."),
137
+ confirm: CONFIRM,
138
+ }, async ({ workflows }) => guard(async () => jsonResult(await client.post("/api/v1/workflows/bulk-delete", { workflows }))));
116
139
  }
117
140
  //# sourceMappingURL=workflowMutations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflowMutations.js","sourceRoot":"","sources":["../../src/tools/workflowMutations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUhD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,QAAiC,EACjC,KAAa;IAEb,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC;IAE5C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACb,aAAa,KAAK,wDAAwD,CAC3E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9E,MAAM,IAAI,KAAK,CAAC,aAAa,KAAK,kCAAkC,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAkC,EAAE,CAAC;IAC/D,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACjC,CAAC;AAED,gFAAgF;AAChF,SAAS,aAAa,CACpB,KAAa,EACb,KAAa,EACb,IAAY,EACZ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AS,EAAE,CAAC;aACT,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;YACP,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YAC7C,eAAe,EAAE,CAAC;iBACf,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,QAAQ,CAAC,mDAAmD,CAAC;SACjE,CAAC,CACH;aACA,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,yDAAyD,CAAC;QACtE,OAAO,EAAE,OAAO;KACjB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CACtB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAC9E,CACJ,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axonity-ai/mcp",
3
- "version": "0.2.2",
3
+ "version": "0.3.3",
4
4
  "description": "Model Context Protocol server for Axonity Flow — lets an external agent (e.g. Claude Code) read, draft, and update workflows, agents and tools in an Axonity tenant.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,7 +20,8 @@
20
20
  ],
21
21
  "type": "module",
22
22
  "bin": {
23
- "axonity-mcp": "dist/index.js"
23
+ "axonity-mcp": "dist/index.js",
24
+ "mcp": "dist/index.js"
24
25
  },
25
26
  "files": [
26
27
  "dist"
@@ -47,6 +48,6 @@
47
48
  "@types/node": "^20.14.0",
48
49
  "tsx": "^4.16.0",
49
50
  "typescript": "^5.5.0",
50
- "vitest": "^2.0.0"
51
+ "vitest": "^4.1.10"
51
52
  }
52
53
  }