Skip to main content
Glama

GetSqlQuery

Executes read-only ABAP SQL SELECT queries against database tables and CDS views via SAP ADT Data Preview API for ad-hoc data retrieval, row counts, and filtered queries.

Instructions

[read-only] Execute ABAP SQL SELECT queries on database tables and CDS views via SAP ADT Data Preview API. Use for ad-hoc data retrieval, row counts, and filtered queries. Runs on an ABAP session of its own. Optional timeout (seconds): when it passes, the read is cancelled, its ABAP session logged off, and the system stays as it was. Set it below your MCP client's request limit — the TypeScript SDK's client cancels at 60 s; a client's cancel ends only the client's wait, and SAP runs the read on. Recordable: in batch mode a call is recorded under the next number and answers with empty content; its answer is read by number after the batch ends.

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": {
      "sql_query": "<sql_query>"
    },
    "name": "GetSqlQuery"
  }
}

Input Schema

NameRequiredDescriptionDefault
detailNoHow much of the answer to return: "terse" (default, the fields you need to act), "full" (the whole parse), "raw" (the document as ADT sent it).terse
timeoutNoSeconds to wait for the answer: a whole number, at least 1, no default — without it the call waits until SAP answers. When it passes, the read is cancelled (its ABAP session is logged off) and the call answers that nothing was changed. Set it below your MCP client's request limit — the TypeScript SDK's client cancels at 60 s; a cancel does nothing to SAP.
sql_queryYesSQL query to execute
row_numberNo[read-only] Maximum number of rows to return

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv20.1.0
    • addedInput schema / properties / timeout
      Added value: +{
      +  "description": "Seconds to wait for the answer: a whole number, at least 1, no default — without it the call waits until SAP answers. When it passes, the read is cancelled (its ABAP session is logged off) and the call answers that nothing was changed. Set it below your MCP client's request limit — the TypeScript SDK's client cancels at 60 s; a cancel does nothing to SAP.",
      +  "maximum": 2147483,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Changed1 schema field changedv16.0.0
    • addedInput schema / properties / detail
      Added value: +{
      +  "default": "terse",
      +  "description": "How much of the answer to return: \"terse\" (default, the fields you need to act), \"full\" (the whole parse), \"raw\" (the document as ADT sent it).",
      +  "enum": [
      +    "terse",
      +    "full",
      +    "raw"
      +  ],
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.1/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 well: it declares read-only, states that the query runs on its own ABAP session, explains that a timeout cancels the read, logs off the session, and leaves the system unchanged, and warns that a client-side cancel only stops the client's wait while SAP keeps running. The batch-mode recording behavior (empty content, answer read by number) is context no schema field could convey.

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 usage are front-loaded in the first two sentences, with operational caveats after. The timeout paragraph is noticeably long and duplicates the timeout parameter's schema text, costing some efficiency, but no sentence is empty of information.

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 four-parameter query tool with no annotations and no output schema, the definition covers execution model, safety, timeout/cancellation, and batch behavior. The remaining gap is the shape of the result set (columns, row-cap interaction with `row_number`) which the agent must infer from the parameter descriptions.

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 all four parameters, including the timeout semantics almost verbatim as repeated in the description. The description adds no meaning beyond the schema for `detail` or `row_number`, so the baseline of 3 applies.

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 specific verb and resource ('Execute ABAP SQL SELECT queries on database tables and CDS views') plus the mechanism (SAP ADT Data Preview API) and concrete use cases (ad-hoc retrieval, row counts, filtered queries). The only gap is that it never distinguishes itself from the sibling GetTableContents, which plausibly serves a similar need.

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?

Gives clear context for when to reach for it ('ad-hoc data retrieval, row counts, and filtered queries') and adds a useful batch-mode condition. It stops short of naming an alternative or a when-not-to-use condition, so selection against GetTableContents is left to inference.

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