@axonity-ai/mcp 0.16.0 → 0.17.1

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
@@ -284,6 +284,29 @@ across these routes — the tool parameter names say which.
284
284
  It names the concept it means in `concept`, and the questions it answers
285
285
  in `questions`. `read_measure_design` now returns a table's columns and
286
286
  time axis only; `list_measures({ tableId })` says which measures read it.
287
+ - **A measure is one formula**, `definition.expression`:
288
+ `sum(orders.amount)`, `[revenue_d2c] + [revenue_retail]`,
289
+ `divide([cm1], [net_revenue])`. `get_measure_formula_spec` is the only
290
+ list of its words — the platform's own, the one its editor shows — and
291
+ with `includeWorkspace: true` also this workspace's measures, tables and
292
+ columns. `validate_measure` checks a formula without saving it and answers
293
+ with every problem by code. `read_measure` returns the formula as text
294
+ beside the stored tree and the aggregations it folds down to. The fields
295
+ from before the formula (`tableId`, `clearTable`, `aggregation`,
296
+ `column`, `numerator`, `denominator`) are refused with `legacy_field`.
297
+ - **Time over a date table**: `create_data_table` / `update_data_table`
298
+ take `dateTable: true` and `calendars` (name, the column per grain, one
299
+ default) — what `shift`, `to_date`, `rolling` and `running` are measured
300
+ in. `read_measure_design` shows them.
301
+ - **Explaining a number**: `query_measures` takes `explain: true` (what
302
+ each part of the formula gave, on the total, per period and per group)
303
+ and `useDraftChain`; a refusal carries its `code`. `read_measure` says
304
+ what a measure rests on (`dependsOn`) and what rests on it (`usedBy`,
305
+ `dashboards`). `delete_measure` is refused with `still_referenced`,
306
+ publishing with `depends_on_unpublished` / `unverified_relationship`
307
+ (the approval names what moves with it in `changesWith`), and a table or
308
+ relationship change that would break a published measure with
309
+ `breaks_measure`.
287
310
  - **Concepts**: `list_concepts`, `create_concept`, `update_concept`,
288
311
  `delete_concept` — kind (concept, state, metric, rule), name, meaning,
289
312
  synonyms, what it refers to, owner. They are rows of one table the
package/dist/contract.js CHANGED
@@ -90,6 +90,8 @@ export const PROBE_VARIANTS = [
90
90
  // validate_workflow — exactly one of the two, never both.
91
91
  { document: undefined },
92
92
  { workflowId: undefined },
93
+ // get_measure_formula_spec — the workspace's vocabulary only when asked.
94
+ { includeWorkspace: true },
93
95
  ];
