Sap Transaction
sap_transactionEnter and execute an SAP transaction code to navigate SAP GUI screens and run business processes; open a new session for parallel agents or reset a stuck session.
Instructions
Enter and execute an SAP transaction code. IMPORTANT: Do NOT use this for SE11, SE16, SE24, SE37, or SE93; use sap_se11_lookup, sap_se16_query, sap_se24_lookup, sap_se37_lookup, or sap_se93_lookup.
Multi-Session Support (for parallel agents): new_window=True opens a new SAP session and returns session_id/session_count; pass session on later calls to target it.
Concurrency note: SAP GUI COM scripting is single-threaded per connection. Running parallel scripting loops across new_window=True sessions of the same connection is serialized (no speedup). For bulk work on one connection, use one script with a larger loop; parallelize only across separate connections.
⚠️ CRITICAL: Always close sessions you opened! Close new_window=True sessions with sap_session_close to avoid hitting SAP session limits. Use sap_session_list to review open IDs.
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": {
"tcode": "<tcode>"
},
"name": "sap_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tcode | Yes | Transaction code (e.g., VA01, MM03, SE80, SU01) | |
| session | No | Session ID (e.g., "s1", "s2"). None uses primary session. | |
| agent_id | No | Agent identifier for binding check. Optional. | |
| new_window | No | If True, open in new SAP session window (preserves current transaction). The new session is auto-registered and session_id is returned. | |
| reset_first | No | If True, navigate to SAP Easy Access (/n) before entering the transaction. Use this when inputs seem stuck, fields aren't updating, or the previous transaction left the session in a bad state. Ignored when new_window=True. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if success=False | |
| popup | No | Present when a popup dialog is active on screen | |
| tcode | Yes | Transaction code executed | |
| success | No | Whether the operation succeeded | |
| new_window | No | Opened in new session | |
| page_title | No | Current page title | |
| session_id | No | Session ID of new session (only set when new_window=True) | |
| active_window | No | Which window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open. | |
| session_count | No | Number of SAP sessions |