Skip to main content
Glama
MCP SAP GUI Server

MCP SAP GUI Server

by kts982

Sap Read Table

sap_read_table
Read-only

Read rows from an ALV grid or TableControl on the current SAP screen, auto-detecting the table type. Fetch specific columns, discover column metadata, and paginate large tables.

Instructions

Read rows from a table on the current screen — ALV grid (report/list output) or TableControl (SM30 maintenance view, customizing screens).

Auto-detects the table type. The response includes a 'table_type' field ('GuiGridView' for ALV or 'GuiTableControl') so you know which type-specific tools to use next (e.g., sap_get_alv_toolbar for ALV, sap_scroll_table_control for TableControl).

Use columns_only=true for schema discovery (returns column metadata only, no data). For a TableControl it also gives each column's cell_type and a cell_id template ({row} = zero-based visible row) for sap_set_batch_fields. Use columns to fetch only specific columns (CSV). Use start_row to paginate through large tables. On a TableControl a start_row (0 included) scrolls there first; without one the read starts where the table is scrolled now (e.g. after Position...). first_visible_row says which row is on top.

A TableControl read returns at most the visible rows: page with start_row=next_start_row while has_more is true. start_row_note explains a clamped or failed scroll. total_rows counts its empty lines too (SM30 pads the view). When the read reaches the first empty row with no data below it, the response has empty_rows_from, that row's absolute index: the data ends there.

What could not be read is said, never dropped: a column name the table does not have is listed in unknown_columns (no known name at all: an error with the table's column names); a cell that could not be read is null (an empty cell is ""), listed in unreadable_cells (ALV) or, for a whole table-control row, unreadable_rows; warning sums it up.

An ALV grid read also gives, when set: title (which list this is) and the selection that toolbar and menu functions act on: selected_rows in SAP's form ("1,2,4-8,10") with selected_row_count, selected_cells, selected_columns.

An ALV grid whose layout has totals lines (totals, subtotals) has totals_lines, and each such row carries _total_level: 1 is the innermost subtotal, totals_lines.highest_level the overall total. It is a sum, not a record, and total_rows counts it. _collapsed: true marks a subtotal whose group is closed: its records are not in the grid.

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_id": "<table_id>"
    },
    "name": "sap_read_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
columnsNo
max_rowsNo
table_idYes
start_rowNo
columns_onlyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.2
    • addedInput schema / properties / start_row / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / start_row / default
      Previous value: -0New value: +null
    • removedInput schema / properties / start_row / type
      Removed value: -"integer"
  2. First observedv0.2.0

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description is consistent with a pure read. Beyond that it discloses a lot of genuine behavior: TableControl reads are capped at the visible rows, start_row triggers a scroll whose clamping is reported in start_row_note, total_rows includes SM30 padding lines, empty_rows_from marks the data boundary, and unreadable columns/cells/rows are surfaced in unknown_columns, unreadable_cells, unreadable_rows and warning rather than silently dropped. That is well past what the annotations supply.

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?

The content is front-loaded correctly — purpose, then type detection, then discovery/filtering/pagination, then error semantics, then ALV-specific extras — and nearly every sentence carries distinct operational information. It is nonetheless a long definition with some editorial phrasing ("What could not be read is said, never dropped") that could be tightened, and several response-field explanations edge toward what the output schema already covers.

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 five-parameter read tool spanning two UI technologies, the description covers type detection, pagination loop, truncation/scroll caveats, error reporting, and ALV selection/totals-row semantics, which is close to complete. The remaining hole is max_rows, an undocumented parameter that directly bounds how many rows come back, so an agent cannot reason about result size limits from the definition alone.

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 description coverage is 0%, so the description carries the burden and mostly does: columns_only is defined as metadata-only discovery plus cell_type/cell_id output, columns is explained as a CSV column filter with unknown names routed to unknown_columns, and start_row is given detailed scroll-versus-read semantics including the null default behavior. The notable gap is max_rows (default 100), which is never mentioned, and table_id is only implied by "a table on the current screen".

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?

Opens with a specific verb and resource ("Read rows from a table on the current screen") and immediately narrows scope to the two supported container types, ALV grid and TableControl, naming the SAP contexts (report/list output, SM30 maintenance, customizing screens) where each appears. This clearly separates it from siblings such as sap_read_list, sap_read_field, and the table-control navigation tools.

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?

Gives explicit conditional guidance: columns_only=true for schema discovery, columns for partial fetches, start_row for pagination, and it names the follow-on tools selected by the returned table_type (sap_get_alv_toolbar for ALV, sap_scroll_table_control for TableControl, sap_set_batch_fields via the cell_id template). It also states the TableControl paging loop (start_row=next_start_row while has_more is true), which is exactly the when/how guidance an agent needs.

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