Sap Discover Fields
sap_discover_fieldsDiscover 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
| Name | Required | Description | Default |
|---|---|---|---|
| session | No | Session ID (e.g., "s1", "s2"). None uses primary session. | |
| agent_id | No | Agent identifier for binding check. Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if success=False | |
| popup | No | Present when a popup dialog is active on screen | |
| fields | No | List of discovered fields with selectors - use the 'selector' field for targeting | |
| success | No | Whether the operation succeeded | |
| field_count | Yes | Number of fields found | |
| active_window | No | Which window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open. |