Skip to main content
Glama

sap_read_code

Retrieve source code of ABAP programs, classes, or function groups. Specify ACTIVE or INACTIVE version; falls back to ACTIVE when no INACTIVE version exists.

Instructions

Retrieves the source code of an ABAP object (program, class, or function group). Optional version param ('ACTIVE' default, 'INACTIVE' for pending unactivated changes). When 'INACTIVE' is requested but no inactive version exists, returns the active version with fallback_reason='no_inactive_version'. The response includes a version field indicating which version was actually returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
versionNoWhich source version to read. ACTIVE = last activated source (default). INACTIVE = pending unactivated changes (falls back to ACTIVE with fallback_reason='no_inactive_version' if not present).ACTIVE
object_nameYesName of the object (case-insensitive)
object_typeYesType of ABAP object

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed7 schema fields changedv0.1.2
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / object_name / description
      Previous value: -"Object name, e.g. ZREPORT01, ZCL_MY_CLASS"New value: +"Name of the object (case-insensitive)"
    • addedInput schema / properties / object_name / example
      Added value: +"ZPROG_EXAMPLE"
    • changedInput schema / properties / object_type / description
      Previous value: -"Object type: PROG, CLAS, FUGR, INCL or INTF"New value: +"Type of ABAP object"
    • addedInput schema / properties / object_type / enum
      Added value: +[
      +  "PROG",
      +  "CLAS",
      +  "FUGR"
      +]
    • addedInput schema / properties / version
      Added value: +{
      +  "default": "ACTIVE",
      +  "description": "Which source version to read. ACTIVE = last activated source (default). INACTIVE = pending unactivated changes (falls back to ACTIVE with fallback_reason='no_inactive_version' if not present).",
      +  "enum": [
      +    "ACTIVE",
      +    "INACTIVE"
      +  ],
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full behavioral transparency burden. It explicitly discloses conditional behavior: requesting INACTIVE falls back to ACTIVE with fallback_reason='no_inactive_version', and the response includes a version field. This is non-obvious and valuable.

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 three sentences, tightly focused, and front-loaded with the main purpose. Each subsequent sentence adds meaningful behavioral detail without redundancy or fluff.

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?

Given there is no output schema, the description usefully mentions the version field in the response but does not specify other return fields such as the actual source code field. For a read-only tool with simple object identification, this is nearly complete, but a bit more return-structure detail would make it fully self-contained.

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?

The schema already documents all three parameters with 100% coverage, including enums, defaults, examples, and detailed fallback behavior. The description largely restates the version semantics rather than adding new parameter meaning, so 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?

The description clearly states a specific verb and resource: 'Retrieves the source code of an ABAP object', and enumerates the object types (program, class, function group). It distinguishes itself from other read tools by focusing specifically on source code rather than metadata, objects, or data.

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?

The description makes the tool's context clear: when you need ABAP source code, and it explains version selection semantics. It does not explicitly name alternative tools (e.g., sap_read_object_details) or provide when-not-to-use guidance, but the context is evident enough for an agent.

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

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/NicoHern/abapilot-mcp'

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