94
96
  /**
95
97
  * Every route this build's tools call, found by replaying them.
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAoB/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4B;IACjD,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG;IAChF,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IACzE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;IAC1E,YAAY,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG;IAC/D,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,EAAE,qBAAqB,EAAE,CAAC;IACnE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IACzD,SAAS,EAAE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;QAC5D,0EAA0E;QAC1E,kEAAkE;QAClE,8DAA8D,CACjE,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ import { reportContractSkew } from "./contract.js";
25
25
  import { registerConventions } from "./tools/conventions.js";
26
26
  import { registerDashboardTools, registerDataSourceTools, registerMeasureTools, } from "./tools/dataSources.js";
27
27
  import { registerDataTableTools } from "./tools/dataTables.js";
28
+ import { assertFormulaShape, registerMeasureFormulaTools } from "./tools/measureFormula.js";
28
29
  import { assertPlaceholderCredentials } from "./tools/credentials.js";
29
30
  import { registerAttachTools, registerCatalogTools, registerConnectorTools, registerDependencyTools, registerPersonaTools, } from "./tools/extras.js";
30
31
  import { registerAuthoringSpecTools } from "./tools/authoringSpec.js";
@@ -62,6 +63,68 @@ const PROVENANCE_NOTE = "WHERE THE ROWS COME FROM — `provenance`, for a dynami
62
63
  "\n\nMEASURES ARE NOT ON THE TABLE. A measure is its own entity " +
63
64
  "(create_measure); a table carries only its `timeAxis` " +
64
65
  "(`{ column, grain }`), which every measure over it reads.";
66
+ /**
67
+ * The date table and its calendars (axonity-flow#1908, phase 2): what a time
68
+ * window in a formula is measured in. Metadata on a table, not an entity.
69
+ */
70
+ /** What a change to the model may do to a published measure (axonity-flow#1908). */
71
+ const BREAKS_MEASURE_NOTE = "`breaks_measure`: refused when a PUBLISHED measure reads what this " +
72
+ "change takes away — a column, the table, or the relationship a part " +
73
+ "reaches a dimension over. The refusal names the measures: repair them " +
74
+ "first (update_measure, then publish), then retry.";
75
+ const DATE_TABLE_NOTE = "THE DATE TABLE — `dateTable: true` marks the ONE table of the workspace " +
76
+ "with a row per day (its `timeAxis` on the day column, grain `day`, no " +
77
+ "gaps): what makes a week mean the same thing to every fact. A second one " +
78
+ "is refused. On it, `calendars` (at most 10): " +
79
+ "`[{ name, label?, isDefault?, grains: { year?, quarter?, month?, week?, " +
80
+ "day? } }]`, each grain naming the column of this table that holds that " +
81
+ "period — e.g. a calendar `production` whose `week` is the production " +
82
+ "week. `name` is what a formula writes (`rolling([revenue], 4 week, " +
83
+ "production)`); exactly one is `isDefault`, used when a formula names " +
84
+ "none. A grain left out is a grain that calendar does not have. A formula " +
85
+ "stores its calendar BY ID: when you change `calendars`, read the table " +
86
+ "first and send every calendar back WITH its `id` — the list is replaced " +
87
+ "whole, and a calendar sent without one is a new calendar. " +
88
+ "`dateTable: false` takes the calendars with it. A fact table reaches " +
89
+ "the date table through its own `timeAxis`.";
90
+ /**
91
+ * What writing a measure takes (axonity-flow#1908). The contract, not a manual:
92
+ * the words of the formula are in get_measure_formula_spec and nowhere else.
93
+ */
94
+ const MEASURE_NOTE = "READ get_measure_formula_spec FIRST; never write a function, operator or " +
95
+ "grain from memory. A measure is ONE formula, `definition.expression`, " +
96
+ "as text or as the stored tree. Four kinds, one grammar: " +
97
+ "\n- a BASE aggregates one COLUMN of one table: " +
98
+ "`sum(orders.amount) where orders.channel = 'd2c'`. It reads a column, " +
99
+ "never a calculation per row — a value per row belongs in the table's " +
100
+ "source query (`provenance.sql`), as a column of its own; " +
101
+ "\n- a DERIVED measure computes with other measures by name: " +
102
+ "`[revenue_d2c] + [revenue_retail]`, `divide([cm1], [net_revenue])`, " +
103
+ "`divide([revenue_d2c], [net_revenue] ignore orders.channel)` for a share " +
104
+ "of the total. Two fact tables may meet in one number; they are never " +
105
+ "joined; " +
106
+ "\n- TIME (`shift`, `to_date`, `rolling`) and CUMULATIVE (`running`): " +
107
+ "the same measure in another window, measured in a calendar of the " +
108
+ "workspace's date table (create_data_table / update_data_table with " +
109
+ "`dateTable` and `calendars`); without one they are refused with " +
110
+ "`no_date_table`. " +
111
+ "\n\nBuild bottom-up: the base measures first, each with its `quantity` " +
112
+ "(what it counts: EUR, customers, orders), then the derived ones; " +
113
+ "validate_measure before every save, and publish from the bottom up. " +
114
+ "\n\nFields: `label` (what a tile shows), `description` (what the number " +
115
+ "means — mandatory, an agent reads it to decide whether this is the " +
116
+ "number asked for), `definition`, `concept` (the NAME of the concept this " +
117
+ "number means — it must exist, create_concept first, and a derived " +
118
+ "measure needs one too), `questions` (what it answers, in the words " +
119
+ "someone would ask) and optionally `name`, the handle — derived from the " +
120
+ "label when omitted and unique in the workspace. `definition` is " +
121
+ "`{ expression, quantity?, format?, direction?, target?, watchMargin? }`; " +
122
+ "`quantity` is derived for a formula over measures. " +
123
+ "\n\nThe fields from before the formula — `tableId`, `clearTable`, " +
124
+ "`definition.aggregation`, `column`, `numerator`, `denominator` — are " +
125
+ "refused with `legacy_field`. " +
126
+ "\n\nIt is a DRAFT until published: request_publish_measure. Only a " +
127
+ "published measure gives a certified number.";
65
128
  /**
66
129
  * The entities the connector covers. Core entities (C4), memory entities (C5)
67
130
  * — skills, policies, reference docs — which have the same draft→publish
@@ -163,8 +226,12 @@ const ENTITIES = [
163
226
  label: "tables (authored reference data agents and decisions read)",
164
227
  deleteVersionParam: "expected_version",
165
228
  listPaging: { defaultPageSize: 20, maxPageSize: 200 },
166
- createNote: PROVENANCE_NOTE,
229
+ createNote: `${PROVENANCE_NOTE}\n\n${DATE_TABLE_NOTE}`,
230
+ deleteNote: BREAKS_MEASURE_NOTE,
231
+ publishNote: BREAKS_MEASURE_NOTE,
167
232
  updateWarning: PROVENANCE_NOTE +
233
+ "\n\n" +
234
+ DATE_TABLE_NOTE +
168
235
  " Sending `provenance` replaces it whole; `clearProvenance: true` " +
169
236
  "takes the source away and leaves the rows that are there. " +
170
237
  "\n\n`rows` AND `columns` ARE WHOLE-COLLECTION FIELDS: sending either " +
@@ -185,24 +252,26 @@ const ENTITIES = [
185
252
  label: "measures (the agreed definition of one number in the model)",
186
253
  deleteVersionParam: "expectedVersion",
187
254
  listPaging: { defaultPageSize: 20, maxPageSize: 200 },
188
- createNote: "Fields: `label` (what a tile shows), `description` (what the number " +
189
- "means — mandatory, an agent reads it to decide whether this is the " +
190
- "number asked for), `definition` (the calculation), `tableId` (the " +
191
- "table it reads; omit only for a ratio whose two sides each name their " +
192
- "own `table`), `concept` (the NAME of the concept this number means — " +
193
- "it must exist, create_concept first), `questions` (what it answers, " +
194
- "in the words someone would ask) and optionally `name`, the handle — " +
195
- "derived from the label when omitted and unique in the workspace. " +
196
- "\n\n`definition` is `{ aggregation, column?, numerator?, " +
197
- "denominator?, filters?, format?, direction?, target?, watchMargin? }`: " +
198
- "aggregation is sum, average, count, count_distinct, min, max, latest " +
199
- "(the value at the last date of each period — for a stock) or ratio " +
200
- "(numerator ÷ denominator, each `{ aggregation, column?, table?, " +
201
- "filters? }`). A filter is `{ column, operator, value }`. Column names " +
202
- "come from read_measure_design. A wrong combination is refused with a " +
203
- "422 that says why. " +
204
- "\n\nIt is a DRAFT until published: request_publish_measure. Only a " +
205
- "published measure gives a certified number.",
255
+ // read_measure is in tools/measureFormula.ts: it asks the platform to
256
+ // write the stored tree back as formula text, which a plain GET cannot.
257
+ readable: false,
258
+ guardFields: assertFormulaShape,
259
+ createNote: MEASURE_NOTE,
260
+ deleteNote: "`still_referenced`: a measure other measures rest on is refused, " +
261
+ "with their names. Change or delete those first — the one furthest " +
262
+ "from it first. read_measure's `usedBy` lists them beforehand.",
263
+ publishNote: "Certified is the WHOLE chain: refused with `depends_on_unpublished` " +
264
+ "(a measure it rests on is not published — publish from the bottom " +
265
+ "up) or `unverified_relationship` (a part reaches a table over a " +
266
+ "relationship nobody verified — verify it first). The approval's " +
267
+ "`changesWith` names what moves with it: the measures that rest on " +
268
+ "it (`measures`, the whole chain above) and the dashboards with a " +
269
+ "tile on any of them (`dashboards`). Say so in `changeSummary` when " +
270
+ "it is not empty.",
271
+ updateWarning: MEASURE_NOTE +
272
+ " `tableId` and `clearTable` are gone: a measure has no home table, " +
273
+ "the tables it reads follow from its formula. Sending `definition` " +
274
+ "replaces it whole, so send the `expression` with it.",
206
275
  },
207
276
  // The three below arrived with axonity-flow#1849 (axonity-mcp#78). None is
208
277
  // versioned or publish-approved: a change is live the moment it is saved, so
@@ -243,6 +312,7 @@ const ENTITIES = [
243
312
  hasDiscardDraft: false,
244
313
  deleteVersionParam: "expected_version",
245
314
  listPaging: { defaultPageSize: 20, maxPageSize: 200 },
315
+ deleteNote: BREAKS_MEASURE_NOTE,
246
316
  createNote: "Fields: `fromTableId` + `fromColumn` (the MANY side — the facts, e.g. " +
247
317
  "orders), `toTableId` + `toColumn` (the ONE side — e.g. countries), " +
248
318
  "`cardinality` (many_to_one, the default, or one_to_one; there is no " +
@@ -342,6 +412,7 @@ export function registerAll(server, client) {
342
412
  registerDataTableTools(server, client);
343
413
  registerDataSourceTools(server, client);
344
414
  registerMeasureTools(server, client);
415
+ registerMeasureFormulaTools(server, client);
345
416
  registerDashboardTools(server, client);
346
417
  registerConceptTools(server, client);
347
418
  registerComponentTools(server, client);
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,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB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,CAAC,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -55,6 +55,14 @@ export declare const PLACEMENT_ROUTE = "/api/v1/authoring/prompt-placement";
55
55
  export declare const SEMANTIC_KNOWLEDGE_ROUTE = "/api/v1/authoring/semantic-knowledge";
56
56
  /** Read this deploy's placement rules, or say why not. Exported for testing. */
