Skip to main content
Glama
MCP SAP GUI Server

MCP SAP GUI Server

by kts982

Sap Get Screen Elements

sap_get_screen_elements
Read-only

Discover all elements on the current SAP screen and find field IDs, with filters for type, changeability, container depth, and table expansion.

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.

Radio buttons and checkboxes report selected (true/false); a dropdown reports its selected key.

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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sap_get_screen_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
max_depthNo
type_filterNo
container_idNownd[0]/usr
expand_tablesNo
changeable_onlyNo

Output 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

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint and destructiveHint=false annotations, the description explains how radio buttons, checkboxes, dropdowns, table controls, classic lists, and docking containers are represented in the response. It also warns that expand_tables=true can produce large output, which is useful behavioral context not available from annotations alone.

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 long but appropriately sized for a complex SAP tool with five undocumented parameters and several special screen structures. It is front-loaded with the core purpose and then organized by parameter and exception, with every paragraph adding decision-relevant information.

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?

Given the output schema, read-only annotations, and zero schema description coverage, the description provides enough context to call the tool correctly. It covers parameter tuning, response-shape caveats, and the key alternatives for tables, lists, and docking containers.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 full burden and does so effectively. It explains max_depth defaults and tuning, provides a type_filter example, clarifies container_id usage with concrete paths, and notes that expand_tables and changeable_only affect response size or inclusion.

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?

The description opens with a specific verb and resource: 'Discover all elements on the current SAP screen.' It immediately distinguishes the tool's role by noting it is for finding field IDs and by naming related sibling alternatives such as sap_read_table and sap_read_list for different screen structures.

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?

The description gives explicit usage guidance: use type_filter and changeable_only to reduce response size, use max_depth=1 for an overview versus 3+ for deep nesting, and pass container_id='wnd[0]/mbar' for the menu bar. It also explicitly redirects table and list reading to sap_read_table and sap_read_list.

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