Skip to main content
Glama
dnic-dev

bw-modeling-mcp

by dnic-dev

bw_update_query_key_figures

Modify the key figure structure of an existing BW Query: add basic key figures, CKF/RKF references, local formulas, and nested members, set display and planning properties, or remove members in one save.

Instructions

Manage the key figure structure of an existing BW Query: add basic key figures, add references to reusable CKFs/RKFs (with optional local restrictions), add local formula members (recursive operator/operand tree), set member display and planning properties (decimals, scaling, hidden, sign inversion, input readiness, disaggregation, constant selection, local calculation) and exception aggregation, nest members and place them at a position, and remove members. All operations are applied in a single save. Member operations also apply to a reusable key figure structure referenced via bw_update_query_layout add_structure. All names must be technical names (e.g. "IOBJ_NAME", "CKF_NAME", "QUERY_NAME").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transportNoTransport request number (e.g. DEVK900123). Only needed when the query lives on a transportable package; omit for $TMP queries.
operationsYesKey figure changes to apply in one save cycle.
query_nameYesTechnical name of the query to modify (e.g. "QUERY_NAME").
structure_targetNoContainer for the key figure structure when it is created by the first add operation (default "columns"). Ignored once a structure already exists.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv1.7.1
    • changedInput schema / properties / operations / items / properties / exception_aggregation / description
      Previous value: -"Exception aggregation for the member (add_key_figure / add_ckf / add_rkf / add_formula). Shape: { \"type\": \"AVG\", \"reference_characteristic\": \"IOBJ_NAME\" }."New value: +"Exception aggregation of a local formula member (\"add_formula\" only). Shape: { \"type\": \"AVG\", \"reference_characteristic\": \"IOBJ_NAME\" } — the same shape bw_get_query reports per member. Refused on add_key_figure / add_ckf / add_rkf: a selection member has no calculation step, and the backend drops the setting without an error. For a CKF set it on the CKF itself with bw_create_ckf / bw_update_ckf — that is also the only place another CKF referencing it picks the setting up from."
    • addedInput schema / properties / operations / items / properties / exception_aggregation / properties / exclude
      Added value: +{
      +  "description": "Aggregate over all characteristics except the reference characteristics. Default false.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / operations / items / properties / exception_aggregation / properties / reference_characteristic / description
      Previous value: -"Reference characteristic technical name (e.g. \"IOBJ_NAME\")."New value: +"Reference characteristic the exception aggregation runs over (e.g. \"IOBJ_NAME\")."
    • addedInput schema / properties / operations / items / properties / exception_aggregation / properties / reference_characteristics
      Added value: +{
      +  "description": "Several reference characteristics (up to five). Takes precedence over reference_characteristic.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "maxItems": 5,
      +  "type": "array"
      +}
    • changedInput schema / properties / operations / items / properties / exception_aggregation / properties / type / description
      Previous value: -"Aggregation type (e.g. \"AVG\", \"MAX\", \"LAS\")."New value: +"Aggregation type: SUM, MAX, MIN, AVG (all values), AV0 (average of non-zero values), AV1 / AV2 (average weighted by calendar / working days), CNT (count all), CN0 (count non-zero), FIR / LAS (first / last value), NO1 / NO2 / NOP (no aggregation if more than one record / value / non-zero value), STD, VAR. Any other literal is refused, because the backend would silently store standard aggregation instead."
    • addedInput schema / properties / operations / items / properties / exception_aggregation / properties / type / enum
      Added value: +[
      +  "SUM",
      +  "MAX",
      +  "MIN",
      +  "AVG",
      +  "AV0",
      +  "AV1",
      +  "AV2",
      +  "CNT",
      +  "CN0",
      +  "FIR",
      +  "LAS",
      +  "NO1",
      +  "NO2",
      +  "NOP",
      +  "STD",
      +  "VAR"
      +]
    • changedInput schema / properties / operations / items / properties / exception_aggregation / required
      Previous value: -[
      -  "type",
      -  "reference_characteristic"
      -]New value: +[
      +  "type"
      +]
    • addedInput schema / properties / operations / items / properties / properties / properties / calculation
      Added value: +{
      +  "description": "Local calculation of the member, or false to restore the default. Fields not given keep their current value. result_as (\"calculate results as\"): blank, summation, maximum, mininum (the model's spelling of minimum), detValuesCounter, detValuesCounterNonEmpty, average, averageNonEmpty, standardDeviation, variance, hide, firstValue, lastValue, summationRoundedValues. single_values_as (\"calculate single values as\"): blank, minimum, maximum, detValuesCounter, detValuesCounterNonEmpty, movingAverage, movingAverageNonEmpty (read back as movingAverage), normalizeNGLR, normalizeOverall, normalizeUnrestOverall, rankNumber, olympicRankNumber, hide. apply_to_result: use the calculated single values for the result (false is what the modeling tools write). cumulation: show values cumulated.",
      +  "properties": {
      +    "apply_to_result": {
      +      "type": "boolean"
      +    },
      +    "cumulation": {
      +      "type": "boolean"
      +    },
      +    "result_as": {
      +      "type": "string"
      +    },
      +    "single_values_as": {
      +      "type": "string"
      +    }
      +  }
      +}
    • changedInput schema / properties / operations / items / properties / properties / properties / exception_aggregation / description
      Previous value: -"Exception aggregation { \"type\": \"AVG\", \"reference_characteristic\": \"IOBJ_NAME\" }, or false to reset it."New value: +"Exception aggregation { \"type\": \"AVG\", \"reference_characteristic\": \"IOBJ_NAME\" }, or false to reset it. Same fields as the operation-level exception_aggregation; formula members only."
    • addedInput schema / properties / operations / items / properties / properties / properties / exception_aggregation / properties
      Added value: +{
      +  "exclude": {
      +    "description": "Aggregate over all characteristics except the reference characteristics. Default false.",
      +    "type": "boolean"
      +  },
      +  "reference_characteristic": {
      +    "description": "Reference characteristic the exception aggregation runs over (e.g. \"IOBJ_NAME\").",
      +    "type": "string"
      +  },
      +  "reference_characteristics": {
      +    "description": "Several reference characteristics (up to five). Takes precedence over reference_characteristic.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "maxItems": 5,
      +    "type": "array"
      +  },
      +  "type": {
      +    "description": "Aggregation type: SUM, MAX, MIN, AVG (all values), AV0 (average of non-zero values), AV1 / AV2 (average weighted by calendar / working days), CNT (count all), CN0 (count non-zero), FIR / LAS (first / last value), NO1 / NO2 / NOP (no aggregation if more than one record / value / non-zero value), STD, VAR. Any other literal is refused, because the backend would silently store standard aggregation instead.",
      +    "enum": [
      +      "SUM",
      +      "MAX",
      +      "MIN",
      +      "AVG",
      +      "AV0",
      +      "AV1",
      +      "AV2",
      +      "CNT",
      +      "CN0",
      +      "FIR",
      +      "LAS",
      +      "NO1",
      +      "NO2",
      +      "NOP",
      +      "STD",
      +      "VAR"
      +    ],
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / operations / items / properties / properties / properties / scaling
      Added value: +{
      +  "description": "Scaling as a power of ten, 0-9 (3 = thousands), or false to restore the default."
      +}
  2. Changed9 schema fields changedv1.5.0
    • changedInput schema / properties / operations / items / properties / action / description
      Previous value: -"add_key_figure: add a basic key figure (infoobject). add_ckf / add_rkf: add a reference to a reusable calculated / restricted key figure (component_name). add_formula: add a local formula member (description + formula). remove_member: remove a member matched by member_id, description, and/or component_name. set_member_properties: change display properties / exception aggregation of a matched member."New value: +"add_key_figure: add a basic key figure (infoobject). add_ckf / add_rkf: add a reference to a reusable calculated / restricted key figure (component_name). add_formula: add a local formula member (description + formula). remove_member: remove a member matched by member_id, description, and/or component_name. set_member_properties: change properties, exception aggregation, the inverse formula, or the place in the structure (parent / position) of a matched member. Members are matched at any depth, so a nested child can be targeted too."
    • addedInput schema / properties / operations / items / properties / inverse
      Added value: +{
      +  "description": "Inverse formula of an input-ready formula member (for \"add_formula\" and \"set_member_properties\"). Without it the backend refuses input readiness on a formula while still storing the flag, leaving a member that cannot be planned on.",
      +  "properties": {
      +    "description": {
      +      "description": "Description of the inverse formula member.",
      +      "type": "string"
      +    },
      +    "formula": {
      +      "description": "How the written-back value is derived; same node shape as \"formula\". Defaults to a reference to the formula member itself.",
      +      "type": "object"
      +    },
      +    "target": {
      +      "description": "Member an entered value is written back to, by member id or description — normally the plannable child of the formula.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "target"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / operations / items / properties / parent
      Added value: +{
      +  "description": "Nest the member under this one, by member id or description. On an add action the new member is created as a child; on \"set_member_properties\" an existing member is moved there. A member that is already nested can be moved to a different parent or reordered within its parent, but cannot be lifted back to the top level — remove and re-add it for that.",
      +  "type": "string"
      +}
    • addedInput schema / properties / operations / items / properties / position
      Added value: +{
      +  "description": "Position among the siblings (0 inserts before the first). Appends when omitted. On \"set_member_properties\" without \"parent\" the member stays on its current level.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / properties / operations / items / properties / properties / description
      Previous value: -"Member display properties (for \"set_member_properties\"; also allowed on \"add_formula\"). Only the provided fields are changed."New value: +"Member display and planning properties. Accepted on \"set_member_properties\" and on every add action. Only the provided fields are changed."
    • addedInput schema / properties / operations / items / properties / properties / properties / constant_selection
      Added value: +{
      +  "description": "Constant selection on the member itself.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / operations / items / properties / properties / properties / disaggregation
      Added value: +{
      +  "description": "How an entered value is distributed: \"copy\", \"no\", \"absolute\", or false to restore the default."
      +}
    • addedInput schema / properties / operations / items / properties / properties / properties / disaggregation_reference
      Added value: +{
      +  "description": "Reference member for disaggregation \"absolute\", by member id or description.",
      +  "type": "string"
      +}
    • addedInput schema / properties / operations / items / properties / properties / properties / input_mode
      Added value: +{
      +  "description": "Input readiness — required for a member to be writable in a planning query. \"inputReady\" turns input on, \"not\" turns it explicitly off, false restores the default (also not input-ready). The lock flag is derived by the backend and is deliberately not settable."
      +}
  3. Addedv1.2.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so richly: operations applied in one save, members matched at any depth, nested members cannot be lifted to top level without remove/re-add, input readiness is refused without an inverse formula, unsupported LEAF token, and backend refusal of foreign aggregation literals. These are exactly the behavioral traits an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose before enumerating operations, and each sentence carries operational detail. The opening sentence is a long run-on list, but given the tool's breadth the density is justified rather than wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex multi-action mutation tool with no output schema and no annotations, the description covers semantics, matching, save behavior, and key failure modes well. It falls short only on confirming what the tool returns and the shape of success/failure feedback.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents every parameter in detail; the description mostly restates the operation-to-field mapping (infoobject, component_name, formula, properties, restrictions) rather than adding meaning beyond it. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Manage the key figure structure of an existing BW Query') and then enumerates the exact operations (add basic KFs, CKF/RKF references, formula members, properties, nesting, removal). An agent can distinguish this from bw_update_query_layout, bw_update_query_cells, and bw_update_structure without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context: single-save semantics, that member operations also apply to a structure referenced via bw_update_query_layout add_structure, and routes CKF exception aggregation to bw_create_ckf / bw_update_ckf. It does not give a crisp when-not-to-use rule, but the routing to siblings and the constraint notes are strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools