ABAP Repository (read)
abapSearch, 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
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | info: 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) | |
| line | No | where_used: Line of the symbol in the source; give together with column for a symbol-level search, omit for the whole object | |
| urls | No | sources: 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'] | |
| query | No | search: Object name or pattern; * is the wildcard (e.g. ZCL_ORDER*, *_ORDER_*) | |
| action | Yes | What to do: search, info, source, sources, grep, where_used, versions, package, text_elements, inactive, table, tables (see the tool description) | |
| column | No | where_used: Column of the symbol in that line; give together with line | |
| keyword | No | tables: Search text or name pattern; * is the wildcard (e.g. material*, *valuation*, T001*) | |
| pattern | No | grep: Case-insensitive JavaScript regular expression; a plain word works as a substring (e.g. SELECT .* FROM MARA). An invalid expression fails the call. | |
| category | No | text_elements: selections, symbols or headings. Omit for all three. | |
| tableName | No | table: SAP table or view name (e.g. MARA, WLK1, EKKO, Z_MY_TABLE) | |
| maxObjects | No | package: Most objects listed per package (default 500); the count of the rest is shown. | |
| maxResults | No | search: Max results (default 50) | tables: Maximum results per object type (default: 50) | |
| objectName | No | text_elements: Object name, e.g. ZCAR_MM_ORDERS | |
| objectType | No | search: 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 | |
| packageName | No | package: Package name to browse (e.g. ZORDER_API, $TMP for local objects) | |
| connectionId | No | search: 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 | |
| includeSubPackages | No | package: Also fetch and display the contents of any sub-packages found (at most 25, one level). Default: false |