Skip to main content
Glama

Sap Session Detach

sap_session_detach

Stops using an SAP GUI desktop session without closing its window, removing the session from the registry and dropping its agent binding so attached sessions can be released safely.

Instructions

Stop using a session WITHOUT closing it (desktop backend only).

Removes the session from the registry, drops its agent binding and stops watching its connection. No SAP GUI call is made: the SAP window stays open. This is the only way to drop an "attached" session (a window the user already had open, which sap_session_close refuses to close); it also works on sessions this server opened. The WebGUI backend has no detach; use sap_session_close there.

Args: session_id: Session to detach (e.g. "s2")

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": {
      "session_id": "<session_id>"
    },
    "name": "sap_session_detach"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYes

Output Schema

NameRequiredDescriptionDefault
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
successNoWhether the operation succeeded
session_idNoID of the session that was detached
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.
released_agentNoAgent binding that was dropped, if any
remaining_sessionsNoSessions still registered after detaching

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so thoroughly: it removes the session from the registry, drops its agent binding, stops watching its connection, makes no SAP GUI call, and leaves the SAP window open. It also discloses the desktop-only backend constraint and the relationship to the close operation.

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?

The description is front-loaded with the core distinction, then follows with side effects, alternatives, and a compact Args section. Every sentence adds useful information, and there is no redundant filler.

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 one-parameter session tool with no annotations but an output schema, the description covers purpose, side effects, backend limitations, the alternative close operation, and parameter meaning. An agent has enough information to choose this tool over sap_session_close and to invoke it correctly.

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 coverage is 0%, so the schema provides only the parameter name and type. The description partially compensates by defining session_id as the session to detach and giving an example value such as "s2", but it does not explain how to obtain a session ID or validate its format beyond the example.

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 action and resource: detach a SAP session without closing it, desktop backend only. It clearly distinguishes this operation from sap_session_close by explaining that no SAP GUI call is made and the window stays open.

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?

It gives explicit when-to-use guidance: this is the only way to drop an attached session that sap_session_close refuses to close, and it also works on server-opened sessions. It names the alternative for the WebGUI backend, sap_session_close, and states that detach is unavailable there.

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