Skip to main content
Glama

Sap Discover Fields

sap_discover_fields

Discover input fields on the current SAP screen or active popup, returning labels, names, values, and selectors so you can target and fill fields accurately.

Instructions

Discover input fields on the current SAP screen (or active popup dialog). Returns fields with label, name, value, and a selector/ID for targeting the field. Automatically targets the active window — if a popup is open, shows popup fields. Use the label with sap_fill_form or sap_set_field to fill fields (works on both backends). The 'selector' field is a CSS selector on WebGUI or a SAP GUI element ID on Desktop. For buttons, use sap_discover_buttons instead.

Session parameter:

  • session=None (default): Uses primary session ("s1")

  • session="s2": Targets specific session (for parallel agents)

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

Input Schema

NameRequiredDescriptionDefault
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
agent_idNoAgent identifier for binding check. Optional.

Output Schema

NameRequiredDescriptionDefault
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
fieldsNoList of discovered fields with selectors - use the 'selector' field for targeting
successNoWhether the operation succeeded
field_countYesNumber of fields found
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does reasonably well: it implies a safe read ('Returns fields...'), discloses automatic active-window targeting including popup behavior, and explains that the 'selector' value has backend-dependent semantics (CSS selector on WebGUI vs. SAP GUI element ID on Desktop). It does not discuss cost, latency, or whether the call alters screen state, which keeps it from a 5.

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 purpose and return shape, and the sibling routing arrives early. There is mild redundancy: the popup case is stated twice ('or active popup dialog' then again as a separate sentence), and the session bullet restates the schema default.

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?

An output schema exists, so return values need not be spelled out, and the description correctly focuses on behavior: active-window targeting, cross-backend selector semantics, and the fill workflow it feeds. For a read-only discovery tool with full schema coverage, the remaining gaps (latency, whether it scrolls or paginates large screens) are minor.

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, but the description adds genuine meaning: session=None maps to primary session "s1" and session="s2" exists for parallel agents. That parallel-agent framing is not derivable from the schema default alone. The second parameter (agent_id) is left entirely to the schema.

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 states a specific verb and resource ('Discover input fields on the current SAP screen') and immediately scopes it ('or active popup dialog'). It also enumerates what is returned (label, name, value, selector/ID) and explicitly routes buttons to a named sibling, so an agent can distinguish it without opening any schema.

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?

It gives concrete downstream usage ('Use the label with sap_fill_form or sap_set_field') and an explicit exclusion ('For buttons, use sap_discover_buttons instead'). What it lacks is any guidance on when to pick this over other field-reading siblings that expose overlapping concepts; the guidance is clear but not exhaustive.

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