Skip to main content
Glama

Read ABAP object

abap_read
Read-only

Retrieve ABAP object source, package listings, and detailed views like history, diff, definition, and lineage directly from your SAP system.

Instructions

Read an ABAP object: source, pseudo-DDL, a DEVC/K package listing, or (SUSO/B, TABL/DI) a read-only catalog render; view= selects docu/digest/history/diff/definition/lineage/footprint. A CLAS/INTF/PROG/FUGR source above 150 lines or 8k chars answers with its outline by default — then method=, pattern= (regex, with context), offset/limit, or full=true. To learn a method's signature, use method= with include="definitions" (declaration only); method= also finds inherited members (superclasses and interfaces) and reports foundOn. Returns an etag; capped ~15k tokens, truncation marked. Example: {"object":"ZCL_FOO","type":"CLAS/OC"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNodiff: newer side, same forms as `from`.
fromNodiff: older side — version, transport, or "active".
fullNoWhole source even above the default-outline threshold.
lineNo1-based source line. Required with view="definition"; refused otherwise.
typeNoADT type to disambiguate. DEVC/K: package listing (types/depth filter it). SUSO/B: renders the object's DEFINITION (fields, permitted activities) from the catalog — NOT who holds it, no AGR_*/UST* table is read. TABL/DI: <TABLE>/<INDEX> renders one index, bare <TABLE> lists them all. Not readable: PROG/PS PROG/PC PROG/PT.
viewNohistory: versions. diff: hunks. definition: element at line/column. lineage: CDS sources down to base tables. footprint: database writes and commits. docu: SAP documentation (type="SIMG" + object=<abap_img activity id> for an IMG activity). digest: one-page overview. Omit for a normal read.
depthNoDEVC/K: subpackage nesting depth, default 1, max 3. view="lineage": levels of underlying views, default 5, max 10.
fieldNoview="lineage" only: trace one field back to its base columns.
limitNoMax lines (chars if format=raw).
typesNoDEVC/K only: filter package contents to these kind codes, e.g. ["CLAS","DDLS"].
columnNo0-based column. Default 0. Only meaningful with view="definition"; refused otherwise.
formatNoraw: XML, not pseudo-DDL (DTEL/DE DOMA/DD TTYP/DA MSAG/N ENQU/DL SRVB/SVB only).
methodNoOnly this method/component.
objectYesName, "class X", "table Y", or ADT URI.
offsetNo1-based first line (chars if format=raw).
contextNoLines around each pattern match (default 2) or per diff hunk (default 3).
includeNoCLAS/OC only: which class include to read ("testclasses"=Unit tests; default "main"). Ignored, with a note, for every other type.
outlineNoComponent list with line ranges. Default for CLAS/INTF/PROG/FUGR above 150 lines or 8000 chars unless method/include/offset/limit/pattern/full is given.
patternNoRegex (case-insensitive): only matching lines, numbered, with `context` lines around each (like grep -n -C). Max 50 matches unless limit= is given; offset= sets the first line scanned.
versionNoDefault: current (active or newest inactive).
enhancementsNoBAdI/plug-in/enhancement-spot decode (ENHO/XH,XHH,ENHS), not source.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.36
    • changedInput schema / properties / include / description
      Previous value: -"Class include. \"testclasses\"=Unit tests. Default \"main\"."New value: +"CLAS/OC only: which class include to read (\"testclasses\"=Unit tests; default \"main\"). Ignored, with a note, for every other type."
    • changedInput schema / properties / type / description
      Previous value: -"ADT type to disambiguate. DEVC/K: package listing (types/depth filter it). SUSO/B: renders the object's DEFINITION (fields, permitted activities) from the catalog — NOT who holds it, no AGR_*/UST* table is read. TABL/DI: <TABLE>/<INDEX> catalog render. Not readable: PROG/PS PROG/PC PROG/PT."New value: +"ADT type to disambiguate. DEVC/K: package listing (types/depth filter it). SUSO/B: renders the object's DEFINITION (fields, permitted activities) from the catalog — NOT who holds it, no AGR_*/UST* table is read. TABL/DI: <TABLE>/<INDEX> renders one index, bare <TABLE> lists them all. Not readable: PROG/PS PROG/PC PROG/PT."
  2. Changed5 schema fields changedv0.6.25
    • changedInput schema / properties / context / description
      Previous value: -"diff: context lines per hunk. Default 3."New value: +"Lines around each pattern match (default 2) or per diff hunk (default 3)."
    • addedInput schema / properties / full
      Added value: +{
      +  "description": "Whole source even above the default-outline threshold.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / outline / description
      Previous value: -"Component list with line ranges."New value: +"Component list with line ranges. Default for CLAS/INTF/PROG/FUGR above 150 lines or 8000 chars unless method/include/offset/limit/pattern/full is given."
    • addedInput schema / properties / pattern
      Added value: +{
      +  "description": "Regex (case-insensitive): only matching lines, numbered, with `context` lines around each (like grep -n -C). Max 50 matches unless limit= is given; offset= sets the first line scanned.",
      +  "type": "string"
      +}
    • changedInput schema / properties / view / description
      Previous value: -"history: versions. diff: hunks. definition: element at line/column. lineage: CDS view sources down to base tables. footprint: database writes and commits. docu: SAP documentation (flattened ITF; type=\"SIMG\" + object=<abap_img activity id> for an IMG activity's docu). digest: one-page object overview. Omit for normal read."New value: +"history: versions. diff: hunks. definition: element at line/column. lineage: CDS sources down to base tables. footprint: database writes and commits. docu: SAP documentation (type=\"SIMG\" + object=<abap_img activity id> for an IMG activity). digest: one-page overview. Omit for a normal read."
  3. Changed5 schema fields changedv0.6.11
    • changedInput schema / properties / depth / description
      Previous value: -"DEVC/K only: subpackage nesting depth to list. Default 1."New value: +"DEVC/K: subpackage nesting depth, default 1, max 3. view=\"lineage\": levels of underlying views, default 5, max 10."
    • changedInput schema / properties / depth / maximum
      Previous value: -3New value: +9007199254740991
    • addedInput schema / properties / field
      Added value: +{
      +  "description": "view=\"lineage\" only: trace one field back to its base columns.",
      +  "type": "string"
      +}
    • changedInput schema / properties / view / description
      Previous value: -"history: versions. diff: hunks. definition: element at line/column. docu: SAP documentation (flattened ITF; type=\"SIMG\" + object=<abap_img activity id> for an IMG activity's docu). digest: one-page object overview. Omit for normal read."New value: +"history: versions. diff: hunks. definition: element at line/column. lineage: CDS view sources down to base tables. footprint: database writes and commits. docu: SAP documentation (flattened ITF; type=\"SIMG\" + object=<abap_img activity id> for an IMG activity's docu). digest: one-page object overview. Omit for normal read."
    • changedInput schema / properties / view / enum
      Previous value: -[
      -  "history",
      -  "diff",
      -  "definition",
      -  "docu",
      -  "digest"
      -]New value: +[
      +  "history",
      +  "diff",
      +  "definition",
      +  "lineage",
      +  "footprint",
      +  "docu",
      +  "digest"
      +]
  4. Changed5 schema fields changedv0.6.2
    • addedInput schema / properties / column
      Added value: +{
      +  "description": "0-based column. Default 0. Only meaningful with view=\"definition\"; refused otherwise.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / line
      Added value: +{
      +  "description": "1-based source line. Required with view=\"definition\"; refused otherwise.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / type / description
      Previous value: -"ADT type to disambiguate. DEVC/K: package listing (types/depth filter it). SUSO/B: renders the object's DEFINITION (fields, permitted activities) from the catalog — NOT who holds it, no AGR_*/UST* table is read. TABL/DI: <TABLE>/<INDEX> catalog render. Not readable: SHLP/DH VIEW/DV TRAN/T PROG/PS PROG/PC PROG/PT."New value: +"ADT type to disambiguate. DEVC/K: package listing (types/depth filter it). SUSO/B: renders the object's DEFINITION (fields, permitted activities) from the catalog — NOT who holds it, no AGR_*/UST* table is read. TABL/DI: <TABLE>/<INDEX> catalog render. Not readable: PROG/PS PROG/PC PROG/PT."
    • changedInput schema / properties / view / description
      Previous value: -"history: versions. diff: hunks. Omit for normal read."New value: +"history: versions. diff: hunks. definition: element at line/column. docu: SAP documentation (flattened ITF; type=\"SIMG\" + object=<abap_img activity id> for an IMG activity's docu). digest: one-page object overview. Omit for normal read."
    • changedInput schema / properties / view / enum
      Previous value: -[
      -  "history",
      -  "diff"
      -]New value: +[
      +  "history",
      +  "diff",
      +  "definition",
      +  "docu",
      +  "digest"
      +]
  5. Changed3 schema fields changedv0.5.14
    • addedInput schema / properties / depth
      Added value: +{
      +  "description": "DEVC/K only: subpackage nesting depth to list. Default 1.",
      +  "maximum": 3,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / type / description
      Previous value: -"ADT type to disambiguate. Not readable: SHLP/DH VIEW/DV TRAN/T PROG/PS PROG/PC PROG/PT SUSO/B TABL/DI."New value: +"ADT type to disambiguate. DEVC/K: package listing (types/depth filter it). SUSO/B: renders the object's DEFINITION (fields, permitted activities) from the catalog — NOT who holds it, no AGR_*/UST* table is read. TABL/DI: <TABLE>/<INDEX> catalog render. Not readable: SHLP/DH VIEW/DV TRAN/T PROG/PS PROG/PC PROG/PT."
    • addedInput schema / properties / types
      Added value: +{
      +  "description": "DEVC/K only: filter package contents to these kind codes, e.g. [\"CLAS\",\"DDLS\"].",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  6. Changed1 schema field changedv0.3.2
    • changedInput schema / properties / format / description
      Previous value: -"raw: XML, not pseudo-DDL (DOMA/DTEL/TTYP/MSAG/ENQU only)."New value: +"raw: XML, not pseudo-DDL (DTEL/DE DOMA/DD TTYP/DA MSAG/N ENQU/DL SRVB/SVB only)."
  7. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description reinforces and extends this by stating it is a read-only catalog render, answers with an outline above a size threshold, reports foundOn for inherited members, returns an etag, caps output near 15k tokens, and marks truncation. This is substantial behavioral context beyond the annotations and contains no contradiction.

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 dense but efficient, front-loads the core capability, and every sentence earns its place by adding a mode, threshold, or invocation technique. The closing JSON example anchors the most important input without wasted prose.

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?

For a 21-parameter tool with no output schema, the description covers the main object types, view modes, default truncation and outline behavior, truncation marking, etag, and parameter interactions. Remaining details such as enum-specific constraints are fully covered by the input schema, so nothing critical is missing for a correct call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is already strong, but the description adds real meaning above the schema: method= with include='definitions' yields a declaration-only signature, method= also finds inherited members and reports foundOn, pattern= behaves like grep with context lines, and full=true bypasses the outline default. These interactions are exactly what an agent needs to invoke the tool correctly.

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 states a specific verb and resource ('Read an ABAP object') and immediately enumerates the supported kinds: source, pseudo-DDL, package listing, and read-only catalog render. It names specific view modes and ends with a concrete example, so an agent can distinguish this from write tools like abap_write or abap_bopf_edit.

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 strong conditional guidance: large objects answer with an outline by default, method= with include='definitions' is the recommended way to learn a signature, and pattern=, offset/limit, and full=true are presented as explicit switches. It does not explicitly name alternative tools such as abap_search or abap_fpm_read, and readability exclusions like PROG/PS appear only in the schema, not the description.

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