Skip to main content
Glama
kts982

MCP SAP GUI Server

by kts982

sap_get_screen_elements

Read-only

Discover all elements on the current SAP GUI screen to find field IDs and UI controls for scripting. Filter by type, changeability, container, and depth to narrow complex screens.

Instructions

Discover all elements on the current SAP screen.

Useful for finding field IDs when working with a new screen.

Use type_filter and changeable_only to reduce response size on complex screens (e.g. type_filter="GuiTextField,GuiCTextField" to find only input fields).

max_depth controls how deep to recurse into containers (default 2). Use max_depth=1 for a quick overview, max_depth=3+ for deeply nested layouts (splitter containers, tab strips with sub-containers).

Pass container_id='wnd[0]/mbar' to discover the menu bar structure.

A table control (SM30-style) is ONE element here, not one per cell: use sap_read_table(columns_only=true) for its columns and cell_id templates. A classic list (report WRITE output, SE16 standard list, F4 hit list) is left out and reported under 'lists': read it with sap_read_list. expand_tables=true lists every visible cell of both (large).

Docking containers sit BESIDE the user area, not inside it: the dialog-structure tree of a view cluster (SM34, most IMG activities) and the SE80 tree are under 'wnd[0]/shellcont'. When the window has any, the response lists them as docking_containers; discover them with that id, or pass container_id='wnd[0]' (max_depth=1) for all top-level areas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_depthNo
type_filterNo
container_idNownd[0]/usr
expand_tablesNo
changeable_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • addedInput schema / properties / expand_tables
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
  2. First observedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare a safe read-only operation, and the description adds substantial behavioural context beyond them: tables collapse to a single element rather than per-cell, classic lists are omitted and surfaced under 'lists', docking containers live under 'wnd[0]/shellcont' and are reported as 'docking_containers', and expand_tables produces large responses. These are exactly the surprises that would otherwise cause a wrong call.

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?

Front-loaded with the purpose and free of throwaway sentences; each paragraph covers a distinct case (filters/depth, menu bar, tables/lists, docking containers). It is long, however, and reads as a flat block of prose where the table/list contrast and the docking-container caveat would scan faster as a short list or heading.

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?

An output schema exists, so return-value detail is correctly left out, and the description instead supplies the domain-specific gotchas an agent needs for this complex SAP UI tree (single-element tables, excluded lists, docking containers beside the user area). Nothing needed to call it correctly on a new or unusual screen appears 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?

With 0% schema description coverage the description carries the load and mostly does: max_depth explained with default 2 and concrete values (1 for overview, 3+ for nested layouts), type_filter shown with real class names ('GuiTextField,GuiCTextField'), container_id illustrated with two example paths, and expand_tables with its size cost. changeable_only is only mentioned as a way to 'reduce response size' — its filtering semantics are implied rather than stated, a minor gap.

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 — 'Discover all elements on the current SAP screen' — plus the concrete goal ('finding field IDs when working with a new screen'). It also differentiates itself from siblings by name, e.g. tables are 'ONE element here' and should be read with sap_read_table, and lists are excluded in favour of sap_read_list.

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-to-use (new screen, need field IDs) and when-not (tables, classic lists) with the alternative tool named for each excluded case. It also routes the agent for special situations: container_id='wnd[0]/mbar' for the menu bar and 'wnd[0]' with max_depth=1 for top-level areas.

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