Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

patch_class_include

Edits a class's separate include (local types, macros, test classes) outside source/main by replacing exact oldString with newString; run list_class_includes first for includeType.

Instructions

Modify PART of a class's SEPARATE include - local types (CCIMP / 'Local Types' tab), macros, or test classes - none of which live in /source/main (patch_class/update_class cannot reach these). Run list_class_includes FIRST to get the exact includeType string. Reads the include's current source, replaces oldString with newString (must match EXACTLY ONCE), locks the class, PUTs to the discovered include source, unlocks, and optionally activates the class. 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>",
      "includeType": "<includeType>",
      "oldString": "<oldString>",
      "newString": "<newString>"
    },
    "name": "patch_class_include"
  }
}

Input Schema

NameRequiredDescriptionDefault
activateNoActivate the class 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.
includeTypeYesExact includeType reported by list_class_includes for the include you want to edit

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/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: it discloses the exact execution sequence (read source, replace, lock, PUT, unlock, optional activate), the uniqueness constraint on oldString, and the production-profile refusal. These are precisely the mutation risks an agent needs before invoking a write tool.

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-loads scope and the key preconditions in a compact few sentences, with zero filler. The ALL-CAPS emphasis (PART, SEPARATE, EXACTLY ONCE) aids scanning, though the single dense paragraph could be easier to parse as a short list.

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 6-parameter mutation tool with no annotations and no output schema, the description covers the write lifecycle and the critical safety gate well enough to call it correctly. Minor gaps remain: it does not address failure/rollback behavior if the lock or PUT fails, nor how transport interacts with the lock step.

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 is already documented, including the 'exactly once' constraint on oldString and the 'reported by list_class_includes' provenance of includeType. The description restates these in workflow terms (ordering with list_class_includes, activate as optional) but adds no syntax or format detail beyond the schema, so baseline 3 is appropriate.

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 a class's SEPARATE include - local types, macros, or test classes') and explicitly scopes out what it does not touch (/source/main). It names patch_class and update_class as the tools that cannot reach these includes, so the agent can distinguish it from siblings without opening schemas.

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?

Gives an explicit prerequisite ('Run list_class_includes FIRST to get the exact includeType string') and an explicit prohibition ('Refuses to run on production profiles'). It also names the alternative tools (patch_class/update_class) and the condition under which they will not work.

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