57
57
  export declare function readPlacementRules(client: AxonityClient): Promise<string>;
58
+ /**
59
+ * How a measure is built and computed (axonity-flow#1908), carried by the
60
+ * connector beside the served rules. It names no word of the formula: those are
61
+ * in `get_measure_formula_spec`, the platform's one list. What it keeps is what
62
+ * the spec does not say — where a calculation belongs, and how a number made
63
+ * of parts is computed — so an agent does not have to infer it from recipes.
64
+ */
65
+ export declare const MEASURE_FORMULA_SECTION = "## A measure is one formula\n\nThe words of a formula \u2014 functions, operators, grains, limits, every refusal\ncode with its fix, and recipes \u2014 are in `get_measure_formula_spec`. Read it\nbefore writing a measure, and never write a word from memory. With\n`includeWorkspace: true` it also lists this workspace's measures, tables,\ncolumns and the dimensions each table reaches.\n\n**Four kinds, one grammar.**\n\n- **Base** \u2014 one aggregation over one column of one table, optionally with\n `where`. It reads a column, never a calculation per row.\n- **Derived** \u2014 arithmetic over other measures by name: a sum over two facts,\n a margin, a share of the total with `ignore`.\n- **Time** and **cumulative** \u2014 the same measure in another window, or a\n running total, measured in a calendar of the workspace's date table.\n\n**Time runs over one date table.** One table per workspace is the date table\n(`dateTable: true`, a row per day), and its `calendars` say which column\nholds the year, quarter, month, week and day \u2014 a production calendar is just\nanother calendar. Every fact reaches it through its own time axis, so a week\nmeans the same thing to each of them. A series runs over the calendar's\nperiods: a period without rows is shown empty, not left out. A window's total\nis the window ending at the end of the period asked for; a running total per\nmonth is the standing at the end of each month, never their sum. A fact kept\nper month is not asked per week (`grain_too_fine`).\n\n**Row logic belongs in the table's source query, not in a measure.** A value\nper row (net = gross \u2212 discount) is a column, added to the table's\n`provenance.sql` and described like any other column. A measure is computed\nper question \u2014 period, grain, split, filters \u2014 and is never stored.\n\n**How a number is computed.** Each leaf is aggregated on its own table, over\nthe dimensions it reaches through declared many-to-one relationships. The\nresults are combined per group; two fact tables are never joined to each\nother. The formula is then applied per group, and the TOTAL is computed again\nover the whole period \u2014 never the sum or the average of the groups.\n\n**Refused, never guessed.** A dimension a leaf cannot reach, a measure that\nrests on itself, euros added to dogs, a format that does not fit what the\nnumber counts: each is refused with a code. `validate_measure` returns them\nbefore you save; repair on the code before asking a person.\n\n**Explain a number by its parts.** `query_measures` with `explain: true`\ngives what each part of the formula answered, on the total and per period and\ngroup. Use it to say why a number moved, instead of reading rows.\n\n**Order.** Base measures first, each with its `quantity`; then the derived\nones; `validate_measure` before every save; publish from the bottom up \u2014 a\npublished measure over an unpublished one is refused. A measure knows what\nrests on it (`usedBy`, `dashboards` on `read_measure`): read that before\nyou change or delete one, because those numbers move with it.\n";
58
66
  /** Read this deploy's semantic-knowledge rules, or say why not. Exported for testing. */
59
67
  export declare function readSemanticKnowledgeRules(client: AxonityClient): Promise<string>;
60
68
  export declare function registerConventions(server: McpServer, client: AxonityClient): void;
