Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

patch_program_source

Modify part of an existing ABAP program or include by replacing exact old text with new text; avoids resending untouched code and reduces corruption risk.

Instructions

Modify PART of an existing ABAP program or include without resending the whole object. Reads the current source, replaces oldString with newString (must match EXACTLY ONCE), then locks, PUTs, optionally activates, and unlocks. Prefer this over update_program_source for edits - it removes any risk of corrupting the object by re-transmitting untouched code. 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": {
      "programName": "<programName>",
      "oldString": "<oldString>",
      "newString": "<newString>"
    },
    "name": "patch_program_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
activateNoActivate after writing. Default false - activate in SE38/SE80 yourself.
newStringYesReplacement text
oldStringYesExact existing text to replace. Must occur exactly once - include enough context to be unique.
transportNoTransport request, e.g. D01K903926. Omit only for local/$TMP objects.
programNameYesProgram or include name, e.g. ZABLMMNF00002TOP

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 well: it reveals the read-replace-lock-PUT-activate-unlock sequence, the exactly-once match requirement, optional activation, and a production-profile refusal. What it does not disclose is failure behavior — e.g. whether the lock is released if the PUT fails or what happens when oldString matches zero or multiple times.

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?

Front-loaded with the core action, followed by the mechanics, then the sibling preference, then the safety exclusion. Four sentences, no filler, and every clause conveys 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?

For a mutating, lock-holding tool with no annotations and no output schema, the description covers mechanics, safety profile and alternative choice well; only post-failure semantics and any return indication are absent. That is a minor gap rather than a blocking one.

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 programName, oldString, newString, transport and activate are all documented in the schema itself. The description's 'must match EXACTLY ONCE' and the activation mention largely restate what the parameter descriptions already say, so it adds little meaning beyond the schema. 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 program or include') with the key scope qualifier that only part of the object is changed, and explicitly distinguishes itself from update_program_source. An agent can tell the two apart 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_program_source for edits and gives the reason (avoids re-transmitting untouched code), and adds a hard exclusion: it refuses to run on production profiles. The when-to-use and the when-not are both stated.

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