Skip to main content
Glama

Sap Se38 Edit

sap_se38_edit
Destructive

Replace the full source of an existing ABAP report in SE38, run a syntax check, and activate it; automatically reverts changes if validation or activation fails.

Instructions

Edit an existing ABAP report in SE38. If sap-adt is available, prefer its patch_source or set_source_from_file tools — faster, no GUI needed.

Replaces the entire source code, runs syntax check (Ctrl+F2), and activates (Ctrl+F3). Auto-reverts if check or activation fails.

Important: Only for EXISTING reports. To create new reports, use abapGit.

Workflow: Read current source with sap_read_se38_source first, modify it, then call this tool with the full new source.

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": {
      "program_name": "<program_name>",
      "new_source": "<new_source>"
    },
    "name": "sap_se38_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
agent_idNoAgent identifier for binding check. Optional.
new_sourceYesComplete new ABAP source code to replace the current code.
program_nameYesName of the ABAP report (e.g., 'ZTEST_MCP_EDIT').

Output Schema

NameRequiredDescriptionDefault
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
successNoWhether the operation succeeded
activatedNoWhether the report was successfully activated
program_nameYesName of the ABAP report that was edited
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.
backup_sourceYesOriginal source code before editing (for reference/undo)
check_messagesNoMessages from syntax check (Ctrl+F2)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructive=true and readOnly=false, but the description adds substantive behavior beyond them: the entire source is replaced, a syntax check (Ctrl+F2) and activation (Ctrl+F3) run automatically, and the change auto-reverts if either step fails. That failure/rollback semantics is exactly the kind of information an agent needs before invoking a destructive GUI automation.

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?

Front-loaded with the core action, then alternatives, then side effects, then a workflow note — a good ordering. There is mild redundancy between 'Replaces the entire source code' and 'call this tool with the full new source', but nothing that wastes much space.

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?

An output schema exists, so return values need no explanation, and annotations cover the safety profile. With parameters fully documented and rollback/activation behavior disclosed, an agent has everything needed to call this correctly and safely.

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 schema carries the parameter definitions. The description still adds real meaning by stressing that new_source must be the *complete* source (not a diff), which changes how an agent must construct the argument; the workflow sentence reinforces this.

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?

States a specific verb and resource ('Edit an existing ABAP report in SE38') and immediately clarifies the mode of edit — full source replacement rather than a patch. It also names sibling alternatives (sap-adt patch_source/set_source_from_file, abapGit, sap_read_se38_source), so an agent can distinguish this tool from sap_se24_edit/sap_se37_edit without opening any schema.

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?

Explicit routing in both directions: prefer sap-adt tools when available, use abapGit for new reports, and only use this for existing reports. It also gives a concrete pre-call workflow (read source first, modify, then call with full source), leaving nothing to inference.

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