Skip to main content
Glama

Read ABAP Source

sap_get_source
Read-onlyIdempotent

Read ABAP source code for programs, includes, classes, interfaces, or function modules, with line count and etag for version-safe updates.

Instructions

Read the ABAP source code of a program, include, class, interface, or function module.

Args:

  • object_type ('program'|'include'|'class'|'interface'|'function').

  • object_name (string): e.g. 'ZFI_POST', 'CL_FOO'.

  • function_group (string): required only for object_type='function'.

  • response_format ('markdown' | 'json').

Returns (json): { objectType, objectName, sourceUri, etag?, source, lineCount }. 'etag' identifies the version and enables concurrency-safe writes.

Examples:

  • "Show me class CL_FOO" -> object_type='class', object_name='CL_FOO'.

  • "Read function module Z_CALC in group ZFG1" -> object_type='function', object_name='Z_CALC', function_group='ZFG1'. Error Handling:

  • 404 -> wrong name/type, or missing function_group for a function module.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYesObject name (e.g. 'ZFI_POST', 'CL_FOO', 'Z_MY_FM').
object_typeYesKind of object: 'program', 'include', 'class', 'interface', or 'function'.
function_groupNoRequired only when object_type='function': the enclosing function group.
response_formatNoOutput format: 'markdown' (human-readable, default) or 'json' (structured).markdown
Install Server

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds useful behavioral context beyond that: it specifies the JSON return shape, mentions the etag for concurrency-safe writes, and documents 404 error cases. This is meaningful transparency without contradicting annotations.

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 well-structured with Args, Returns, Examples, and Error Handling sections. It is front-loaded with the core purpose, and 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?

Given the absence of an output schema, the description fully compensates by defining the return object, explaining etag semantics, and documenting error conditions. Combined with strong annotations and full parameter schema coverage, nothing critical is missing for an agent to call this tool correctly.

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 description coverage is 100%, so the baseline is 3. The description adds value with natural-language examples mapping 'Show me class CL_FOO' to parameters, clarifies that function_group is only required for object_type='function', and explains response_format choices. This goes slightly beyond the schema's own descriptions.

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 uses a specific verb and resource: 'Read the ABAP source code of a program, include, class, interface, or function module.' It clearly identifies the object types and the read-only nature, and the title 'Read ABAP Source' differentiates it from sibling tools like sap_write_source or sap_get_screen_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?

The description gives clear read-operation context with examples and error handling, so an agent can infer when to use it. It does not explicitly name alternatives or state when not to use it, but the read-only framing and sibling names make the intended usage obvious.

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