Skip to main content
Glama

Sap Se24 Edit

sap_se24_edit
Destructive

Replace an existing ABAP class method's source in SE24, then run syntax check and activate; automatically reverts changes if check or activation fails.

Instructions

Edit an existing class method in SE24 (Class Builder). If sap-adt is available, prefer its patch_source or set_source_from_file tools — faster, no GUI needed.

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

Important: Only for EXISTING classes and methods. To create new ones, use abapGit.

Workflow: Read current class with sap_se24_lookup first to see methods, then call this tool with the full new method 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": {
      "class_name": "<class_name>",
      "method_name": "<method_name>",
      "new_source": "<new_source>"
    },
    "name": "sap_se24_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
agent_idNoAgent identifier for binding check. Optional.
class_nameYesName of the class (e.g., 'ZCL_TEST_MCP_EDIT').
new_sourceYesComplete new ABAP method source code to replace the current code.
method_nameYesName of the method to edit (e.g., 'DO_SOMETHING').

Output Schema

NameRequiredDescriptionDefault
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
successNoWhether the operation succeeded
activatedNoWhether the class was successfully activated
class_nameYesName of the class that was edited
method_nameYesName of the method 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 method source code before editing (for reference/undo)
check_messagesNoMessages from syntax check and activation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, and the description adds substantial behavioral detail beyond them: it replaces source wholesale, runs a syntax check (Ctrl+F2) and activation (Ctrl+F3), and auto-reverts on failure. That rollback guarantee is exactly the kind of consequence an agent needs before invoking a destructive write.

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 action, then alternatives, side effects, and constraints — all in short, scannable blocks. Minor redundancy between the 'Important' existing-only note and the workflow line, but nothing wasteful enough to penalize heavily.

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?

For a destructive write tool with an output schema, the description covers prerequisites, failure handling, and ordering of operations. It does not explain what the response reports after edit/activation, but the output schema carries that load.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so class_name, method_name, new_source, session, and agent_id are all documented in the schema. The description reinforces that new_source must be the *complete* replacement source, but adds little else about parameters, so the baseline 3 applies.

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 class method in SE24') with explicit scope restriction to existing objects. It distinguishes itself from abapGit (creation) and from ADT alternatives, so an agent can route correctly without opening a 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 when-to-use (existing classes/methods only), when-not (do not use to create; use abapGit), preferred alternatives (sap-adt patch_source / set_source_from_file), and a prescribed workflow (sap_se24_lookup first, then call with full new source). This is about as complete as guidance gets.

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