ABAPilot

v1.0.7
io.github.NicoHern/abapilot-mcp Checked 3 hours ago Published 12 days ago

Governed MCP access to SAP ECC, S/4HANA and RISE, as the named SAP user.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

sap_analyze_query

Analyze a natural language query and return intelligent guidance for building the SAP query. This tool examines your query and returns: - Candidate tables to query - Query type (simple, multi-table, aggregation) - Detected date ranges - Aggregation hints (TOP N, SUM, COUNT) - Field recommendations with semantic context USE THIS FIRST before building complex queries to get field guidance!

ParameterTypeDescription
query *stringNatural language query (e.g., 'top 10 customers by sales in 2024')
fetch_metadatabooleanIf true, also fetch and classify field metadata for identified tables (default: true)

sap_check_notes_relevancy

Check relevancy of one or more SAP Note numbers against this system (component/SP levels, download state, implementation readiness). Composite tool: classifies each note via the /classify_note_v2 gateway endpoint and aggregates the results. Notes that were never downloaded into SNOTE are reported with needs_download=true — run sap_download_note_v2 (requires OSS connectivity) or sap_upload_note_v2 first for a definitive verdict on those.

ParameterTypeDescription
note_ids *arraySAP Note numbers to check (e.g., ["2198647", "1626838"])

sap_check_type_exists

Checks whether a type exists in the SAP Data Dictionary and returns its kind. Returns type_kind: TABL (transparent/cluster/pool table — queryable), STRU (structure — NOT queryable, cannot SELECT from it), VIEW (database view — queryable), DTEL (data element), TTYP (table type), BUILTIN, TYPEPOOL. Use this to verify whether an object is a real database table before attempting sap_read_table_data or sap_count_rows.

ParameterTypeDescription
type_name *stringType name to check

sap_count_rows

Estimate row count for a table BEFORE fetching data. Use this to check if a query will return too much data. Returns estimated count and recommendation (direct_read, use_pagination, use_streaming). ALWAYS use this before querying large tables like BKPF, EKKO, VBAK without date filters!

sap_diagnose_message

Diagnose a SAP error/warning/info message end-to-end. USE THIS when a user shares a SAP message — whether as a screenshot, text, or message ID. This tool performs a full diagnostic chain: 1. Resolves message class + number (from T100 text search if only text is provided) 2. Locates the exact source code line where the message is raised 3. Reads surrounding code to understand the triggering condition 4. Checks for active enhancements that may interfere 5. Returns a structured diagnosis with root cause analysis and fix suggestions. INPUT: Provide EITHER message_id + message_number (if known) O…

ParameterTypeDescription
languagestringSAP language key for T100 search (e.g., S=Spanish, E=English, D=German). Default: S.
message_idstringMessage class (e.g., V1, F5, ME). Omit if only message text is available.
message_numberstringMessage number (e.g., 001, 312). Omit if only message text is available.
message_textstringMessage text from screenshot or user description. Used to reverse-lookup message class/number from T100 when message_id is not known.
program_namestringABAP program name (e.g., SAPMV45A). Optional if transaction is provided.
transactionstringSAP transaction code where the message appeared (e.g., VA01, FB01, ME21N)

sap_discover_change_object

Find the change document OBJECTCLAS for a table by querying TCDOB. Use this before querying change documents if you don't know the object class.

ParameterTypeDescription
table_name *stringData Dictionary table name

sap_get_enhancements

List ALL enhancements for a SAP transaction or program in one call. Returns BAdIs (new + classic), customer exits (SMOD/CMOD), enhancement spots (implicit/explicit), and BTEs (Business Transaction Events). Each entry includes: type, name, implementation, active status, program, and include name. USE THIS when the user asks about enhancements, BAdIs, customer exits, user exits, SMOD, CMOD, SE18, SE19, BTEs, extension points, or custom code on a transaction. Pass transaction (e.g., 'BP', 'VA01', 'XD01') or program_name (e.g., 'SAPMV45A'). DO NOT manually query SXS_ATTR, SXC_ATTR, MODSAP, or MODA…

ParameterTypeDescription
program_namestringABAP program name (e.g., SAPMF02D for XD01/XD02, SAPMV45A for VA01)
transactionstringSAP transaction code (e.g., XD01, VA01, BP, MM02, ME21N). The program is resolved automatically.

