Skip to main content
Glama

Sap Se16 Query

sap_se16_query
Read-only

Query SAP table data through SE16N Data Browser for complex dynamic filters or when ADT is unavailable.

Instructions

Query SAP table data via SE16N (Data Browser). If sap-adt is available, prefer its run_query tool for simple queries. USE THIS for complex queries with dynamic filtering or when ADT is unavailable.

Filters: If a filter cannot be applied (e.g. the field is unknown or not offered by SE16N), the call fails before running the query; the error lists the SE16N selection fields when they could be read. On the WebGUI backend a filter goes into the row whose technical name matches, and only the first ~30 rows of the selection grid are rendered, so a field further down a wide table cannot be filtered (the error says so).

Performance: ~7 rows/second due to pagination.

  • 100 rows: ~14 seconds

  • 500 rows: ~1.5 minutes

  • 1000 rows: ~2.5 minutes

  • 5000 rows: ~12 minutes

For large results, use output_file to write JSON to disk and receive a summary.

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": {
      "table": "<table>"
    },
    "name": "sap_se16_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYesTable name to query (e.g., "MARA", "T000", "TSTC")
filtersNoOptional filter dict {field_name: value} - uses technical field names. A field that is unknown or not offered by SE16N makes the call fail (both backends); on the WebGUI backend fields beyond the first ~30 selection rows cannot be reached.
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
agent_idNoAgent identifier for binding check. Optional.
max_hitsNoMaximum rows to return (default 100)
output_fileNoIf provided, write full results to this JSON file within the configured output directory (OUTPUT_DIR, default: current working directory) and return summary

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint, it discloses that unusable filters fail before query execution, that the error enumerates available SE16N selection fields, and that the WebGUI backend only renders ~30 selection rows. It also quantifies throughput (~7 rows/second with concrete timings), which is exactly the kind of cost information the agent needs to size max_hits.

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?

Bold headers front-load the routing decision, then caveats, then performance, so the most decision-relevant content comes first. The filter caveat is stated in the body and again verbatim in the schema's filters property, a minor redundancy, and the timing ladder is longer than strictly necessary.

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 read-only query tool with a documented output schema and six mostly optional parameters, the definition covers routing, failure modes, backend limitations, and cost. Nothing an agent needs to call it correctly, or to anticipate how it fails, is missing.

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; the description adds real meaning on top by explaining the failure mode of the filters parameter on each backend and by recommending output_file specifically for large result sets. The remaining parameters (session, agent_id, max_hits) are left to the schema, which is acceptable given full coverage.

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 first sentence gives a specific verb and resource ('Query SAP table data via SE16N (Data Browser)') and names a competing approach (ADT run_query), so the agent can place it precisely. It does not differentiate from the sibling sap_read_table, which also reads table data, leaving one ambiguity unresolved.

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?

It states both when to prefer the alternative ('If sap-adt is available, prefer its run_query tool for simple queries') and when to choose this one ('USE THIS for complex queries with dynamic filtering or when ADT is unavailable'). The selection rule is explicit and needs no inference.

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