@@ -1043,9 +1043,74 @@ async function readServedRules(client, route, what, unavailable) {
1043
1043
  export async function readPlacementRules(client) {
1044
1044
  return readServedRules(client, PLACEMENT_ROUTE, "prompt-element placement rules", PLACEMENT_UNAVAILABLE);
1045
1045
  }
1046
+ /**
1047
+ * How a measure is built and computed (axonity-flow#1908), carried by the
1048
+ * connector beside the served rules. It names no word of the formula: those are
1049
+ * in `get_measure_formula_spec`, the platform's one list. What it keeps is what
1050
+ * the spec does not say — where a calculation belongs, and how a number made
1051
+ * of parts is computed — so an agent does not have to infer it from recipes.
1052
+ */
1053
+ export const MEASURE_FORMULA_SECTION = `## A measure is one formula
1054
+
1055
+ The words of a formula — functions, operators, grains, limits, every refusal
1056
+ code with its fix, and recipes — are in \`get_measure_formula_spec\`. Read it
1057
+ before writing a measure, and never write a word from memory. With
1058
+ \`includeWorkspace: true\` it also lists this workspace's measures, tables,
1059
+ columns and the dimensions each table reaches.
1060
+
1061
+ **Four kinds, one grammar.**
1062
+
1063
+ - **Base** — one aggregation over one column of one table, optionally with
1064
+ \`where\`. It reads a column, never a calculation per row.
1065
+ - **Derived** — arithmetic over other measures by name: a sum over two facts,
1066
+ a margin, a share of the total with \`ignore\`.
1067
+ - **Time** and **cumulative** — the same measure in another window, or a
1068
+ running total, measured in a calendar of the workspace's date table.
1069
+
1070
+ **Time runs over one date table.** One table per workspace is the date table
1071
+ (\`dateTable: true\`, a row per day), and its \`calendars\` say which column
1072
+ holds the year, quarter, month, week and day — a production calendar is just
1073
+ another calendar. Every fact reaches it through its own time axis, so a week
1074
+ means the same thing to each of them. A series runs over the calendar's
1075
+ periods: a period without rows is shown empty, not left out. A window's total
1076
+ is the window ending at the end of the period asked for; a running total per
1077
+ month is the standing at the end of each month, never their sum. A fact kept
1078
+ per month is not asked per week (\`grain_too_fine\`).
1079
+
1080
+ **Row logic belongs in the table's source query, not in a measure.** A value
1081
+ per row (net = gross − discount) is a column, added to the table's
1082
+ \`provenance.sql\` and described like any other column. A measure is computed
1083
+ per question — period, grain, split, filters — and is never stored.
1084
+
1085
+ **How a number is computed.** Each leaf is aggregated on its own table, over
1086
+ the dimensions it reaches through declared many-to-one relationships. The
1087
+ results are combined per group; two fact tables are never joined to each
1088
+ other. The formula is then applied per group, and the TOTAL is computed again
1089
+ over the whole period — never the sum or the average of the groups.
1090
+
1091
+ **Refused, never guessed.** A dimension a leaf cannot reach, a measure that
1092
+ rests on itself, euros added to dogs, a format that does not fit what the
1093
+ number counts: each is refused with a code. \`validate_measure\` returns them
1094
+ before you save; repair on the code before asking a person.
1095
+
1096
+ **Explain a number by its parts.** \`query_measures\` with \`explain: true\`
1097
+ gives what each part of the formula answered, on the total and per period and
1098
+ group. Use it to say why a number moved, instead of reading rows.
1099
+
1100
+ **Order.** Base measures first, each with its \`quantity\`; then the derived
1101
+ ones; \`validate_measure\` before every save; publish from the bottom up — a
1102
+ published measure over an unpublished one is refused. A measure knows what
1103
+ rests on it (\`usedBy\`, \`dashboards\` on \`read_measure\`): read that before
1104
+ you change or delete one, because those numbers move with it.
1105
+ `;
1046
1106
  /** Read this deploy's semantic-knowledge rules, or say why not. Exported for testing. */
1047
1107
  export async function readSemanticKnowledgeRules(client) {
1048
- return readServedRules(client, SEMANTIC_KNOWLEDGE_ROUTE, "rules for writing the semantic layer", SEMANTIC_KNOWLEDGE_UNAVAILABLE);
1108
+ const rules = await readServedRules(client, SEMANTIC_KNOWLEDGE_ROUTE, "rules for writing the semantic layer", SEMANTIC_KNOWLEDGE_UNAVAILABLE);
1109
+ // Without the served rules the answer is "do not build", and a section on
1110
+ // how to build measures beside it would contradict that.
1111
+ if (rules === SEMANTIC_KNOWLEDGE_UNAVAILABLE)
1112
+ return rules;
1113
+ return `${rules}\n\n${MEASURE_FORMULA_SECTION}`;
1049
1114
  }
1050
1115
  export function registerConventions(server, client) {
1051
1116
  server.tool("axonity_conventions", "Read the authoring conventions BEFORE creating or updating anything: the " +
@@ -1068,8 +1133,10 @@ export function registerConventions(server, client) {
1068
1133
  "what a word or a number means. Returns this deploy's rules for writing " +
1069
1134
  "it: what a concept owes, what a measure's description and questions " +
1070
1135
  "must say, and what a table's grain must say about one row. Read live " +
1071
- "from the platform on every call, with its rulesVersion. Not needed for " +
1072
- "anything else.", {}, async () => ({
1136
+ "from the platform on every call, with its rulesVersion. Ends with how " +
1137
+ "a measure is built as one formula and how a number made of parts is " +
1138
+ "computed; the formula's words are in get_measure_formula_spec. Not " +
1139
+ "needed for anything else.", {}, async () => ({
1073
1140
  content: [{ type: "text", text: await readSemanticKnowledgeRules(client) }],
1074
1141
  }));
1075
1142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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ACpB,MAAM,EACN,eAAe,EACf,gCAAgC,EAChC,qBAAqB,CACtB,CAAC;AACJ,CAAC;AAED,yFAAyF;AACzF,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,MAAqB;IACpE,OAAO,eAAe,CACpB,MAAM,EACN,wBAAwB,EACxB,sCAAsC,EACtC,8BAA8B,CAC/B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,2EAA2E;QACzE,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,uEAAuE;QACvE,uEAAuE;QACvE,uEAAuE;QACvE,+DAA+D,EACjE,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,GAAG,WAAW,KAAK,MAAM,kBAAkB,CAAC,MAAM,CAAC,EAAE;aAC5D;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,8BAA8B,EAC9B,qEAAqE;QACnE,sEAAsE;QACtE,yEAAyE;QACzE,sEAAsE;QACtE,uEAAuE;QACvE,yEAAyE;QACzE,gBAAgB,EAClB,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;KACrF,CAAC,CACH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/tools/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAMH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;CAoDtC,CAAC;AAEF,yFAAyF;AACzF,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,MAAqB;IACpE,MAAM,KAAK,GAAG,MAAM,eAAe,CACjC,MAAM,EACN,wBAAwB,EACxB,sCAAsC,EACtC,8BAA8B,CAC/B,CAAC;IACF,0EAA0E;IAC1E,yDAAyD;IACzD,IAAI,KAAK,KAAK,8BAA8B;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,GAAG,KAAK,OAAO,uBAAuB,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,2EAA2E;QACzE,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,uEAAuE;QACvE,uEAAuE;QACvE,uEAAuE;QACvE,+DAA+D,EACjE,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,GAAG,WAAW,KAAK,MAAM,kBAAkB,CAAC,MAAM,CAAC,EAAE;aAC5D;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,8BAA8B,EAC9B,qEAAqE;QACnE,sEAAsE;QACtE,yEAAyE;QACzE,sEAAsE;QACtE,uEAAuE;QACvE,wEAAwE;QACxE,sEAAsE;QACtE,qEAAqE;QACrE,2BAA2B,EAC7B,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;KACrF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -101,7 +101,13 @@ export function registerMeasureTools(server, client) {
101
101
  "\n\nTHE MEASURES ARE NOT HERE. A measure belongs to the model, not " +
102
102
  "to one table: list_measures({ tableId }) answers which measures read " +
103
103
  "this table, and create_measure defines one. Read this for the column " +
104
- "names a measure's `definition`, `splitBy` or `filters` may use.", {
104
+ "names a measure's formula, `splitBy` or `filters` may use — or " +
105
+ "get_measure_formula_spec({ includeWorkspace: true }) for every " +
106
+ "table's columns at once. " +
107
+ "\n\nOn the workspace's date table it also says `dateTable: true` and " +
108
+ "its `calendars`, each naming the column that holds the year, quarter, " +
109
+ "month, week and day: what a time window (shift, to_date, rolling, " +
110
+ "running) can be measured in.", {
105
111
  tableId: z.string().describe("The dynamic table's id."),
106
112
  useDraft: z
107
113
  .boolean()
@@ -113,7 +119,7 @@ export function registerMeasureTools(server, client) {
113
119
  "own. Read-only. This is where a dashboard's numbers come from. " +
114
120
  "\n\nEach question is " +
115
121
  "`{ key, measure, tableId?, period?, start?, end?, compare?, grain?, " +
116
- "splitBy?, filters?, limit?, useDraft? }`. `key` is your own label and " +
122
+ "splitBy?, filters?, limit?, useDraft?, useDraftChain?, explain? }`. `key` is your own label and " +
117
123
  "comes back on the answer. `measure` is the measure's NAME — its " +
118
124
  "handle, unique in the workspace (list_measures); `tableId` is " +
119
125
  "optional and no longer what finds it. `period` is one of: " +
@@ -122,9 +128,35 @@ export function registerMeasureTools(server, client) {
122
128
  "(YYYY-MM-DD) for a custom range. `compare` is none, previous_period or " +
123
129
  "previous_year. `grain` (none, auto, day, week, month, quarter, year) " +
124
130
  "draws a series. `splitBy` names a column to group by; `limit` (1-50) " +
125
- "keeps the largest groups. " +
131
+ "keeps the largest groups. `useDraft` reads this measure's draft; " +
132
+ "`useDraftChain` also the drafts of the measures UNDER it — each part's " +
133
+ "`readFrom` then says which version it read. " +
134
+ "\n\nA MEASURE OVER OTHER MEASURES is computed per group: each of " +
135
+ "its parts is aggregated on its own table, and the formula is applied " +
136
+ "to the results. Its TOTAL is computed again over the whole period, " +
137
+ "never added up from the groups — the total of a margin % is total " +
138
+ "margin over total revenue, not the average of the monthly " +
139
+ "percentages. Report the total you are given; do not sum the series. " +
140
+ "A time window is the window ENDING at the end of the period asked " +
141
+ "for, and a running total per month is the standing at the end of " +
142
+ "each month, not their sum. " +
143
+ "\n\nTO EXPLAIN A NUMBER, ask `explain: true`: the answer's `leaves` " +
144
+ "are the parts of the formula (table, aggregation, conditions, window) " +
145
+ "and `parts` holds what each part gave for the total, in the order of " +
146
+ "`leaves` — and each point of `series` and each entry of `groups` " +
147
+ "carries its own `parts`. \"The margin fell\" is not an explanation; " +
148
+ "\"revenue held and cost rose\" is. Use it instead of reading rows. " +
126
149
  "\n\nONE BAD QUESTION DOES NOT FAIL THE CALL: every answer carries " +
127
- "`ok`, and `ok: false` comes with an `error` of its own. Check each one. " +
150
+ "`ok`, and `ok: false` comes with an `error` of its own and, where it " +
151
+ "has one, a `code` from get_measure_formula_spec — `grain_too_fine` " +
152
+ "(a fact kept per month asked per week: ask a coarser grain), " +
153
+ "`unreachable_dimension`, or `breaks_measure` (a column, table or " +
154
+ "relationship it reads is gone: the measure must be repaired, not the " +
155
+ "question). Check each one. `warnings` do not make it wrong but are " +
156
+ "worth saying: `empty_leaf` means one PART found no rows in this " +
157
+ "period — in a sum that side counts as nought, which is also what a " +
158
+ "feed that stopped loading looks like. A period with no rows in a " +
159
+ "series is shown empty, not left out. " +
128
160
  "\n\n`freshAsOf` says how old the newest row behind the number is; " +
129
161
  "`certified: false` means it was computed from a draft; `tables` names " +
130
162
  "every table the number came from. Say so when you " +
@@ -1 +1 @@
1
- {"version":3,"file":"dataSources.js","sourceRoot":"","sources":["../../src/tools/dataSources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,GAAG,sBAAsB,CAAC;AACvC,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAEpC,MAAM,SAAS,GA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AAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACjD,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,mDAAmD,CAAC;KACjE,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CACrB,KAAK,CAAC,KAAK,IAAI,EAAE,CACf,UAAU,CACR,MAAM,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC9E,CACF,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * A measure is one formula (axonity-mcp#83, the connector half of phase 1 of
3
+ * axonity-flow#1908).
4
+ *
5
+ * A measure used to be one aggregation over one table, or a division of two
6
+ * parts. It is now ONE expression over the model — `[net_revenue] -
7
+ * [variable_costs]`, `divide([cm1], [net_revenue])` — stored as a tree of ids
8
+ * and shown as text of names, the two one-to-one.
9
+ *
10
+ * **The words of the formula are not here.** They come from
11
+ * `GET /measures/formula-spec`, which the platform generates from the module
12
+ * that also parses — the same list its editor shows. A copy in this connector
13
+ * would be a second list, and two lists drift: the reason
14
+ * `get_workflow_authoring_spec` exists. `get_measure_formula_spec` forwards it
15
+ * untouched.
16
+ *
17
+ * **Checking is the platform's too.** `validate_measure` forwards to
18
+ * `POST /measures/validate`, the route the editor calls while somebody types,
19
+ * so an agent and a person can never disagree about whether a formula is
20
+ * acceptable. `read_measure` asks that same route for the leaves a stored tree
21
+ * folds down to; the text is the platform's own `formula` on the measure.
22
+ *
23
+ * The one rule held HERE is the shape of a write: a measure is written as
24
+ * `definition.expression`, and the fields from before the formula are refused
25
+ * with `legacy_field`. The platform refuses them too since its form writes only
26
+ * `expression`; the check stays here because a `definition` WITHOUT
27
+ * `expression` is still stored there as a `sum` nobody wrote.
28
+ */
29
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
30
+ import type { AxonityClient } from "../client.js";
31
+ /** The language: every word, operator, grain, limit, code and recipe. */
32
+ export declare const FORMULA_SPEC_ROUTE = "/api/v1/measures/formula-spec";
33
+ /** The vocabulary of THIS workspace: its measures, tables, columns, calendars. */
34
+ export declare const FORMULA_SYMBOLS_ROUTE = "/api/v1/measures/formula-symbols";
35
+ /** Check a formula without saving it. */
36
+ export declare const VALIDATE_ROUTE = "/api/v1/measures/validate";
37
+ /**
38
+ * Refuse a measure write in the shape from before the formula.
39
+ *
40
+ * Throws with `legacy_field` — the platform's own code for it, so an agent
41
+ * that repairs on codes reads the same word from either side. A `definition`
42
+ * without `expression` is refused too: the platform would quietly store it as
43
+ * a `sum`, which is a definition nobody wrote.
44
+ */
45
+ export declare function assertFormulaShape(fields: Record<string, unknown>): void;
46
+ export declare function registerMeasureFormulaTools(server: McpServer, client: AxonityClient): void;
@@ -0,0 +1,260 @@
1
+ /**
2
+ * A measure is one formula (axonity-mcp#83, the connector half of phase 1 of
3
+ * axonity-flow#1908).
4
+ *
5
+ * A measure used to be one aggregation over one table, or a division of two
6
+ * parts. It is now ONE expression over the model — `[net_revenue] -
7
+ * [variable_costs]`, `divide([cm1], [net_revenue])` — stored as a tree of ids
8
+ * and shown as text of names, the two one-to-one.
9
+ *
10
+ * **The words of the formula are not here.** They come from
11
+ * `GET /measures/formula-spec`, which the platform generates from the module
12
+ * that also parses — the same list its editor shows. A copy in this connector
13
+ * would be a second list, and two lists drift: the reason
14
+ * `get_workflow_authoring_spec` exists. `get_measure_formula_spec` forwards it
15
+ * untouched.
16
+ *
17
+ * **Checking is the platform's too.** `validate_measure` forwards to
18
+ * `POST /measures/validate`, the route the editor calls while somebody types,
19
+ * so an agent and a person can never disagree about whether a formula is
20
+ * acceptable. `read_measure` asks that same route for the leaves a stored tree
21
+ * folds down to; the text is the platform's own `formula` on the measure.
22
+ *
23
+ * The one rule held HERE is the shape of a write: a measure is written as
24
+ * `definition.expression`, and the fields from before the formula are refused
25
+ * with `legacy_field`. The platform refuses them too since its form writes only
26
+ * `expression`; the check stays here because a `definition` WITHOUT
27
+ * `expression` is still stored there as a `sum` nobody wrote.
28
+ */
29
+ import { z } from "zod";
30
+ import { guard, jsonResult } from "./result.js";
31
+ const MEASURES = "/api/v1/measures";
32
+ /** The language: every word, operator, grain, limit, code and recipe. */
33
+ export const FORMULA_SPEC_ROUTE = `${MEASURES}/formula-spec`;
34
+ /** The vocabulary of THIS workspace: its measures, tables, columns, calendars. */
35
+ export const FORMULA_SYMBOLS_ROUTE = `${MEASURES}/formula-symbols`;
36
+ /** Check a formula without saving it. */
37
+ export const VALIDATE_ROUTE = `${MEASURES}/validate`;
38
+ /** Top-level fields from before the formula: the measure's "home table". */
39
+ const LEGACY_TOP = ["tableId", "clearTable"];
40
+ /** Fields inside `definition` that the formula replaces. */
41
+ const LEGACY_DEFINITION = ["aggregation", "column", "numerator", "denominator"];
42
+ /** Present in the sense that matters: sent, and not a null that clears nothing. */
43
+ function isSent(value) {
44
+ return value !== undefined && value !== null && value !== false;
45
+ }
46
+ /**
47
+ * Refuse a measure write in the shape from before the formula.
48
+ *
49
+ * Throws with `legacy_field` — the platform's own code for it, so an agent
50
+ * that repairs on codes reads the same word from either side. A `definition`
51
+ * without `expression` is refused too: the platform would quietly store it as
52
+ * a `sum`, which is a definition nobody wrote.
53
+ */
54
+ export function assertFormulaShape(fields) {
55
+ const found = LEGACY_TOP.filter((key) => isSent(fields[key]));
56
+ const definition = fields.definition;
57
+ if (definition !== undefined && definition !== null) {
58
+ if (typeof definition !== "object" || Array.isArray(definition)) {
59
+ throw new Error("`definition` must be an object with an `expression`.");
60
+ }
61
+ const def = definition;
62
+ found.push(...LEGACY_DEFINITION.filter((key) => isSent(def[key])).map((key) => `definition.${key}`));
63
+ if (found.length === 0 && !isSent(def.expression)) {
64
+ throw new Error("legacy_field: `definition` has no `expression`. A measure is one " +
65
+ "formula — send it as `definition.expression`, e.g. " +
66
+ '"sum(orders.amount)" or "[net_revenue] - [variable_costs]". ' +
67
+ "Read get_measure_formula_spec for the words, and check it with " +
68
+ "validate_measure first.");
69
+ }
70
+ }
71
+ if (found.length === 0)
72
+ return;
73
+ throw new Error(`legacy_field: ${found.map((f) => `\`${f}\``).join(", ")} ` +
74
+ `${found.length === 1 ? "is" : "are"} the shape from before the formula. ` +
75
+ "A measure is one `definition.expression` now, and the tables it reads " +
76
+ "follow from it: `sum(orders.amount)` instead of `tableId` + " +
77
+ "`aggregation` + `column`, `divide(sum(a.x), sum(b.y))` instead of a " +
78
+ "`numerator` and a `denominator`, `… where table.column = 'value'` " +
79
+ "for a condition on one part. Remove these fields and write the " +
80
+ "formula — validate_measure checks it before you save.");
81
+ }
82
+ /**
83
+ * The stored tree, written back as text with its leaves, by the platform.
84
+ *
85
+ * The text is the measure's own `formula` — the platform writes it on every
86
+ * read since phase 4 — and the validate route's only where a deploy does not
87
+ * carry it yet. The leaves always come from the validate route: a read of the
88
+ * measure does not fold it.
89
+ *
90
+ * Best effort, and said so: a read must not fail because the explanation
91
+ * could not be produced. When it cannot, the measure comes back as stored with
92
+ * a sentence saying why its leaves are missing.
93
+ */
94
+ async function explainFormula(client, measure, useDraftChain) {
95
+ const expression = measure.definition?.expression;
96
+ const ownText = typeof measure.formula === "string" && measure.formula !== "" ? measure.formula : null;
97
+ if (expression === undefined || expression === null) {
98
+ return {
99
+ formula: null,
100
+ formulaNote: "This measure has no formula yet — it is still in the shape from " +
101
+ "before the formula. Write one with update_measure " +
102
+ "(`definition.expression`).",
103
+ };
104
+ }
105
+ try {
106
+ const checked = (await client.post(VALIDATE_ROUTE, {
107
+ expression,
108
+ measureId: typeof measure.id === "string" ? measure.id : undefined,
109
+ quantity: measure.definition?.quantity ?? undefined,
110
+ format: measure.definition?.format ?? undefined,
111
+ useDraftChain,
112
+ }));
113
+ return {
114
+ formula: {
115
+ text: ownText ?? checked.formula,
116
+ tree: expression,
117
+ leaves: checked.leaves ?? [],
118
+ quantity: checked.quantity ?? null,
119
+ problems: checked.problems ?? [],
120
+ chain: useDraftChain ? "drafts" : "published",
121
+ },
122
+ };
123
+ }
124
+ catch (err) {
125
+ return {
126
+ formula: { text: ownText, tree: expression },
127
+ formulaNote: `The ${ownText === null ? "formula text and its leaves" : "leaves"} could not be read from this deploy ` +
128
+ `(\`POST ${VALIDATE_ROUTE}\`: ${err instanceof Error ? err.message : String(err)}). ` +
129
+ "The stored tree is above.",
130
+ };
131
+ }
132
+ }
133
+ export function registerMeasureFormulaTools(server, client) {
134
+ server.tool("get_measure_formula_spec", "The ONLY valid list of words for a measure's formula — read it BEFORE " +
135
+ "create_measure or update_measure, and never write a function, " +
136
+ "operator or grain from memory. Read-only. " +
137
+ "\n\nServed by the platform from the code that parses a formula, so it " +
138
+ "is the same list its formula editor shows: per word its signature, " +
139
+ "what it returns, its quantity rule and an example; the operators, " +
140
+ "grains and limits; every refusal `code` with `when` and `fix`; " +
141
+ "`recipes` for the numbers a management team asks for (a sum over two " +
142
+ "facts, a margin %, a share of the total); and `buildOrder`. A word " +
143
+ "with `available: false` is coming and is refused by name " +
144
+ "(`not_yet_supported`) — do not use it. " +
145
+ "\n\n`includeWorkspace: true` adds THIS workspace's vocabulary as " +
146
+ "`workspace`: its measures (name, label, quantity, status), its tables " +
147
+ "and columns, which dimensions each table reaches, and the date " +
148
+ "table's calendars with the grains each one has — the names a " +
149
+ "formula may use. The answer is then `{ spec, workspace }`; without " +
150
+ "it, the spec itself.", {
151
+ includeWorkspace: z
152
+ .boolean()
153
+ .optional()
154
+ .describe("Also return this workspace's measures, tables, columns and " +
155
+ "reachable dimensions. Defaults to false."),
156
+ useDraftChain: z
157
+ .boolean()
158
+ .optional()
159
+ .describe("With includeWorkspace: include tables and measures that were never " +
160
+ "published. Defaults to false — a published number reads " +
161
+ "published definitions."),
162
+ }, async ({ includeWorkspace, useDraftChain }) => guard(async () => {
163
+ const spec = await client.get(FORMULA_SPEC_ROUTE);
164
+ if (!includeWorkspace)
165
+ return jsonResult(spec);
166
+ const workspace = await client.get(FORMULA_SYMBOLS_ROUTE, {
167
+ useDraftChain: useDraftChain ?? false,
168
+ });
169
+ return jsonResult({ spec, workspace });
170
+ }));
171
+ server.tool("validate_measure", "Check a measure's formula WITHOUT saving it — call it before every " +
172
+ "create_measure and update_measure. Read-only. The same check the " +
173
+ "platform's editor runs while somebody types. " +
174
+ "\n\nAnswers `{ ok, formula, expression, quantity, leaves, problems }`: " +
175
+ "`formula` is the one spelling of it (names resolved, the brackets " +
176
+ "that apply shown); `expression` the tree that would be stored; " +
177
+ "`quantity` what the number counts, derived; `leaves` every " +
178
+ "aggregation it folds down to — table, aggregation, column, the " +
179
+ "conditions and ignored dimensions on that part, and the measures " +
180
+ "walked to reach it. " +
181
+ "\n\nEach problem has a `code`, a `message` and `where` (an `offset` " +
182
+ "in the text, or a `path` in the tree). `severity: error` blocks " +
183
+ "saving; a warning does not. Repair on the code — " +
184
+ "get_measure_formula_spec lists every one with its `fix` — before you " +
185
+ "ask a person: `parse_error` (the message says what was expected " +
186
+ "where), `unknown_measure` / `unknown_table` / `unknown_column` " +
187
+ "(similar names are suggested), `ambiguous_column` (write " +
188
+ "table.column), `column_kind`, `arity`, `cycle` (the chain is in the " +
189
+ "message), `too_complex` (give a part its own name), " +
190
+ "`quantity_mismatch` (adding euros to dogs, or a format that does not " +
191
+ "fit), `unreachable_dimension` (declare the relationship, or write " +
192
+ "`ignore` to mean the total on purpose), `no_date_table` / " +
193
+ "`no_time_axis` (a time window needs the workspace's date table and a " +
194
+ "time axis on the table the part reads), `calendar_missing_grain` / " +
195
+ "`unknown_calendar` (map the grain in the calendar, or name one that " +
196
+ "exists), `stock_over_time` (a running total of a `latest` or `first` " +
197
+ "means nothing), `not_yet_supported`. " +
198
+ "\n\nEach leaf also says what it was read from (`readFrom`: every " +
199
+ "measure walked to reach it, then the table, each with the version " +
200
+ "read) and over which `window` — shift, to_date, rolling, running, " +
201
+ "with its calendar. Empty `window` is the period asked for. " +
202
+ "`quantity_generic` is a warning: the migration left the placeholder " +
203
+ "quantity — say what the number counts.", {
204
+ expression: z
205
+ .union([z.string(), z.record(z.unknown())])
206
+ .describe("The formula, as text (`divide([cm1], [net_revenue])`) or as the " +
207
+ "stored tree."),
208
+ measureId: z
209
+ .string()
210
+ .optional()
211
+ .describe("The measure being edited, when there is one — it is what makes a " +
212
+ "reference back to itself a `cycle`."),
213
+ quantity: z
214
+ .string()
215
+ .optional()
216
+ .describe("What the number counts, when you have said (EUR, customers, " +
217
+ "orders). Required on save for a single aggregation."),
218
+ format: z
219
+ .record(z.unknown())
220
+ .optional()
221
+ .describe("How it will be shown, as on the measure's `definition.format` — " +
222
+ "checked against what the number counts."),
223
+ useDraftChain: z
224
+ .boolean()
225
+ .optional()
226
+ .describe("Read the DRAFTS of the measures underneath instead of their " +
227
+ "published versions. Defaults to false, because a published " +
228
+ "number reads published definitions."),
229
+ }, async (body) => guard(async () => jsonResult(await client.post(VALIDATE_ROUTE, body))));
230
+ server.tool("read_measure", "Read one measure by id, including its current draft and version. Read " +
231
+ "before you update — you need the current version. " +
232
+ "\n\nIts formula comes back twice, from the platform: `formula.text` " +
233
+ "with names, as you would write it, and `formula.tree`, the stored " +
234
+ "form with ids. Beside them `formula.leaves` — the aggregations it " +
235
+ "folds down to, each on its own table — `formula.quantity`, and " +
236
+ "`formula.problems`: a measure that rests on a column or measure that " +
237
+ "has since gone says so here. `readsTables` follows from the leaves; " +
238
+ "there is no home table. " +
239
+ "\n\nWHAT IT IS CONNECTED TO: `dependsOn` is every measure it rests " +
240
+ "on — the whole chain, which publishing checks; `usedBy` every " +
241
+ "measure that rests on IT; `dashboards` every dashboard with a tile " +
242
+ "on it. Read `usedBy` and `dashboards` before you change or delete a " +
243
+ "measure: those numbers move with it.", {
244
+ id: z.string().describe("The measure's id."),
245
+ useDraftChain: z
246
+ .boolean()
247
+ .optional()
248
+ .describe("Resolve the measures it rests on from their drafts instead of " +
249
+ "their published versions. Defaults to false; set it for a " +
250
+ "measure whose parts were never published, or their names " +
251
+ "cannot be shown."),
252
+ }, async ({ id, useDraftChain }) => guard(async () => {
253
+ const measure = (await client.get(`${MEASURES}/${id}`));
254
+ return jsonResult({
255
+ ...measure,
256
+ ...(await explainFormula(client, measure, useDraftChain ?? false)),
257
+ });
258
+ }));
259
+ }
260
+ //# sourceMappingURL=measureFormula.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measureFormula.js","sourceRoot":"","sources":["../../src/tools/measureFormula.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAEpC,yEAAyE;AACzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,QAAQ,eAAe,CAAC;AAC7D,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,QAAQ,kBAAkB,CAAC;AACnE,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,QAAQ,WAAW,CAAC;AAErD,4EAA4E;AAC5E,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,YAAY,CAAU,CAAC;AACtD,4DAA4D;AAC5D,MAAM,iBAAiB,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,CAAU,CAAC;AAEzF,mFAAmF;AACnF,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC;AAClE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA+B;IAChE,MAAM,KAAK,GAAa,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,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ACH,aAAa,EAAE,CAAC;aACb,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CACP,8DAA8D;YAC5D,6DAA6D;YAC7D,qCAAqC,CACxC;KACJ,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,CACvF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,cAAc,EACd,wEAAwE;QACtE,oDAAoD;QACpD,sEAAsE;QACtE,oEAAoE;QACpE,oEAAoE;QACpE,iEAAiE;QACjE,uEAAuE;QACvE,sEAAsE;QACtE,0BAA0B;QAC1B,qEAAqE;QACrE,gEAAgE;QAChE,qEAAqE;QACrE,sEAAsE;QACtE,sCAAsC,EACxC;QACE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC5C,aAAa,EAAE,CAAC;aACb,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CACP,gEAAgE;YAC9D,4DAA4D;YAC5D,2DAA2D;YAC3D,kBAAkB,CACrB;KACJ,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAC9B,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,EAAE,EAAE,CAAC,CAAkB,CAAC;QACzE,OAAO,UAAU,CAAC;YAChB,GAAG,OAAO;YACV,GAAG,CAAC,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,IAAI,KAAK,CAAC,CAAC;SACnE,CAAC,CAAC;IACL,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -151,5 +151,17 @@ export interface EntityDef {
151
151
  * `config` keys come from the driver, and a guessed key is a 422.
152
152
  */
153
153
  createNote?: string;
154
+ /**
155
+ * Appended to `delete_<entity>`'s description when something else may hold
156
+ * it up and the refusal says what. Measures are the case that asked for it:
157
+ * a basis another measure rests on is refused with the list (#1908).
158
+ */
159
+ deleteNote?: string;
160
+ /**
161
+ * Appended to `request_publish_<entity>`'s description when publishing it
162
+ * can be refused for a reason outside the entity itself, or the approval
163
+ * carries more than its readiness.
164
+ */
165
+ publishNote?: string;
154
166
  }
155
167
  export declare function registerEntityTools(server: McpServer, client: AxonityClient, def: EntityDef): void;
@@ -137,7 +137,8 @@ export function registerEntityTools(server, client, def) {
137
137
  `list_${plural} until then). Read it first for its version. A 409 here ` +
138
138
  `may be a stale version (re-read and retry) or a reference conflict ` +
139
139
  `(something published still uses it — re-reading will not help; the ` +
140
- `error tells you which).`, {
140
+ `error tells you which).` +
141
+ (def.deleteNote ? `\n\n${def.deleteNote}` : ""), {
141
142
  id: z.string().describe(`The ${singular}'s id.`),
142
143
  expectedVersion: z
143
144
  .number()
@@ -164,7 +165,8 @@ export function registerEntityTools(server, client, def) {
164
165
  return;
165
166
  server.tool(`request_publish_${singular}`, `Request that a ${singular} be published. This does NOT publish it — it ` +
166
167
  `creates a pending approval a human approves in Axonity. Returns the ` +
167
- `pending approval (with its readiness).`, {
168
+ `pending approval (with its readiness).` +
169
+ (def.publishNote ? `\n\n${def.publishNote}` : ""), {
168
170
  id: z.string().describe(`The ${singular}'s id.`),
169
171
  changeSummary: z
170
172
  .string()
@@ -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,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AAM,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,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,EAAE,gBAAgB,CAAC,CAAC,CACjE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,CAAC,IAAI,CACT,mBAAmB,QAAQ,EAAE,EAC7B,kBAAkB,QAAQ,+CAA+C;QACvE,sEAAsE;QACtE,wCAAwC;QACxC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACnD;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axonity-ai/mcp",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
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": {