Skip to main content
Glama
MCP SAP GUI Server

MCP SAP GUI Server

by kts982

Sap Get Screen Info

sap_get_screen_info
Read-only

Retrieve current SAP GUI screen details, including transaction, program, screen number, active window, and status bar message, to confirm what the user sees and detect popups.

Instructions

Get current SAP screen info: transaction, program, screen number, window title, and status bar message (success/error/warning text).

Reads from session.ActiveWindow so the response always reflects what the user sees. The active_window field tells you which window is in focus (e.g. wnd[0] for the main screen, wnd[1] for a popup). The title comes from the active window.

Every action tool (press_button, send_key, select_menu, etc.) returns this same screen info, so you always know when a popup appears. Use sap_get_popup_window for full popup content (texts, buttons).

Present only when true: message_has_long_text (sap_press_button on 'wnd[0]/sbar' opens it) and message_as_popup (the message also sits in a popup that must be closed first).

Present only when set: subscreens, the sub-screens on the active window as "program:dynnr", outer first (program / screen_number name only the main screen, so an RF step, a tab page or a detail area that changes shows only here), cursor, the ID of the field the cursor is in (a screen redisplayed without a message, e.g. for an empty required field, still moves the cursor to that field), and buttons, the pushbuttons with a text in the main window's user area as {ID: text} (RF menu pages differ only in these; left out above 15 buttons).

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_info"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this a safe read, so the bar is lower, and the description still adds real behavior: it reads from session.ActiveWindow, always reflects what the user sees, and explains which fields appear only conditionally (message_has_long_text, message_as_popup, subscreens, cursor, buttons). The cursor note about a redisplayed screen and the 15-button cutoff are non-obvious quirks that go beyond any structured field.

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 payload definition is front-loaded in the first sentence, with conditional-field notes following in a logical order. It is somewhat long and the inline RST backticks and mid-sentence line breaks make it denser than necessary, and parts of the return-field expansion overlap with the output schema.

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 zero-parameter read tool with annotations and an output schema, the description covers everything an agent needs: what it reads, what the response reflects, and when optional fields appear. No prerequisite or side-effect information 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?

The tool takes zero parameters and the schema is an empty object, so there is nothing for the description to disambiguate. Baseline 4 applies.

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 and enumerates exactly what is returned (transaction, program, screen number, window title, status bar message). It also differentiates itself from siblings by directing full popup content to sap_get_popup_window and by noting that action tools already return this same payload.

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 this matters (knowing when a popup appears, seeing the status bar outcome) and names the alternative for richer popup data. It lacks an explicit 'call this before/after X' rule, but the surrounding cues about action tools returning the same info make the usage pattern inferable.

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