Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

patch_bsp_file

Modify part of an existing BSP/UI5 repository file by replacing an exact unique string, avoiding full-content resends for small edits.

Instructions

Modify PART of an existing BSP/UI5 repository file without resending the whole content. Reads the current content, replaces oldString with newString (must match EXACTLY ONCE), then writes it back. Prefer this over update_bsp_file for small edits. 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": {
      "bspName": "<bspName>",
      "filePath": "<filePath>",
      "oldString": "<oldString>",
      "newString": "<newString>"
    },
    "name": "patch_bsp_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
bspNameYesBSP application name, e.g. ZMMUIGRACCEPT
filePathYesRelative file path inside the app, e.g. webapp/controller/Main.controller.js
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 well: it discloses the read-modify-write cycle, the exact-once match requirement (a real failure mode), and a production-environment refusal. It stops short of stating what error surfaces when the match is zero or multiple, whether a transport lock is required, or that the write is irreversible.

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 short sentences, front-loaded with the mechanism, then the alternative, then the safety constraint. No filler and nothing buried.

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 mutation tool with no annotations and no output schema, the description covers the mechanism, the matching contract, and one safety guard. The remaining gaps (failure behavior on non-unique match, transport lock prerequisites, response shape) are minor but real for a write operation.

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 all five parameters including transport and bspName are already documented. The description restates the oldString uniqueness rule that the schema already spells out ('Must occur exactly once - include enough context to be unique'), adding no syntax or format detail beyond it; 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 BSP/UI5 repository file') and immediately contrasts it with the sibling update_bsp_file. An agent can distinguish partial-patch from full-replace semantics 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 names the alternative ('Prefer this over update_bsp_file for small edits') and gives a hard exclusion ('Refuses to run on production profiles'). Both the selection condition and the blocking condition are stated rather than inferred.

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