Skip to main content
Glama

Sap Close Popup

sap_close_popup

Closes an active SAP popup dialog by clicking a specified button, accesskey, or the X close button, so you can dismiss prompts and return to the main transaction screen.

Instructions

Close an active popup dialog by clicking a button. Use when active_window shows 'wnd[1]' or higher and you want to dismiss the dialog. Note: Not all popups need closing - if the popup is a form you need to fill, use sap_discover_fields and sap_fill_form instead (they automatically target the active window). Specify button by label ('Ja', 'Nein') or accesskey ('J', 'N'), or use close=True to click the X button if available.

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

Input Schema

NameRequiredDescriptionDefault
closeNoClick the X close button instead of a specific button
buttonNoButton label (e.g., 'Ja', 'Nein') or accesskey (e.g., 'J', 'N')
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
successNoWhether the operation succeeded
popup_closedNoWhether popup is now gone
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.
button_clickedNoLabel of button that was clicked
status_bar_typeNoStatus bar message type after closing popupnone
status_bar_messageNoStatus bar text after closing popup

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/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 disclosure burden. It does well on targeting mechanics (active_window detection, not all popups need closing, button label vs. accesskey vs. close=True for the X button), but it never states what happens when no popup exists, when the named button is absent, or whether dismissing can discard unsaved dialog state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and condition, followed by the exclusion rule and the button-identification options; the session note is formatted as a separate block. The only mild redundancy is the session parameter being restated from the schema, which is defensible for parallel-agent coordination.

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 no explanation, and the guidance covers the highest-risk mistake (closing a form that should be filled). Remaining gap is failure-mode behavior for a tool with no annotations to back it up.

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 real meaning beyond the schema: that 'button' accepts either a label or an accesskey with concrete examples, and that close=True is an alternative path to clicking the X button. The session parameter's primary-vs-specific-session semantics are also explained in prose.

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 ('Close an active popup dialog by clicking a button') and immediately distinguishes itself from sap_discover_fields and sap_fill_form, which handle form-style popups. An agent can tell what this does and what it does not do 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete triggering condition ('Use when active_window shows wnd[1] or higher') plus an explicit when-not-to-use rule naming two alternative tools and why they are better ('they automatically target the active window'). Both the positive and negative routing decisions are spelled out.

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