Skip to main content
Glama
dnic-dev

bw-modeling-mcp

by dnic-dev

bw_query_data

Execute a BW query or preview data from a provider like CompositeProvider or aDSO via BICS. Discover layout, variables, filters before sending queries.

Instructions

Execute a BW query or preview data from a provider (CompositeProvider, aDSO, etc.) via the BICS reporting endpoint. ALWAYS call the appropriate read tool first before querying data: bw_get_composite_provider for a CompositeProvider (is_provider=true), bw_get_adso for an aDSO (is_provider=true), bw_get_query for a BEx Query — this gives you the available fields, key figures, and the query structure before you attempt a data call. Then perform a GET (no state/variables) first to discover the current axis layout, characteristic ids, variables, and background filters before sending any POST. IMPORTANT — always call bw_get_filter_values before applying any filter or variable value. This is the only way to know the correct internal key format for a characteristic (e.g. date/time characteristics like 0CALMONTH, 0CALYEAR, 0CALDAY may use non-obvious formats). Never guess or assume filter value formats — always look them up first. If the GET response shows inputRequired="true", variables must be filled via POST before data is available. If unsure whether a BEx Query exists for the desired analysis, use bw_search or bw_list_contents first before falling back to a direct provider call (is_provider=true). Result is rendered as a formatted table with hierarchy indentation. KEY FIGURE STRUCTURE FILTER: to restrict which key figures appear in the result, apply filterValues directly on the structure dimension (isStructure=true) in state.infoObjects — use the technical name of the calculated or restricted key figure as the low value (e.g. "CKF_NAME" or "RKF_NAME"). Hierarchical children of the filtered member are included automatically. This is the correct approach because ad-hoc threshold filters on key figure values are not supported via the state mechanism; only structure-member selection is possible this way. CRITICAL: variable id and name values in the variablesContainer are session-specific and change between GET calls. Always extract variable id and name exactly from the variablesContainer in the GET response and use them immediately in the next POST — never reuse IDs from a previous GET call or from bw_get_query output. The variable name includes trailing spaces and a 4-digit suffix (e.g. "VARNAME 0004") that must be copied verbatim from the GET response. format="raw" returns XML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoAxis 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.
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_idYesBEx Query name or InfoProvider name (ADSO, HCPR, etc.) to query.
from_rowNoStart row for pagination (default 0).
variablesNoVariable 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.
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. 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.
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, 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.
drill_operationsNoOptional. 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. First observedv0.7.0

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden, and it does: it discloses the GET-then-POST flow, inputRequired='true' semantics, session-specific variable ids that change between calls, the structure-filter mechanism, format='raw' returning XML, and the stateless requirement to resend state and variables with drill operations. This is unusually rich behavioral context.

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?

Purpose and the critical workflow ordering are front-loaded, and for a tool this complex most sentences earn their place. It is a dense block with some redundancy against the schema (is_provider prefix, structure filtering), so not maximally tight, but far from padding.

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

Completeness5/5

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

For a 9-parameter, nested-schema tool with no output schema and no annotations, the description covers workflow ordering, variable handling, pagination, filtering, and rendering, which is everything an agent needs to invoke it correctly. Nothing material is left to inference.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuine cross-parameter meaning: the key figure structure filter via filterValues on isStructure dimensions, the verbatim trailing-space/suffix requirement for variable names, and the interaction between state, variables, and drill_operations. Much of the field-level detail is duplicated in the schema, capping this at 4 rather than 5.

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 ('Execute a BW query or preview data from a provider ... via the BICS reporting endpoint') and immediately distinguishes itself from sibling read tools by naming bw_get_query, bw_get_adso, and bw_get_composite_provider as prerequisites. An agent can tell exactly what this tool does versus the metadata readers.

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

Usage Guidelines5/5

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

Explicit when/when-not guidance: always call the read tool first, always GET before POST, always call bw_get_filter_values before applying filters, and use bw_search/bw_list_contents if unsure a query exists. Alternatives (provider vs BEx query, is_provider=true) are named with their selecting conditions.

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