Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

update_class

Replace the complete source of an existing ABAP class, lock and unlock it during the write, and optionally activate it; production profiles are refused.

Instructions

Overwrite the source of an EXISTING ABAP class. Locks, PUTs the whole new source, unlocks, then optionally activates. Refuses to run on production profiles. IMPORTANT: this REPLACES the whole class - read it first with get_object_info (.../source/main), edit that text, and send the complete result back (both the DEFINITION and IMPLEMENTATION parts). Prefer patch_class for small edits.

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": {
      "className": "<className>",
      "source": "<source>"
    },
    "name": "update_class"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesComplete new ABAP source - REPLACES the entire class
activateNoActivate after writing. Default false - activate in SE24/ADT.
classNameYesClass name, e.g. ZCL_ABL_PLANT_EMAIL
transportNoTransport request. Omit only for local/$TMP objects.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does so well: it discloses the lock/PUT/unlock/activate sequence, that the call is refused on production profiles, and that the write is a full replacement rather than a merge. It stops short of describing failure/rollback behavior or the response, which keeps it from a 5.

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

Conciseness5/5

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

Three sentences, front-loaded with what the tool does, then the mechanism, then the destructive-replacement warning and the alternative. No redundant restatement of the name or parameters.

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 mutation tool with no annotations and no output schema, the description covers the safety-relevant behavior (full overwrite, production guard, locking) and the correct preparation workflow. Only the success/error outcome is left implicit, which is a minor gap given no output schema exists.

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 real meaning beyond the schema: the source string must contain both the DEFINITION and IMPLEMENTATION parts and must be the complete edited text. That constraint is not derivable from the field description alone.

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?

"Overwrite the source of an EXISTING ABAP class" gives a specific verb, resource, and scope (existing classes only), and it explicitly contrasts itself with patch_class. An agent can distinguish it from sibling update_* tools 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?

It names the alternative ("Prefer patch_class for small edits") with the condition that selects it, and prescribes a prerequisite workflow (read with get_object_info .../source/main, edit, send back the whole result). Both when-to-use and how-to-use are explicit.

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