Sap Session Detach
sap_session_detachStops 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
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if success=False | |
| popup | No | Present when a popup dialog is active on screen | |
| success | No | Whether the operation succeeded | |
| session_id | No | ID of the session that was detached | |
| active_window | No | Which window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open. | |
| released_agent | No | Agent binding that was dropped, if any | |
| remaining_sessions | No | Sessions still registered after detaching |