Skip to main content
Glama

Get ABAP Object Source

get_abap_object_lines
Read-onlyIdempotent

Return the full ABAP source text of one object for read-only inspection; automatically appends /source/main when the URL omits it.

Instructions

Return the full ABAP source text of one object (program, class, function module, include, ...). Give the object URL and /source/main is appended automatically if you omit it. Use search_abap_object_lines to find a pattern instead of reading everything, get_abap_batch_lines for several objects at once, and get_abap_object_info for metadata only. Read-only; returns the stored version as one string, with no line numbers.

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": {
      "url": "<url>"
    },
    "name": "get_abap_object_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesADT URL of the object or its source (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main, /sap/bc/adt/oo/classes/zcl_order_api). Includes and function modules have their own URLs.
connectionIdNoSAP system connection ID (default connection if omitted)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.16.2
    • changedInput schema / properties / connectionId / description
      Previous value: -"SAP system connection ID"New value: +"SAP system connection ID (default connection if omitted)"
    • changedInput schema / properties / url / description
      Previous value: -"ADT source URL (e.g. /sap/bc/adt/programs/programs/Z_MY_PROG/source/main)"New value: +"ADT URL of the object or its source (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main, /sap/bc/adt/oo/classes/zcl_order_api). Includes and function modules have their own URLs."
  2. First observedv1.16.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the 'Read-only' sentence adds little, but the description goes further by disclosing that /source/main is appended automatically and that the stored (not active) version is returned as one string without line numbers. What it omits is behavior on very large sources, such as truncation or size limits, which matters for a tool that reads full source.

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?

Four short sentences, front-loaded with the core action, then the URL rule, then alternative routing, then return shape. Nothing is redundant or padded.

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?

With no output schema, the description still characterizes the return value (single string, no line numbers, stored version), which is the key detail for consuming the result. It falls short only on large-object behavior such as truncation or payload limits, which is a real concern for a full-source reader.

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, and the description earns above that by explaining the URL normalization rule: the /source/main suffix is appended automatically if omitted, which is not stated in the schema. The connectionId parameter is left entirely to the schema but is adequately documented there.

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 and resource (return the full ABAP source text of one object) and enumerates the object kinds covered (program, class, function module, include). The scope word 'one object' cleanly separates it from the batch sibling.

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 routes the agent to three alternatives with the condition that selects each: search_abap_object_lines for pattern lookup instead of reading everything, get_abap_batch_lines for multiple objects, get_abap_object_info for metadata only. An exclusion ('instead of reading everything') is stated outright.

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