Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

update_program_source

Replaces the complete ABAP source of an existing program or include, resolving type, locking, writing, and optionally activating it. Read the current source first and submit the full edited text.

Instructions

Overwrite the source of an EXISTING ABAP program or include (report, include, module pool). Resolves program-vs-include automatically, then locks, PUTs the source, optionally activates, and unlocks. Refuses to run on production profiles. IMPORTANT: this replaces the WHOLE object - always read it first with get_program_source, edit that text, and send the complete result back.

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>",
      "source": "<source>"
    },
    "name": "update_program_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesComplete new ABAP source - REPLACES the entire object
activateNoActivate after writing. Default false - activate in SE38/SE80 yourself.
transportNoTransport request, e.g. D01K900123. 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.1/5.0
Behavior4/5

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

Because no annotations are supplied, the description carries the full burden and does well: it discloses auto-resolution of program vs include, the lock/PUT/activate/unlock sequence, that activation is opt-in, and that it refuses to run on production profiles. Left unstated are failure behaviour (whether the lock is released on error, what happens if activation fails) and error/return semantics.

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?

Three sentences, each earning its place, with the destructive-overwrite warning front-loaded before the procedural instruction. No filler or repetition of the schema.

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 tool with no annotations and no output schema, the definition covers the critical risks: full replacement, production refusal, activation default, and the read-first workflow. Only error handling and post-write return information are absent, which are minor against the schema's completeness.

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?

With 100% schema description coverage, the schema already documents all four parameters including their defaults and examples. The description reinforces the destructive 'whole object' semantics of source but adds no syntax, format, or transport nuance beyond the schema.

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?

The definition opens with a specific verb and resource: 'Overwrite the source of an EXISTING ABAP program or include', and it enumerates the object kinds (report, include, module pool). 'This replaces the WHOLE object' separates it from an incremental sibling such as patch_program_source without needing to open 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a concrete workflow prerequisite: always read the source first with get_program_source, edit the text, and send back the complete result. It does not explicitly name the condition under which patch_program_source is preferable, though 'replaces the WHOLE object' strongly implies it.

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