Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

patch_class

Modify part of an ABAP class by replacing an exact existing string once, then lock, write, unlock, and optionally activate it—without resending the full source. Refuses production writes.

Instructions

Modify PART of an existing ABAP class without resending the whole source. Reads the current source, replaces oldString with newString (must match EXACTLY ONCE), then locks, PUTs, unlocks, and optionally activates. Prefer this over update_class for small edits like changing one method body. Refuses to run on production profiles.

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>",
      "oldString": "<oldString>",
      "newString": "<newString>"
    },
    "name": "patch_class"
  }
}

Input Schema

NameRequiredDescriptionDefault
activateNoActivate after writing. Default false.
classNameYesClass name, e.g. ZCL_ABL_PLANT_EMAIL
newStringYesReplacement text
oldStringYesExact existing text to replace. Must occur exactly once - include enough context to be unique.
transportNoTransport request. Omit only for local/$TMP objects.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/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 burden and does so well: it discloses the read -> replace -> lock -> PUT -> unlock sequence, the exactly-once match constraint, and the production-profile refusal. It stops short of saying what happens on a failed match or write (abort vs. rollback) and says nothing about what the call returns.

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 tight sentences: what it does, how it does it, and when to choose it. The safety constraint is placed last without diluting the front-loaded purpose.

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 5-parameter mutation tool with no output schema, the description covers the mechanism, uniqueness requirement, activation option, transport implication, and the production guard. Only the failure/return behavior is left implicit, which is a minor gap given full schema coverage.

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 coverage is 100%, so every parameter including oldString's uniqueness rule and the transport requirement is already documented in the schema. The description restates the exactly-once constraint and the optional activation but adds no syntax or format meaning beyond that, 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 ('Modify PART of an existing ABAP class') and immediately scopes it against the full-source alternative. An agent can distinguish patch_class from update_class without opening either 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?

Explicitly says to prefer this over update_class for small edits such as changing one method body, giving both the condition and the named alternative. It also states a hard exclusion: it refuses to run on production profiles.

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