Skip to main content
Glama
lingcSun

mcp-bw-adt-api

by lingcSun

bw_table_query_sql

Run OpenSQL queries against SAP BW via ADT SQL Console. Pass SQL inline or from a file; use outputPath to save full results.

Instructions

Run an arbitrary OpenSQL statement via ADT Data Preview freestyle (POST /sap/bc/adt/datapreview/freestyle — same as ADT SQL Console). Pass the statement inline (sqlStatementContent) or from a file (sqlStatementPath). Prefer outputPath for non-trivial results. ⚠️ Runs with the configured BW credentials — treat as a privileged data-plane operation; prefer SELECT-only statements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNoOptional label for the result set (not sent to the freestyle endpoint).
maxRowsNoMax rows to fetch (default 50).
outputPathNoIf provided, the full result is written to this path (under the workdir) and the tool returns only a small summary envelope { ok, outputPath, bytes, summary }. Objects/arrays are written as JSON; ONLY the bw_*_get_xml family writes the raw XML string as plain text (that file is directly reusable as xmlPath in a later save call). Other *_get tools (e.g. bw_dtp_get, bw_trfn_get) write the PARSED XML-to-JSON tree, not raw XML — use the matching bw_*_get_xml tool when you need the raw XML string. Use outputPath for large responses (XML, table data, logs, dataflow graphs). When set, tools skip inline pagination/projection so the file contains the complete payload.
sqlStatementPathNoPath (under the workdir) to a file containing the sqlStatement. Takes precedence over sqlStatementContent. Use bw_*_get_xml with outputPath to produce such a file.
sqlStatementContentNoInline sqlStatement content. Mutually exclusive with sqlStatementPath.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure. It explicitly warns that the tool runs with configured BW credentials, is a privileged data-plane operation, and advises SELECT-only statements. This meaningfully surfaces the risk of arbitrary SQL execution, though it does not fully detail side effects of non-SELECT statements.

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

Conciseness5/5

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

The description is compact and front-loaded: purpose, endpoint, invocation options, output guidance, and a critical safety warning each earn their place in a short span. There is no filler or tautology.

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 generic SQL tool with no output schema, the description covers invocation, parameter routing, result-file guidance, and security posture. The main gap is that it does not describe the inline return shape when outputPath is omitted, but the strong schema coverage and outputPath guidance mitigate this.

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 input schema already documents all five parameters well. The description adds a bit of usage nuance like 'Prefer outputPath for non-trivial results', but does not materially deepen parameter semantics beyond what the schema already states.

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?

The description clearly identifies the action ('Run an arbitrary OpenSQL statement'), the specific resource (ADT Data Preview freestyle endpoint), and the execution context (same as ADT SQL Console). It does not explicitly differentiate from sibling tools like bw_table_get_data or bw_table_describe, but the 'arbitrary OpenSQL' framing makes the scope reasonably distinct.

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?

The description gives practical usage guidance: pass the statement inline or from a file, prefer outputPath for non-trivial results, and prefer SELECT-only statements for safety. It lacks explicit named alternatives or a clear 'when to use this instead of other table tools', but the context and exclusions are present.

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