Skip to main content
Glama

ABAP Repository (read)

abap
Read-onlyIdempotent

Search, inspect, and read SAP repository objects and dictionary metadata, source code, where-used references, versions, packages, tables, and text elements in read-only mode.

Instructions

Find and read ABAP repository objects and the dictionary: search, metadata, source, where-used, versions, packages, text elements, tables. Read-only.

Actions (pass action plus that action's parameters; connectionId picks the system): • search — Search ABAP repository objects by name or wildcard pattern and return type, name, description and ADT URL for each hit. Use it to find the URL that abap(action: "source"), abap_write(action: "write") or abap(action: "where_used") need; use abap(action: "package") to list a package instead, abap(action: "grep") to search inside source, and abap(action: "tables") for tables by keyword. Read-only; at most maxResults hits (default 50). Required: query. Optional: objectType, maxResults. • info — g. classes). Does not return source code; use abap(action: "source") for that and transport(action: "for_object") for transport and lock state. Required: url. • source — ). Give the object URL and /source/main is appended automatically if you omit it. Use abap(action: "grep") to find a pattern instead of reading everything, abap(action: "sources") for several objects at once, and abap(action: "info") for metadata only. Required: url. • sources — Return the source of several ABAP objects in one call, each under a header line with its URL. One failing URL is reported as an error entry and does not stop the others. Use abap(action: "source") for a single object. Required: urls. • grep — Find lines in one object's source that match a case-insensitive regular expression and return them as numbered lines (line number, then text). Use it to locate a statement before editing or setting a breakpoint; use abap(action: "where_used") for references across objects and abap(action: "source") to read the whole source. Read-only; searches a single object per call and reads the full source first. Required: url, pattern. • where_used — List where an ABAP object, or a symbol inside it, is used (the where-used list). Returns each usage as a location with a source snippet when SAP provides snippets, otherwise as name, type and URL. For symbol-level search pass line and column of the symbol in the object's source. Required: url. Optional: line, column. • versions — List the stored revisions of an ABAP object, one line per revision: version id, date, author and version title. Lists metadata only, not the source of each version. Use it to see who changed an object and when; use transport(action: "for_object") for its current transport. Required: url. • package — List the objects directly inside an ABAP package, grouped by object type, with name and description (at most maxObjects per package). Sub-packages appear as entries of type DEVC/K; includeSubPackages also lists the contents of those one level down. Use it to explore a package; use abap(action: "search") to find an object by name across packages. Required: packageName. Optional: includeSubPackages, maxObjects. • text_elements — 4). Omit category to retrieve all three. Required: objectType, objectName. Optional: category. • inactive — List ABAP objects with an inactive version (saved but not activated): type, name and ADT URL, for the connected user's inactive worklist. Use it after abap_write(action: "write") to find what still needs activating, then pass the URLs to abap_write(action: "activate") or abap_write(action: "activate_many"). Read-only; takes no object input. • table — Show all field names, types, lengths, and descriptions for a SAP database table or view. Key fields are marked with 🔑. Use this after abap(action: "tables") to understand the structure before querying, so you know which fields to filter or select. Required: tableName. • tables — Find database tables and views by keyword when you do not know the technical name, via the ADT object search for types TABL and VIEW. Returns kind, name, package and description per hit, sorted by name, for standard, industry and Z/Y objects alike. Follow with abap(action: "table") for the fields, then data(action: "rows") or data(action: "query") (off unless ABAP_MCP_DATA_TOOLS=1) for the rows; use abap(action: "search") for other object types. Required: keyword. Optional: maxResults.

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": {
      "action": "<action>"
    },
    "name": "abap"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoinfo: ADT object URL, without /source/main (e.g. /sap/bc/adt/programs/programs/ZREPORT, /sap/bc/adt/oo/classes/zcl_order_api) | source: 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. | grep: ADT URL of the object or its source (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main) | where_used: ADT URL of the object (e.g. /sap/bc/adt/oo/classes/zcl_order_api) or, for a symbol, its source URL ending in /source/main | versions: ADT URL of the object (e.g. /sap/bc/adt/programs/programs/ZREPORT)
lineNowhere_used: Line of the symbol in the source; give together with column for a symbol-level search, omit for the whole object
urlsNosources: ADT URLs of the objects or their sources, e.g. ['/sap/bc/adt/programs/programs/ZREPORT/source/main', '/sap/bc/adt/oo/classes/zcl_order_api']
queryNosearch: Object name or pattern; * is the wildcard (e.g. ZCL_ORDER*, *_ORDER_*)
actionYesWhat to do: search, info, source, sources, grep, where_used, versions, package, text_elements, inactive, table, tables (see the tool description)
columnNowhere_used: Column of the symbol in that line; give together with line
keywordNotables: Search text or name pattern; * is the wildcard (e.g. material*, *valuation*, T001*)
patternNogrep: Case-insensitive JavaScript regular expression; a plain word works as a substring (e.g. SELECT .* FROM MARA). An invalid expression fails the call.
categoryNotext_elements: selections, symbols or headings. Omit for all three.
tableNameNotable: SAP table or view name (e.g. MARA, WLK1, EKKO, Z_MY_TABLE)
maxObjectsNopackage: Most objects listed per package (default 500); the count of the rest is shown.
maxResultsNosearch: Max results (default 50) | tables: Maximum results per object type (default: 50)
objectNameNotext_elements: Object name, e.g. ZCAR_MM_ORDERS
objectTypeNosearch: Restrict to one ADT object type: PROG, CLAS, FUGR, TABL, DTEL, DOMA, INTF, TRAN, etc. Default: all types | text_elements: ADT object type, e.g. PROG/P, FUGR/F, CLAS/OC
packageNameNopackage: Package name to browse (e.g. ZORDER_API, $TMP for local objects)
connectionIdNosearch: SAP system connection ID from sap_system(action: "systems") (default connection if omitted) | info, source, versions: SAP system connection ID (default connection if omitted) | sources, grep, where_used, package, text_elements, inactive, table, tables: SAP system connection ID
includeSubPackagesNopackage: Also fetch and display the contents of any sub-packages found (at most 25, one level). Default: false

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4/5.0
Behavior5/5

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

Beyond the readOnlyHint, idempotentHint, and destructiveHint=false annotations, the description discloses concrete behavior: grep searches one object and reads the full source, sources continues past a failing URL, search caps hits at maxResults, package caps objects, and inactive is tied to the activation workflow. It also states that info and versions return metadata only, not source.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The per-action bullet structure is appropriate for a twelve-action dispatcher and front-loads the overall purpose. However, the corrupted fragments in the info, source, and text_elements entries are not merely verbose but broken, and some action descriptions repeat the read-only property unnecessarily.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 17-parameter, twelve-action tool with no output schema, the definition is mostly complete: it describes outputs for search, sources, grep, where_used, versions, package, and tables. The truncated info, source, and text_elements entries leave real gaps about what those actions return and when exactly to choose them.

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 schema already documents parameter formats and defaults. The description adds action-specific meaning by grouping required and optional parameters per action, explaining line and column as symbol coordinates for where_used, includeSubPackages as one level down, and category omission as returning all three text-element types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence clearly states that this tool finds and reads ABAP repository objects and the dictionary, with a specific read-only scope. The twelve actions are enumerated, but the entries for info, source, and text_elements are garbled ("info — g. classes).", "source — ).", "text_elements — 4)."), which blunts clarity for those actions.

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 extensive routing guidance: search versus package versus grep versus tables, source versus sources versus info, and inactive followed by abap_write activate. Most alternatives are explicitly named, though the corrupted info, source, and text_elements entries lose their intended when-to-use guidance.

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