Skip to main content
Glama

Set Text Elements

set_text_elements
DestructiveIdempotent

Write and activate ABAP text elements for programs, function groups, or classes, including selections, symbols, and headings; merge updates or replace/remove entries as needed.

Instructions

Write text elements for an ABAP program, function group or class, in the format SAP requires. • selections — selection-screen texts for PARAMETERS / SELECT-OPTIONS. Set dictionaryReference: true to take the text from the data element (the SE38 'Dictionary ref.' box); text may then be empty and SAP fills it. Own texts max 30 characters. • symbols — TEXT-xxx, ids of 3 characters. Every symbol is written with a maximum length (maxLength, default the text's length); SAP rejects symbols without one. • headings — LISTHEADER (max 71) and COLUMNHEADER_1..COLUMNHEADER_4 (max 255). Writes MERGE by default: listed ids are added or updated, everything else is kept (the underlying ADT write replaces the whole category, so the tool reads first). Use remove to delete ids, or replace: true to write exactly the list. Returns what SAP stored, then activates the text elements (activating the program alone does not; pass activate: false to leave them inactive).

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": {
      "objectType": "<objectType>",
      "objectName": "<objectName>",
      "category": "<category>",
      "elements": "<elements>"
    },
    "name": "set_text_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
removeNoIds to delete from the category
replaceNoWrite exactly `elements` and drop everything else in the category. Default false = merge.
activateNoActivate the text elements after writing (default true). Activating the program does not activate them.
categoryYesselections, symbols or headings
elementsYesTexts to add or update
workItemNoName of the piece of work (e.g. HPM, a ticket). Keeps using the same transport for it across calls and sessions until you pass another.
objectUrlNoDeprecated and ignored — the text-element resource is derived from objectType+objectName
transportNoWorkbench request to record into. Checked before use; becomes the transport for this piece of work.
objectNameYesObject name, e.g. ZCAR_MM_ORDERS
objectTypeYesADT object type, e.g. PROG/P, FUGR/F, CLAS/OC
connectionIdNoSAP system connection ID
createTransportNoCreate a NEW Workbench request (only when you mean it; existing requests are preferred).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.16.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds the crucial non-obvious behavior: the underlying ADT write replaces the whole category, so the tool performs a read-then-merge, and replace:true is what actually drops data. It also discloses that writing does not imply activation and that returns reflect what SAP stored.

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-loaded with the write verb and organized as one bullet per category plus a paragraph on merge/replace/activation semantics. Dense but every clause carries operational information; only the parenthetical explaining the read-first implementation is arguably optional.

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 12-parameter mutation tool with no output schema, the description covers the write semantics, the destructive path, activation side effects, and return behavior. Remaining gaps (transport handling, per-connection behavior) are already documented in the schema descriptions, so nothing an agent needs to call it safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds domain meaning the schema cannot: symbols are TEXT-xxx ids of 3 characters and 'SAP rejects symbols without' a maxLength (defaulting to the text length), headings have concrete length caps (71 / 255), and dictionaryReference maps to the SE38 'Dictionary ref.' checkbox. Some flags (transport, workItem, createTransport) are left entirely to 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?

Opens with a specific verb and resource: 'Write text elements for an ABAP program, function group or class, in the format SAP requires.' It also enumerates the three categories (selections, symbols, headings) with their id conventions, making it clearly distinct from the read-side sibling get_text_elements.

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?

Gives explicit guidance for the three modes: default MERGE ('listed ids are added or updated, everything else is kept'), 'remove' to delete ids, and 'replace: true' to write exactly the list. Activation behavior is also spelled out. It stops short of naming get_text_elements as the way to inspect current texts before editing, which would complete the routing.

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