sap_get_field_metadata

Get enriched metadata for SAP table fields with semantic classification. Returns field classifications including: - Amount fields (for SUM) with their currency field mappings - Customer fields distinguished by role (sold_to=KUNAG, payer=KUNRG, bill_to, ship_to) - Status/flag fields (deletion, cancellation indicators) with filter recommendations - Date fields for filtering - Currency fields USE THIS BEFORE building queries to understand which fields to use! Example: For 'top customers by sales', this tells you to use KUNAG (sold-to) not KUNRG (payer).

sap_infer_joins

Automatically detect join keys between two tables based on domain matching. Compares field domains to suggest join keys with confidence levels.

ParameterTypeDescription
table1 *stringFirst table name
table2 *stringSecond table name

sap_list_package_objects

List all ABAP repository objects in a development package (DEVCLASS). Returns objects grouped by type: programs (PROG), classes (CLAS), function groups (FUGR), tables (TABL), data elements (DTEL), domains (DOMA), structures (STRU), views (VIEW), etc. Use this to discover and inventory a codebase for documentation, migration analysis, or code review. Supports wildcard package names (e.g., 'Z*' for all Z packages). Also returns sub-packages if they exist. For custom namespace codebases, pass the top-level package and set include_subpackages=true.

ParameterTypeDescription
package *stringDevelopment package / DEVCLASS (e.g., 'ZCUSTOM', '/NAMESPACE/PKG')
include_subpackagesbooleanIf true, also scan sub-packages (reads TDEVC for hierarchy)
object_type_filterstringOptional: filter by object type (e.g., 'PROG', 'CLAS', 'FUGR', 'TABL'). Leave empty for all.

sap_lookup_error

Analyze a SAP error message using all available external knowledge sources. Queries: T100 message table, SAP Help Portal, web search (SAP community, StackOverflow), SAP Notes (if S-user configured), and previously learned error patterns. Use this AFTER getting dump/syslog data to understand root cause. Returns ranked results from multiple sources with links to documentation.

ParameterTypeDescription
error_message *stringThe error message to analyze. Can include SAP message codes like 'ME 003', dump error texts, or any error description from SAP.
contextstringOptional additional context: transaction code, program name, or description of what was happening when the error occurred.
sourcesarrayOptional list of sources to query. Defaults to all. Values: t100 (SAP messages), sap_help (documentation), web (community/StackOverflow), sap_notes (SAP Notes), learned (previously seen patterns).

sap_lookup_t100

Look up a specific SAP T100 message by message class and number. Use this when you see a message code like 'ME 003' or 'MM 001' in error messages, dumps, or syslog entries. Returns the full message text with placeholder descriptions.

ParameterTypeDescription
message_class *stringSAP message class (e.g., 'ME', 'MM', 'VL', 'SD')
message_number *stringMessage number (e.g., '003', '001', '100')
languagestringLanguage key (default 'E' for English). Use SAP internal codes: E=English, D=German.

sap_multi_table_query

Execute a multi-table query with proper joins and optional aggregation. Use this when you need data from 2+ tables that must be merged. Provide a JSON query plan with steps for each table, merge configuration, and optional aggregation. SUPPORTS AGGREGATION: For 'top N' queries, use the aggregation section to group, sum, sort, and limit results. IMPORTANT: Use this instead of multiple sap_read_table_data calls when you need joined data! CRITICAL - depends_on: When querying lookup/master data tables (KNA1, LFA1, MARA, etc.), ALWAYS use 'depends_on' and 'filter_field' to filter by keys from the p…

ParameterTypeDescription
query_plan *objectQuery plan with steps and merge configuration
confirmedbooleanSet to true after user confirms they want large results (>1000 rows)
limitintegerReturn only this many rows after sorting. Use with sort_by for 'last N' / 'top N' queries.
max_rowsintegerMaximum rows in final result (minimum 1000 enforced)
sort_bystringField to sort final results by (e.g., WADAT_IST, ERDAT, NETWR). Applied after merge.
sort_orderstringSort direction. Use 'desc' for most recent / highest first.

sap_patch_code

