Sap Session Close
sap_session_closeClose a SAP GUI session and remove it from the registry to manage concurrent logins; attached windows are refused and must be detached instead.
Instructions
Close a SAP session.
Closes the underlying SAP GUI session/tab and removes it from the registry. Any session ID can be closed, including "s1". With the parallel-multi-mandant contract (#671), the registry can hold multiple concurrent logins and you may legitimately want to close any of them — including the lowest-numbered one. If you close the only remaining session, the next tool call will fail with a clear "no session" error and you should call sap_login() again.
Sessions with origin "attached" (a window the user already had open) are never closed by this server: the call is refused and points at sap_session_detach.
Args: session_id: Session to close (e.g. "s1", "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_close"
}
}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 closed (e.g., 's2') | |
| active_window | No | Which window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open. | |
| remaining_sessions | No | Sessions still active after closing |