Skip to main content
Glama

Sap Transaction

sap_transaction

Enter 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

NameRequiredDescriptionDefault
tcodeYesTransaction code (e.g., VA01, MM03, SE80, SU01)
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
agent_idNoAgent identifier for binding check. Optional.
new_windowNoIf True, open in new SAP session window (preserves current transaction). The new session is auto-registered and session_id is returned.
reset_firstNoIf 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

NameRequiredDescriptionDefault
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
tcodeYesTransaction code executed
successNoWhether the operation succeeded
new_windowNoOpened in new session
page_titleNoCurrent page title
session_idNoSession ID of new session (only set when new_window=True)
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.
session_countNoNumber of SAP sessions

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well by disclosing single-threaded SAP GUI COM scripting, session creation, session limits, and the need to close opened sessions. It does not describe permission requirements, possible data side effects, or error behavior, which are notable gaps for a tool that executes arbitrary transactions.

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

Conciseness4/5

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

The description is front-loaded with purpose and exclusions, then organized into multi-session, concurrency, and cleanup notes. It is somewhat verbose with all-caps and emoji warnings, but every section carries relevant operational information.

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?

The tool has an output schema and full parameter documentation, and the description covers the key session and concurrency behavior needed to use it safely in parallel-agent contexts. It is not fully complete because it does not warn about transaction side effects or permission dependencies for arbitrary SAP transaction codes.

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 operational meaning for new_window and session targeting, including that new_window returns a session_id and that later calls can pass session to target it. It does not add much beyond the schema for tcode, reset_first, or agent_id.

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 verb and resource: enter and execute an SAP transaction code. It also explicitly distinguishes this generic transaction tool from dedicated SE11, SE16, SE24, SE37, and SE93 lookup siblings.

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 do-not-use cases for common SAP transaction codes and names the corresponding alternative tools. It also covers session lifecycle usage, including when to close sessions and how to review open sessions.

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