Skip to main content
Glama

Run ABAP (ADT Console)

sap_run_console
Destructive

Execute ABAP snippets directly on the SAP server via ADT class-run, with no RFC SDK needed. Call any function module or BAPI and return results using out->write().

Instructions

Execute an ABAP snippet server-side via the ADT class-run endpoint — no RFC SDK required. The snippet becomes the body of IF_OO_ADT_CLASSRUN~MAIN in a reusable local ($TMP) runner class, so it can CALL FUNCTION any function module / BAPI and print results with out->write( ). This is the SDK-free substitute for the sap_rfc_* tools.

Args:

  • abap_code (string): ABAP for the method body. 'out->write( v )' returns data; 'out' is ref to if_oo_adt_classrun_out.

  • class_name (string): runner class (default 'ZMCP_CONSOLE', $TMP local).

  • response_format.

Returns (json): { className, activated, output, message }.

Examples:

  • Call a function module: CALL FUNCTION 'RFC_SYSTEM_INFO' IMPORTING rfcsi_export = DATA(ls). out->write( ls-rfcsaprl ).

  • Quick value: out->write( |Client { sy-mandt }, user { sy-uname }| ). Notes:

  • Requires S_DEVELOP (creates/activates a temp class). Dev/sandbox only — not production.

  • For data-changing BAPIs, add CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' in the same snippet.

  • Prefer sap_read_table / sap_sql_query for plain data reads.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
abap_codeYesABAP statements for the method body. Use 'out->write( value )' to return data ('out' is ref to if_oo_adt_classrun_out). Can CALL FUNCTION any FM/BAPI.
class_nameNoRunner class name (default 'ZMCP_CONSOLE', created local in $TMP).
response_formatNoOutput format: 'markdown' (human-readable, default) or 'json' (structured).markdown
Install Server

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already indicate destructiveHint=true, and the description confirms this by stating the tool 'creates/activates a temp class' and requires S_DEVELOP. It adds important behavioral context: environment restriction, commit requirement for data-changing BAPIs, and temp-class lifecycle.

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?

The description is structured with Args, Examples, and Notes sections, front-loading the core purpose and then providing actionable usage details. Every section earns its place without redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description explicitly documents the return shape as { className, activated, output, message }. It also covers auth requirements, environmental constraints, examples, and sibling alternatives, making it fully actionable for an agent.

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 schema carries most parameter meaning. The description adds value beyond the schema with concrete examples for abap_code, including a full CALL FUNCTION pattern and inline output formatting, which clarify exactly how the parameter should be used.

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 ('Execute an ABAP snippet server-side') and resource ('ADT class-run endpoint'), and explicitly distinguishes itself as the SDK-free substitute for the sap_rfc_* tools. The scope is clear and differentiated from siblings.

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 sap_read_table / sap_sql_query for plain data reads, identifies itself as the RFC substitute, and warns it is dev/sandbox only, not production. This gives clear when-to-use and when-not-to-use guidance.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/appmaster3000/sap-abap-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server