Change part of an existing ABAP program or class by sending only the replacements, instead of the whole source. Read the current source first. Requires S_DEVELOP change authorization in SAP; runs as the calling user and is logged in /ABAPILOT/AUDIT.

ParameterTypeDescription
object_name *stringObject name (e.g., Z_MY_REPORT, ZCL_MY_CLASS)
object_type *stringObject type to patch
replacements *arrayList of search/replace operations to apply
short_textstringDescription (only used if object doesn't exist yet)

sap_read_change_docs

Query change documents from CDHDR/CDPOS tables. Shows who changed what data and when. Use sap_discover_change_object first to find the correct OBJECTCLAS.

ParameterTypeDescription
date_fromstringStart date in YYYYMMDD format
date_tostringEnd date in YYYYMMDD format
include_fieldsbooleanInclude field-level changes from CDPOS
max_rowsintegerMaximum rows to return (server limit: 10000)
object_classstringChange doc object class (e.g., KRED=Vendor, DEBI=Customer, SACH=G/L Account)
object_idstringSpecific object ID to filter
userstringFilter by user who made changes

sap_read_change_docs_v2

Optimized change document query using function modules. Supports additional filtering by table name (TABNAME). Preferred over legacy endpoint.

ParameterTypeDescription
date_fromstringStart date in YYYYMMDD format
date_tostringEnd date in YYYYMMDD format
include_fieldsbooleanInclude field-level changes from CDPOS
max_rowsintegerMaximum rows to return (server limit: 10000)
object_classstringChange doc object class (e.g., KRED=Vendor, DEBI=Customer, SACH=G/L Account)
object_idstringSpecific object ID to filter
tabnamestringFilter by table name (e.g., LFBK for vendor bank data)
userstringFilter by user who made changes

sap_read_code

Retrieves the source code of an ABAP object (program, class, or function group). Optional `version` param ('ACTIVE' default, 'INACTIVE' for pending unactivated changes). When 'INACTIVE' is requested but no inactive version exists, returns the active version with `fallback_reason='no_inactive_version'`. The response includes a `version` field indicating which version was actually returned.

ParameterTypeDescription
object_name *stringName of the object (case-insensitive)
object_type *stringType of ABAP object
versionstringWhich source version to read. ACTIVE = last activated source (default). INACTIVE = pending unactivated changes (falls back to ACTIVE with fallback_reason='no_inactive_version' if not present).

sap_read_domain_values

Retrieves the fixed values defined for a domain. Useful for understanding valid values for fields like material type, document type, etc.

ParameterTypeDescription
domain_name *stringDomain name

sap_read_dump_details

Get detailed information for a specific short dump including full error texts, cause, and solution. Use this after sap_read_dumps to drill into a specific dump. Pass date, time, user, server, and error_id directly from the sap_read_dumps results.

ParameterTypeDescription
date *stringDump date in YYYYMMDD format (from sap_read_dumps 'date' field)
time *stringDump time in HHMMSS format (from sap_read_dumps 'time' field)
user *stringUser name who caused the dump (from sap_read_dumps 'user' field)
error_idstringError ID / RABAX name (from sap_read_dumps 'error_id' field). Improves error text lookup.
langustringLanguage for error texts (E=English, D=German). Defaults to system language.
serverstringApplication server (from sap_read_dumps 'server' field)

sap_read_dumps

Query ABAP runtime errors (short dumps) from SAP's ST22 transaction. Returns dump information including date, time, user, program, and error details.

ParameterTypeDescription
date_fromstringStart date in YYYYMMDD format (default: today)
date_tostringEnd date in YYYYMMDD format (default: today)
max_rowsintegerMaximum rows to return
userstringFilter by user name (optional)

sap_read_dynpros

Retrieves screen definitions for a program including field lists.

ParameterTypeDescription
object_name *stringName of the object (case-insensitive)
object_type *stringType of ABAP object

sap_read_field_domain_values

Get domain fixed values for a specific table field. Unlike /read_domain_values which requires the domain name, this finds the domain automatically from the field.

ParameterTypeDescription
field_name *stringField name
table_name *stringSAP table name

sap_read_foreign_keys

Read foreign key relationships for a table from Data Dictionary (DD08L). Shows which tables are related and can be joined.

ParameterTypeDescription
table_name *stringData Dictionary table name

sap_read_includes

Retrieves all include files for a program with their source code.

ParameterTypeDescription
object_name *stringName of the object (case-insensitive)
object_type *stringType of ABAP object

sap_read_jobs

Query background job information from SAP's SM37 transaction. Returns job status, execution times, and scheduling details.

ParameterTypeDescription
date_fromstringStart date in YYYYMMDD format (default: last 7 days)
date_tostringEnd date in YYYYMMDD format (default: today)
job_namestringFilter by job name prefix
max_rowsintegerMaximum rows to return
statusstringJob status: F=Finished, A=Aborted, R=Running, S=Scheduled, P=Ready
userstringFilter by scheduling user

sap_read_object_details

Read comprehensive details about any SAP repository or DDIC object. Supports: DTEL (data elements), DOMA (domains with fixed values), TRAN (transactions — shows linked program), MSAG (message classes — all messages), TABL/STRU (table/structure fields), VIEW (database views), TTYP (table types), SHLP (search helps), ENQU (lock objects). For source code objects (PROG, CLAS, FUGR, FUNC), use sap_read_code instead. Returns structured data including descriptions, field definitions, relationships, and metadata.

ParameterTypeDescription
object_name *stringObject name (e.g., MATNR for data element, VA01 for transaction, 00 for message class)
object_type *stringType of object to read

sap_read_object_info

Get metadata about an ABAP object including creation date, last changed date, author, and package.

ParameterTypeDescription
object_name *stringName of the object (case-insensitive)
object_type *stringType of ABAP object

sap_read_syslog

Query system log entries from SAP's SM21 transaction. Shows system events, warnings, and errors.

ParameterTypeDescription
date_fromstringStart date in YYYYMMDD format (default: today)
date_tostringEnd date in YYYYMMDD format (default: today)
max_rowsintegerMaximum rows to return
tcodestringFilter by transaction code
userstringFilter by user

sap_read_table_data

Reads actual data from a SAP table with optional WHERE clause filtering and metadata inclusion. Use this for small to medium datasets (up to a few thousand rows). IMPORTANT: If the query returns more than 1000 rows, you will receive a 'requires_confirmation' response with a preview. You MUST ask the user if they want to see all the data before calling again with confirmed=true.

ParameterTypeDescription
table_name *stringTable to read
confirmedbooleanSet to true after user confirms they want large results (>1000 rows)
field_liststringComma-separated field names to return (optional, defaults to all fields)
include_metadatabooleanInclude field structure metadata
max_rowsintegerMaximum rows to return (default: 10000)
where_clausestringSQL WHERE condition for filtering

sap_read_table_data_enhanced

Query data from an SAP table with optional WHERE clause filtering. Use this to retrieve business data like materials (MARA), purchase orders (EKKO), sales orders (VBAK), vendors (LFA1), customers (KNA1), etc. Supports ABAP WHERE clause syntax for filtering. For audit/compliance queries requiring ALL records, set audit_mode=true. Fields in WHERE clause and field_list are validated against table structure. Use sap_get_field_metadata or sap_read_table_structure first to discover correct field names.

sap_read_table_paginated

Read table data with pagination support for large result sets. Use offset and limit to page through results. Recommended for tables with 500-5000 rows. For larger tables, consider streaming. Fields in WHERE clause and field_list are validated against table structure. Use sap_get_field_metadata or sap_read_table_structure first to discover correct field names.

sap_read_table_structure

Retrieves the metadata of a Data Dictionary table including field definitions, data types, keys, and descriptions.

ParameterTypeDescription
table_name *stringData Dictionary table name

sap_read_texts

Retrieves text elements (selection texts, text symbols) for a program.

ParameterTypeDescription
object_name *stringName of the object (case-insensitive)
object_type *stringType of ABAP object

sap_read_translations

Reads translatable texts from a SAP object in source and optionally target language. Equivalent to SE63 in SAP GUI. Supports: PROG (text pool), DTEL (data element), DOMA (domain values), MSAG (message class), TABL (table/field texts), FUNC (function module), CLAS (class description + method/component descriptions + class text pool), CUAD (GUI status: function texts, titles, menus), DYNP (dynpro screens: screen titles, custom field texts, frame titles). Returns text IDs, source texts, existing target translations, and max lengths.

ParameterTypeDescription
object_name *stringName of the SAP object (e.g., ZPROG_EXAMPLE, MATNR, MTART, Z_MY_MSG)
object_type *stringType of SAP object. PROG=Program text pool, DTEL=Data element, DOMA=Domain fixed values, MSAG=Message class, TABL=Table/field descriptions, FUNC=Function module, CLAS=Class (description + method descr…
source_languagestringSAP 1-char language code for source texts. E=English, D=German, S=Spanish, F=French, I=Italian, J=Japanese, P=Portuguese, K=Korean, 1=Chinese. Default: E
target_languagestringSAP 1-char language code for target texts (optional). If provided, also reads existing translations in the target language.

sap_read_user_locks

Query user lock status from USR02 table. Shows which users are locked and their last login information.

ParameterTypeDescription
locked_onlybooleanOnly return locked users
max_rowsintegerMaximum rows to return
userstringFilter by user name prefix

sap_read_where_used

Queries SAP's cross-reference tables (WBCROSSGT/WBCROSSI) to find what objects use a given object (forward) or what a given object uses (inverse). Equivalent to SAP's 'Where-Used List' functionality. IMPORTANT: For heavily-used tables (MARA, KNA1, LFA1), use name_filter='Z*' to avoid timeout!

ParameterTypeDescription
object_name *stringName of the object to look up (e.g., MARA, BAPI_PO_CREATE, ZCL_MY_CLASS)
directionstringQuery direction: 'forward' finds what uses this object, 'inverse' finds what this object uses
max_resultsintegerMaximum number of results to return (max: 1000)
name_filterstringFilter pattern for object names (e.g., 'Z*' for custom objects, 'Y*' for Y namespace). Supports * as wildcard. REQUIRED for heavily-used tables like MARA to avoid timeout!
object_typestringType of the object

sap_run_program

Run an ABAP report in SAP, optionally with a variant, and return its list output. Runs as the calling user, only if the run_program endpoint is active in /ABAPILOT/CONFIG and the user's role allows it; switched off in the recommended read-only profile.

ParameterTypeDescription
report *stringABAP program name to execute (e.g., Z_PO_SUMMARIZER). Will be uppercased.
max_output_linesintegerMaximum output lines to return (default: 500)
variantstringSelection screen variant name (optional).

sap_run_transaction

Run the ABAP report behind a report transaction code, optionally with a selection-screen variant, and return its list output. Resolves the transaction to its program via TSTC, then runs it like sap_run_program (extended timeout with background-job fallback). Parameter 'tcode' (required) is the transaction code. Parameter 'variant' (optional) is a selection-screen variant (create it with sap_save_variant for programs with mandatory fields). LIMITATION: only report transactions (TSTC-PGMNA set) can run headlessly; pure dialog transactions are not supported.

ParameterTypeDescription
tcode *stringTransaction code (e.g. SE16, ZXYZ). Will be uppercased.
max_output_linesintegerMaximum output lines to return (default: 500)
variantstringSelection screen variant name (optional).

sap_save_variant

Create or overwrite an ABAP selection-screen VARIANT for a report, so it can be reused by sap_run_program (and the performance trace / headless runs) for programs whose selection screen has mandatory fields. Parameter 'report' (required) is the program name. Parameter 'variant' (required) is the variant name (<=14 chars). Parameter 'text' (optional) is a description. Parameter 'environment' (optional, default 'A') is 'A' online or 'B' batch. Parameter 'parameters' (required) is the selection values as a list of objects with keys: selname, kind ('P' parameter / 'S' select-option), sign ('I'/'E'…

ParameterTypeDescription
parameters *arraySelection values (RSPARAMS rows).
report *stringABAP report/program name. Will be uppercased.
variant *stringVariant name, max 14 chars. Will be uppercased.
environmentstringVariant environment: 'A' (online, default) or 'B' (batch).
textstringVariant description (optional).

sap_scan_security_notes

Discover ABAP Security/HotNews notes for a SAP patch-day month and rank them by relevancy to this system. Fetches the public SAP Focused Run CSA note policy (github.com/SAP-samples/frun-csa-policies-best-practices), compares each note's fixed-in support-package levels against the system's installed components (CVERS), and classifies the affected ones via /classify_note_v2. min_priority=1 for HotNews only (1=HotNews .. 4=Low; includes priorities <= the given value). month defaults to the latest published patch day.

ParameterTypeDescription
classifybooleanClassify affected notes via classify_note_v2 (implementation state on this system). Default true.
min_priorityintegerInclude notes with priority <= this value. 1=HotNews only, 4=all (default).
monthstringPatch-day month as YYYY-MM (e.g., 2026-06). Default: latest published.

sap_search_knowledge

Search SAP documentation and community for information on any SAP topic. Queries SAP Help Portal and web sources (community.sap.com, StackOverflow, blogs.sap.com). Use this to research SAP concepts, find best practices, or look up configuration guides. Unlike sap_lookup_error, this is for general knowledge queries, not specific error messages.

ParameterTypeDescription
query *stringSearch query. Examples: 'SAP BAPI_SALESORDER_CREATEFROMDAT2 usage', 'CDS view with currency conversion', 'MRP configuration best practices'
max_resultsintegerMaximum results per source (default: 5)

sap_search_tables

Search the Data Dictionary for tables matching a keyword. Returns table names and descriptions.

ParameterTypeDescription
keyword *stringSearch keyword
max_resultsintegerMaximum results to return

sap_smart_table_query

Execute a table query with automatic metadata-driven enhancements. This tool: 1. Fetches table metadata and classifies fields 2. Adds recommendations for currency filtering, status exclusion 3. Warns if you're using the wrong customer field 4. Executes the query with proper field validation Use this instead of sap_read_table_data when you want intelligent guidance!

sap_stream_table_data

Streams large table data using offset-based pagination. Call repeatedly with increasing offset to retrieve all data. Ideal for tables with millions of rows.

ParameterTypeDescription
table_name *stringTable to stream
offsetintegerStarting row offset
package_sizeintegerRows per chunk (recommended max: 10000)

sap_syntax_check

Validates ABAP source code for syntax errors without creating or activating it.

ParameterTypeDescription
source *arraySource code lines to check
program_namestringContext program name (optional)

sap_translate

Composite tool: reads translatable texts from a SAP object, translates them using AI, and optionally writes them back. Workflow: 1) Read source texts 2) AI translate with SAP terminology 3) Return translations for review (or auto-deploy if auto_deploy=true). Preserves SAP placeholders (&1, &2, etc.) and respects max_length constraints. Supports: PROG, DTEL, DOMA, MSAG, TABL, FUNC, CLAS, CUAD, DYNP.

