Skip to main content
Glama

Sap Press Key

sap_press_key

Send keyboard shortcuts to SAP GUI to trigger transaction actions, navigate screens, or invoke controls, optionally targeting a specific session for parallel automation.

Instructions

Send a keyboard shortcut to SAP

Note on 'Escape': on the desktop backend it sends SAP VKey 12 (F12 / Cancel), not the Windows Esc key; its meaning is screen dependent (some editor screens open an 'Exit editor' dialog). On the WebGUI backend the key is passed to the browser as a normal key press (no VKey mapping). To dismiss a popup use sap_close_popup.

Session parameter:

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

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "key": "<key>"
    },
    "name": "sap_press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesKeyboard shortcut. Use "Ctrl+", "Shift+", "Alt+" prefixes for modifiers.
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
agent_idNoAgent identifier for binding check. Optional.

Output Schema

NameRequiredDescriptionDefault
keyYesKey that was sent
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
successNoWhether the operation succeeded
page_titleNoCurrent page title after
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.
status_bar_readNoWhether status bar was read (only for shortcuts: F-keys, Ctrl+*)
status_bar_typeNoStatus bar type if read
status_bar_messageNoStatus bar text if read. None if not read, empty string if read but empty.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does valuable work disclosing backend-specific behavior (desktop sends SAP VKey 12, WebGUI passes a normal key press to the browser) and the screen-dependent meaning of Escape, but says nothing about session binding for agent_id, what happens on an invalid key, or what the tool returns.

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-loads the one-line purpose, then the caveat, then the session block; each paragraph has a distinct job. The session section is somewhat redundant with the schema, which costs a point.

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?

A mutation-ish input tool with an output schema and no annotations; the description covers the non-obvious risk (Escape ambiguity) and the popup alternative, which are the main failure modes. Minor gaps remain around agent_id binding and error behavior.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so key modifier syntax and the session default are already documented in the schema. The description largely restates the session parameter ('session=None default: primary s1' / 's2') without adding new semantics, and leaves agent_id's binding check unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Send a keyboard shortcut to SAP') that an agent can immediately match against siblings like sap_click_button or sap_fill_form. It does not explicitly contrast with those input-oriented siblings, so it stops short of a 5.

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 an explicit routing rule: to dismiss a popup use sap_close_popup rather than Escape. It also explains when Escape semantics differ (screen dependent on desktop). It lacks broader guidance on when shortcuts are preferable to discover/click tools, so not a 5.

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