Skip to main content
Glama
bw-modeling-mcp

bw-modeling-mcp

by dnic-dev

Run a query or read a provider

bw_query_data
Read-only

Execute SAP BW/4HANA BEx queries or preview CompositeProvider/aDSO data via BICS, returning structured or raw results with pagination and optional variables.

Instructions

Run a query or read a provider and return its data. The operation enum lists every operation with what it requires; bw_describe(tool: "bw_query_data", operation: "…") gives the complete parameter definition of one.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "operation": "<operation>"
    },
    "name": "bw_query_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
stateNoAxis layout and optional per-characteristic filters. Full definition: bw_describe(tool: "bw_query_data", operation: "run").
formatNo"text" (default): structured human-readable output. "raw": raw XML response body.
to_rowNoEnd row for pagination (default 1000). The text answer says whether more rows follow and from which from_row to continue.
comp_idNoBEx Query name or InfoProvider name (ADSO, HCPR, etc.) to query.
from_rowNoStart row for pagination (default 0).
operationYesOperation — one of: run: Execute a BW query or preview data from a provider (CompositeProvider, aDSO, etc.) via the BICS reporting endpoint. Requires comp_id.
variablesNoVariable values to fill. Full definition: bw_describe(tool: "bw_query_data", operation: "run").
is_providerNoSet to true when comp_id is an InfoProvider name (CompositeProvider, aDSO, etc.) rather than a BEx Query name. Adds the required "!" prefix to the compid URL parameter.
with_statisticsNoAppend the timing of the call and the BW statistics of its navigation step: BW runtime by layer (OLAP, cache, authorizations, database, transfer), top events,… Full definition: bw…
drill_operationsNoOptional. Full definition: bw_describe(tool: "bw_query_data", operation: "run").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.1
    • changedInput schema / properties / is_provider / description
      Previous value: -") rather than a BEx Query name.\" prefix to the compid URL parameter."New value: +"Set to true when comp_id is an InfoProvider name (CompositeProvider, aDSO, etc.) rather than a BEx Query name. Adds the required \"!\" prefix to the compid URL parameter."
  2. Changed13 schema fields changedv2.0.0
    • changedInput schema / properties / drill_operations / description
      Previous value: -"Optional. Expand or collapse hierarchy nodes or key figure structure nodes in the current result. Each operation targets one node by its 1-based tuple index. drill_state: 3 = expand, 2 = collapse. element_idx: which dimension within the tuple (1 = first, 2 = second, etc.) — use 2 when ROWS has multiple dimensions and the target node is on the second one. Requires the full state and variables to be sent again in the same POST (stateless endpoint). Use after an initial bw_query_data call to drill into a collapsed structure node or hierarchy node."New value: +"Optional. Full definition: bw_describe(tool: \"bw_query_data\", operation: \"run\")."
    • removedInput schema / properties / drill_operations / items / properties
      Removed value: -{
      -  "axis": {
      -    "enum": [
      -      "ROWS",
      -      "COLUMNS"
      -    ],
      -    "type": "string"
      -  },
      -  "drill_state": {
      -    "description": "3 = expand, 2 = collapse.",
      -    "type": "number"
      -  },
      -  "element_idx": {
      -    "description": "1-based index of the dimension within the tuple.",
      -    "type": "number"
      -  },
      -  "tuple_idx": {
      -    "description": "1-based index of the tuple in the current result.",
      -    "type": "number"
      -  }
      -}
    • removedInput schema / properties / drill_operations / items / required
      Removed value: -[
      -  "axis",
      -  "drill_state",
      -  "tuple_idx",
      -  "element_idx"
      -]
    • changedInput schema / properties / is_provider / description
      Previous value: -"Set to true when comp_id is an InfoProvider name (CompositeProvider, aDSO, etc.) rather than a BEx Query name. Adds the required \"!\" prefix to the compid URL parameter. If unsure whether a query exists for the desired analysis, use bw_search or bw_list_contents first to check before falling back to a direct provider call."New value: +") rather than a BEx Query name.\" prefix to the compid URL parameter."
    • addedInput schema / properties / operation
      Added value: +{
      +  "description": "Operation — one of: run: Execute a BW query or preview data from a provider (CompositeProvider, aDSO, etc.) via the BICS reporting endpoint. Requires comp_id.",
      +  "enum": [
      +    "run"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / state / description
      Previous value: -"Axis layout and optional per-characteristic filters. Rows and columns show exactly what the state lists there, in the order given, and everything else drops out of the result — the key figure structure too, which leaves no data. So list the complete layout wanted on ROWS and COLUMNS, structures included. Characteristics staying on FREE need not be listed. id values must come from the GET metadata response."New value: +"Axis layout and optional per-characteristic filters. Full definition: bw_describe(tool: \"bw_query_data\", operation: \"run\")."
    • removedInput schema / properties / state / properties
      Removed value: -{
      -  "infoObjects": {
      -    "items": {
      -      "properties": {
      -        "axis": {
      -          "description": "Target axis.",
      -          "enum": [
      -            "ROWS",
      -            "COLUMNS",
      -            "FREE"
      -          ],
      -          "type": "string"
      -        },
      -        "filterValues": {
      -          "description": "Optional filter selections for this characteristic. Also works on structure dimensions (isStructure=true on ROWS or COLUMNS): set low to the technical name of a key figure, calculated key figure, or restricted key figure (e.g. \"CKF_NAME\") to restrict the result to that structure member and its children. This is the only supported way to filter by key figure in BICS.",
      -          "items": {
      -            "properties": {
      -              "high": {
      -                "description": "Upper bound for interval operator BT, in the same format as the lower bound (internal with lowInt, external with low).",
      -                "type": "string"
      -              },
      -              "low": {
      -                "description": "Filter value in external key format (e.g. altName or CHAVL_EXT). Use this for members that have a named external key.",
      -                "type": "string"
      -              },
      -              "lowInt": {
      -                "description": "Filter value in internal key format (e.g. GUID like 00O2...). Use when the member has no altName and only an internal GUID is known, and always for a hierarchy node: the node name as bw_get_hierarchy shows it. Sends presentationMode=\"INT\" in BICS XML.",
      -                "type": "string"
      -              },
      -              "lowText": {
      -                "description": "Display text for the value (optional).",
      -                "type": "string"
      -              },
      -              "nodeId": {
      -                "description": "Node selection mode: 0=leaf member (default), 1=hierarchy node of the display hierarchy of the query. Pass the node as lowInt; set nodeType for a text node.",
      -                "type": "number"
      -              },
      -              "nodeType": {
      -                "description": "InfoObject of the hierarchy node: \"0HIER_NODE\" for a text node, otherwise the characteristic (the default with nodeId=1). bw_get_hierarchy shows which a node is. BW turns an excluded node into an included one; that is reported under \"Not applied\".",
      -                "type": "string"
      -              },
      -              "op": {
      -                "description": "Operator: EQ (default), BT, GT, LT, GE, LE.",
      -                "type": "string"
      -              },
      -              "sign": {
      -                "description": "I=include (default), E=exclude.",
      -                "type": "string"
      -              }
      -            },
      -            "type": "object"
      -          },
      -          "type": "array"
      -        },
      -        "hierarchy": {
      -          "description": "Not applied by BW: the display hierarchy always comes from the query definition (bw_get_query shows it; change it with bw_update_query_characteristic), and a different one here is reported under \"Not applied\". Not needed to filter on a hierarchy node.",
      -          "properties": {
      -            "hryDateFrom": {
      -              "description": "Validity from date (YYYYMMDD). Defaults to 00000000.",
      -              "type": "string"
      -            },
      -            "hryDateTo": {
      -              "description": "Validity to date (YYYYMMDD). Defaults to 99991231.",
      -              "type": "string"
      -            },
      -            "hryId": {
      -              "description": "hryId attribute (display name / variant).",
      -              "type": "string"
      -            },
      -            "id": {
      -              "description": "Hierarchy id attribute from GET response.",
      -              "type": "string"
      -            },
      -            "name": {
      -              "description": "Hierarchy name (technical name).",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "id",
      -            "name",
      -            "hryId"
      -          ],
      -          "type": "object"
      -        },
      -        "id": {
      -          "description": "id from the GET metadata response.",
      -          "type": "string"
      -        },
      -        "name": {
      -          "description": "InfoObject technical name.",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "name",
      -        "id",
      -        "axis"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -}
    • removedInput schema / properties / state / required
      Removed value: -[
      -  "infoObjects"
      -]
    • changedInput schema / properties / variables / description
      Previous value: -"Variable values to fill. name must match exactly as returned by GET (may contain trailing spaces). id and other metadata fields come from the GET variablesContainer response."New value: +"Variable values to fill. Full definition: bw_describe(tool: \"bw_query_data\", operation: \"run\")."
    • removedInput schema / properties / variables / items / properties
      Removed value: -{
      -  "altName": {
      -    "description": "altName from the GET response (optional).",
      -    "type": "string"
      -  },
      -  "id": {
      -    "description": "Variable id from the GET response.",
      -    "type": "string"
      -  },
      -  "inputEnabled": {
      -    "description": "Whether the variable accepts input (default true).",
      -    "type": "boolean"
      -  },
      -  "iobj": {
      -    "description": "InfoObject the variable is based on.",
      -    "type": "string"
      -  },
      -  "mandatory": {
      -    "description": "Whether the variable is mandatory.",
      -    "type": "boolean"
      -  },
      -  "name": {
      -    "description": "Variable technical name (exact, including trailing spaces).",
      -    "type": "string"
      -  },
      -  "txt": {
      -    "description": "Variable label (optional, for readability).",
      -    "type": "string"
      -  },
      -  "type": {
      -    "description": "Variable type (default \"charMember\").",
      -    "type": "string"
      -  },
      -  "values": {
      -    "description": "List of select values to assign.",
      -    "items": {
      -      "properties": {
      -        "high": {
      -          "description": "Upper bound for interval (op=BT).",
      -          "type": "string"
      -        },
      -        "low": {
      -          "description": "Value (CHAVL_INT internal key format).",
      -          "type": "string"
      -        },
      -        "op": {
      -          "description": "Operator: EQ (default) or BT.",
      -          "type": "string"
      -        },
      -        "sign": {
      -          "description": "I=include (default).",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "low"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -}
    • removedInput schema / properties / variables / items / required
      Removed value: -[
      -  "name",
      -  "id",
      -  "values"
      -]
    • changedInput schema / properties / with_statistics / description
      Previous value: -"Append the timing of the call and the BW statistics of its navigation step: BW runtime by layer (OLAP, cache, authorizations, database, transfer), top events, records read and transferred, the effective \"Operations in SAP HANA\" setting, and how the HTTP time splits into BW runtime and transfer. Needs statistics switched on for the query or provider (transaction RSDDSTAT) and ADT DataPreview access."New value: +"Append the timing of the call and the BW statistics of its navigation step: BW runtime by layer (OLAP, cache, authorizations, database, transfer), top events,… Full definition: bw…"
    • changedInput schema / required
      Previous value: -[
      -  "comp_id"
      -]New value: +[
      +  "operation"
      +]
  3. Changed8 schema fields changedv1.8.1
    • changedInput schema / properties / state / description
      Previous value: -"Axis layout and optional per-characteristic filters. All InfoObjects from the query must be listed (even those staying on FREE axis). id values must come from the GET metadata response."New value: +"Axis layout and optional per-characteristic filters. Rows and columns show exactly what the state lists there, in the order given, and everything else drops out of the result — the key figure structure too, which leaves no data. So list the complete layout wanted on ROWS and COLUMNS, structures included. Characteristics staying on FREE need not be listed. id values must come from the GET metadata response."
    • changedInput schema / properties / state / properties / infoObjects / items / properties / filterValues / items / properties / high / description
      Previous value: -"Upper bound for interval operator BT."New value: +"Upper bound for interval operator BT, in the same format as the lower bound (internal with lowInt, external with low)."
    • changedInput schema / properties / state / properties / infoObjects / items / properties / filterValues / items / properties / lowInt / description
      Previous value: -"Filter value in internal key format (e.g. GUID like 00O2...). Use when the member has no altName and only an internal GUID is known. Sends presentationMode=\"INT\" in BICS XML."New value: +"Filter value in internal key format (e.g. GUID like 00O2...). Use when the member has no altName and only an internal GUID is known, and always for a hierarchy node: the node name as bw_get_hierarchy shows it. Sends presentationMode=\"INT\" in BICS XML."
    • changedInput schema / properties / state / properties / infoObjects / items / properties / filterValues / items / properties / nodeId / description
      Previous value: -"Node selection mode: 0=leaf member (default), 1=hierarchy node (use when filtering a collapsed hierarchy node like a group)."New value: +"Node selection mode: 0=leaf member (default), 1=hierarchy node of the display hierarchy of the query. Pass the node as lowInt; set nodeType for a text node."
    • addedInput schema / properties / state / properties / infoObjects / items / properties / filterValues / items / properties / nodeType
      Added value: +{
      +  "description": "InfoObject of the hierarchy node: \"0HIER_NODE\" for a text node, otherwise the characteristic (the default with nodeId=1). bw_get_hierarchy shows which a node is. BW turns an excluded node into an included one; that is reported under \"Not applied\".",
      +  "type": "string"
      +}
    • changedInput schema / properties / state / properties / infoObjects / items / properties / hierarchy / description
      Previous value: -"Active hierarchy for this characteristic. Required when filtering by hierarchy node (nodeId=1). Copy id, name, hryId, hryDateFrom, hryDateTo from the <hierarchy> element in the GET response."New value: +"Not applied by BW: the display hierarchy always comes from the query definition (bw_get_query shows it; change it with bw_update_query_characteristic), and a different one here is reported under \"Not applied\". Not needed to filter on a hierarchy node."
    • changedInput schema / properties / to_row / description
      Previous value: -"End row for pagination (default 1000)."New value: +"End row for pagination (default 1000). The text answer says whether more rows follow and from which from_row to continue."
    • addedInput schema / properties / with_statistics
      Added value: +{
      +  "description": "Append the timing of the call and the BW statistics of its navigation step: BW runtime by layer (OLAP, cache, authorizations, database, transfer), top events, records read and transferred, the effective \"Operations in SAP HANA\" setting, and how the HTTP time splits into BW runtime and transfer. Needs statistics switched on for the query or provider (transaction RSDDSTAT) and ADT DataPreview access.",
      +  "type": "boolean"
      +}
  4. First observedv0.7.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the tool's safety profile is covered structurally. The description adds no behavior of its own beyond "return its data" — pagination, format switching, statistics, and provider-vs-query handling are all described in the schema, not the description. Nothing contradicts annotations, but nothing new is contributed either.

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?

Two short, front-loaded sentences with no filler, and the pointer to bw_describe is placed after the core statement. Nothing is redundant, though the brevity is achieved largely by deferring content rather than by tight writing.

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

Completeness3/5

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

With 10 parameters, nested objects, and no output schema, this description is thin — an agent must call bw_describe to learn how to invoke the complex parameters. The 100% schema coverage compensates substantially, but a tool this complex deserves at least a sentence on return shape (text vs raw) and pagination within the description itself.

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 baseline is 3; the description itself explains no parameters. It does at least point at bw_describe for the full definition of complex parameters like state, variables, and drill_operations, which is a legitimate (if indirect) handoff.

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

Purpose4/5

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

States a concrete verb (run/read) and resource (query or provider) and says it returns data. It does not differentiate from apparent siblings such as bw_read, bw_data, or bw_run, so an agent cannot tell from the description alone why it should pick this one, but the core purpose is unambiguous.

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

Usage Guidelines2/5

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

The only guidance is meta-instruction pointing at the operation enum and at bw_describe for full parameter definitions. There is no statement of when to use this tool versus sibling read/run tools, nor of prerequisites. The agent is told how to find guidance elsewhere rather than given guidance here.

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