ParameterTypeDescription
object_name *stringName of the SAP object
object_type *stringType of SAP object
target_language *stringSAP 1-char target language code (e.g., S=Spanish, D=German)
auto_deploybooleanIf true, automatically write translations to SAP after AI translation. If false (default), return translations for review first.
source_languagestringSAP 1-char source language code (default: E=English)

sap_write_code

Write ABAP source to SAP and activate it. Requires S_DEVELOP change authorization on the object; refused in productive clients. The response states whether activation succeeded. Runs as the calling user and is logged in /ABAPILOT/AUDIT. Use sap_syntax_check first for new code.

ParameterTypeDescription
object_name *stringName for the object
object_type *stringType of object to create
source *arraySource code lines
fugr_namestringFunction group name (required for FUNC type)
packagestringDevelopment package for CLAS (defaults to $TMP)
short_textstringDescription text
transportstringTransport request for CLAS (required if package != $TMP)

sap_write_code_safe

Guided write workflow for ABAP source, including ECC 6.0 compatibility handling. Same authorization and production guard as sap_write_code; runs as the calling user and is logged in /ABAPILOT/AUDIT. Available when the write_code_safe endpoint is active in your installation.

sap_write_translations

Writes translated texts back to a SAP object. Equivalent to saving translations in SE63. Provide an array of translations with text_id (from sap_read_translations) and the translated_text. Supports: PROG, DTEL, DOMA, MSAG, TABL, FUNC, CLAS, CUAD, DYNP.

ParameterTypeDescription
object_name *stringName of the SAP object
object_type *stringType of SAP object
target_language *stringSAP 1-char language code for the target language. E=English, D=German, S=Spanish, F=French, etc.
translations *arrayArray of translations to write