Skip to main content
Glama

read_abap_source

Read-only

Retrieve the full ABAP source code of a program, class, or function module. Automatically picks ADT or RFC transport and falls back on failure, so you get the source without choosing a method.

Instructions

Read the full ABAP source of a program, class, or function module. Automatically uses ADT (one call, most reliable — especially for classes, which need several RFC calls otherwise) when it's enabled and reachable, and transparently falls back to RFC (RPY_PROGRAM_READ / RPY_FUNCTIONMODULE_READ) otherwise — including on a live ADT failure, not just when it's disabled. You never need to choose the transport yourself; check the returned via field if you want to know which one actually served the read. function_group is required when object_type='function_module'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYesName of the program, class, or function module to read source for.
object_typeYesKind of ABAP object to read source for.
function_groupNoFunction group the function module belongs to. Required when object_type='function_module', ignored otherwise.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
viaYes
sourceYes
object_nameYes
object_typeYes
function_groupNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations by disclosing the ADT-first / RFC-fallback strategy, that the fallback triggers on live ADT failures (not just disablement), that classes need several RFC calls otherwise, and that the returned `via` field reports the actual transport used. This is exactly the behavioral detail an agent needs.

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 the purpose before the transport mechanics, and the multi-clause explanation is informative rather than padded. Slightly long for the payload, but each sentence carries real information about fallback behavior.

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?

An output schema exists, so return values don't need spelling out; the description instead covers the tricky behavioral aspect (transport selection and the `via` field). Nothing an agent needs in order to call this correctly is missing.

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 the schema already documents all three parameters. The one clause about function_group being required for function_module merely restates the schema's own description, adding no new meaning. 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 (Read) and resource (full ABAP source of a program, class, or function module), with the object scope enumerated. This is clearly distinguishable from the RFC-function siblings (search_rfc_functions, call_rfc_function, etc.), none of which read source.

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 strong context for invoking it: the transport choice is automatic and the agent 'never need[s] to choose the transport yourself.' However, it offers no explicit when-not-to-use guidance or comparison against sibling tools for cases where an agent might reach for an RFC reader instead.

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