Skip to main content
Glama
sap-ui-automation

sap-ui-automation

by DidroAI

Act on the SAP screen

sap_act

Performs actions on open SAP GUI, Web GUI, or Fiori screens, including field entry, key presses, selections, and transaction commands, then returns the resulting screen or its changes.

Instructions

Acts on the SAP screen; answers with the new screen, on the same screen only the changes ("~" changed line, "+" new, "-" gone, "=" unchanged), so sap_look after it is rarely needed. Ids from the latest view; the last part is enough. "STATUS E": the step did not go through, correct the field it names; W: Enter accepts it; S: done (document numbers). A new "WINDOW wnd[1]" is a popup: answer it before anything else. set only types: fill every field, then one Enter (key 0). Codes: f4 on the field lists them. do and its fields: set id, value; a table cell: id (the table), row, col; "\n" breaks lines in a text editor key key: Enter, Back, Execute, Save, Cancel, Exit, F1-F24, Shift+F3, or SAP's number press id (click too); btn[N] is function key N okcode value: "/nVA03" starts a transaction, "/oVA03" in a new session; it submits on its own (no Enter after it); the command field cannot be typed into select id (tab, radio, menu entry, list item); with row: a table row (value false: deselect) check id, value true|false combo id, key (entry key or text; without: lists them) f4, focus, dblclick id grid id, row, col, how double|select|cell tree id, node, how double|select|expand|collapse toolbar id, button scroll id, to: a row from 0, next, prev, first, last, left, right open app "#SalesOrder-manage" (Fiori launchpad) timeout: seconds per step (default 180). actions: [...] up to 20 in one call, a screen's fields then its key: [{"do":"set","id":"ctxtVBAK-AUART","value":"OR"},{"do":"key","key":0}]. Stops at the first surprise (failure, refusal, a write awaiting yes, popup, E/W/A status, another screen unless the next action's id is on it and it does not write; okcode "/n" and open go on into it). Per step: expect {"screen":"4001"}|{"screen":"*"} (any)|{"popup":true}|{"status":"W"} goes on through it; show:true adds the screen after it; unseen:true lets a write run on a screen first reached in the batch. Do not repeat a failed action unchanged. An action that may write (save, post, delete...) runs only after the user says yes in a dialog the client shows; if they decline, leave the transaction without saving (okcode /n), then ask how to go on. A client that cannot ask the user gets it refused: then tell the user what you would have saved.

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

Input Schema

NameRequiredDescriptionDefault
doNo
idNo
toNo
appNo
colNo
howNo
keyNo
rowNo
fullNoanswer with the whole screen, not the changes
nodeNo
valueNo
buttonNo
actionsNo
sessionNonumber, id, system, transaction or sapgui|webgui|fiori; default: the active one
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A4.7/5.0
Behavior5/5

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

The description carries far more than the sparse annotations: writes are gated on a user confirmation dialog, a declined confirmation must be unwound with okcode /n, a client that cannot prompt gets the write refused, batch execution stops at the first surprise with enumerated exceptions, and STATUS E/W/S plus popup semantics are defined. It also documents diff output markers and the 180s default timeout, none of which the annotations convey. The mention of 'delete' as a possible write action sits in slight tension with destructiveHint=false, but the confirm-before-write gate makes this a caveat rather than a flat contradiction.

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?

Long but deliberately structured, with the highest-value facts (what it does, diff return format, that sap_look is redundant) front-loaded and per-action semantics grouped under clear labels. The compressed shorthand and multi-clause sentences cost some readability, but almost every clause carries operational 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?

For a 15-parameter, no-required-parameter, no-output-schema tool that drives a GUI, the definition covers what an agent needs: return format and diff notation, error statuses and recovery, popup handling, batch abort conditions with per-step expect/show/unseen modifiers, and the confirm-write safety flow. The 'do not repeat a failed action unchanged' rule closes the remaining loop on retry behavior.

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 only 13%, so the description must compensate, and it does: every value of 'do' except 'look' is defined with its own arguments, including id/row/col for table cells, key naming, okcode /n vs /o session semantics, select-with-row deselect, and scroll 'to' targets. Only 'full' and 'session' are left to the schema, and 'session' already has a schema description.

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 opening sentence names a specific verb and resource ('Acts on the SAP screen') and immediately states the return shape (the new screen, or a symbolized diff of changes). It explicitly de-references the sibling, saying 'sap_look after it is rarely needed', so an agent can distinguish it from sap_look without reading either 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?

Extensive when-and-how guidance is embedded in the per-action list (use okcode for transactions, key for Enter, press for clicks, combo without key to list entries), and batching rules say when to use 'actions' versus single steps. It names sap_look as the near-redundant alternative but gives no explicit guidance versus sap_record, sap_replay, or sap_use, and no explicit 'when not to use this tool' statement.

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