Skip to content

Latest commit

 

History

History
executable file
·
413 lines (309 loc) · 18.2 KB

File metadata and controls

executable file
·
413 lines (309 loc) · 18.2 KB

vsp Tool Reference

Complete documentation for all 96 MCP tools available in vsp.

Mode Legend:

  • Focused - Available in focused mode (48 tools, default)
  • Expert - Only available in expert mode (96 tools total)

Unified Tools (2 tools) - Focused Mode

These tools replace 11 granular read/write operations with intelligent parameter-based routing:

Tool Description Mode
GetSource Unified read for any ABAP source. Parameters: type (PROG/CLAS/INTF/FUNC/FUGR/INCL/DDLS/VIEW/BDEF/SRVD/SRVB/MSAG), name, optional parent (for FUNC), optional include (for CLAS). Focused
WriteSource Unified write with auto-upsert. Parameters: type (PROG/CLAS/INTF/DDLS/BDEF/SRVD), name, source, mode, options. Supports create and update for classic ABAP and RAP types. Focused

Benefits: 70% token reduction, simplified tool selection, extensible for new types.

RAP Support (NEW): WriteSource now supports creating and updating CDS views (DDLS), behavior definitions (BDEF), and service definitions (SRVD).

Guarded updates: Call GetSource(include_hash=true) to receive {source, sourceHash}. Supply that hash as expected_source_hash to WriteSource, EditSource, ImportFromFile, or DeployFromFile; VSP checks it again after acquiring the write lock and rejects SOURCE_DRIFT rather than overwriting another editor's work. Guarded successes include the requested target and verified read-back hashes.

Summary reads: GetSource(summary=true) returns {objectType, name, uri, lines, bytes, sha256, sourceHash} instead of the source, from the same single read. sha256 is the lower-case hex SHA-256 of the exact text a read returns (not normalised). GetSource(if_none_match="<sha256>") answers unchanged: source sha256 ... while the source still has that digest, and the normal read otherwise; it compares the object's own source only, never the dependency context. sourceHash is omitted (with sourceHashNote) where WriteSource refuses it, such as a method-level read; uri is the source that served the text, with requested when that differs. Both summary and if_none_match bypass the response cache (VSP_CACHE), so "unchanged" is about the source as it is now. GetSource(include_hash=true) carries the same sha256 next to the source.


Search & Grep Tools (4 tools)

Tool Description Mode
SearchObject Quick search for ABAP objects by name pattern Focused
GrepObjects Regex search across multiple objects (array of URLs) Focused
GrepPackages Regex search across packages with recursive subpackage support Focused
GrepObject Regex search in single object Expert
GrepPackage Regex search in single package Expert

Grep Features:

  • Full regex support (Go regexp syntax)
  • Case-sensitive or case-insensitive matching
  • Context lines (like grep -C)
  • Object type filtering
  • Max results limit

Read Operations (15 tools)

Tool Description Mode
GetProgram Get ABAP program source Expert
GetClass Get ABAP class source Expert
GetInterface Get ABAP interface source Expert
GetFunction Get function module source Expert
GetFunctionGroup Get function group structure Focused
GetInclude Get ABAP include source Expert
GetTable Get table structure definition Focused
GetTableContents Get table data (supports SQL filtering) Focused
GetStructure Get structure definition Expert
GetPackage Get package contents Focused
GetTransaction Get transaction details Expert
GetTypeInfo Get data type information Expert
GetCDSDependencies Get CDS view dependency tree Focused
RunQuery Execute freestyle SQL query Focused

System Information (2 tools) - NEW

Tool Description Mode
GetSystemInfo Get SAP system information (SID, release, kernel, database) Focused
GetInstalledComponents List installed software components with versions Focused

Code Analysis (7 tools) - NEW

Tool Description Mode
GetCallGraph Who uses this object and what it uses, one hop, from the where-used list and the cross-reference tables Focused
GetObjectStructure Get object explorer tree structure Focused
GetCallersOf Who references this object, from the where-used list behind SE84 Expert
GetCalleesOf What this object's code reaches, from the CROSS and WBCROSSGT tables (references recorded at activation, not observed calls; needs free SQL) Expert
AnalyzeCallGraph Counts over one object's references: how many, of what kind, in which direction Expert
CompareCallGraphs Compare static vs actual execution for test coverage analysis Expert
TraceExecution COMPOSITE RCA TOOL: Static graph + trace + comparison for root cause analysis Expert

Development Tools (10 tools)

Tool Description Mode
SyntaxCheck Check source code for syntax errors Focused
Activate Activate an ABAP object Expert
ActivatePackage Batch activate all inactive objects in package Focused
RunUnitTests Execute ABAP Unit tests Focused
RunATCCheck Run ATC code quality checks Focused
CompareSource Unified diff between any two ABAP objects Focused
CloneObject Copy PROG/CLAS/INTF to new name Focused
GetClassInfo Quick class metadata (methods, attrs, interfaces) Focused
CreateTable Create DDIC table from JSON definition Focused
CreatePackage Create local package ($...) Focused

ATC (Code Quality) Tools (2 tools)

Tool Description Mode
RunATCCheck Run ATC check, returns findings with priority (1=Error, 2=Warning, 3=Info) Focused
GetATCCustomizing Get ATC system configuration Expert

Example ATC Output:

{
  "summary": { "totalFindings": 3, "errors": 1, "warnings": 2 },
  "worklist": {
    "objects": [{
      "name": "ZCL_TEST",
      "findings": [{ "priority": 1, "checkTitle": "Syntax Check", "line": 42 }]
    }]
  }
}

CRUD Operations (5 tools)

Tool Description Mode
LockObject Acquire edit lock Focused
UnlockObject Release edit lock Focused
CreateObject Create new object (program, class, interface, include, function group, function module, package, DDLS, BDEF, SRVD, SRVB) Expert
UpdateSource Write source code Expert
DeleteObject Delete an object Expert

RAP Object Creation (NEW): CreateObject now supports:

  • DDLS/DF - CDS DDL Source (view definitions)
  • BDEF/BDO - Behavior Definition
  • SRVD/SRV - Service Definition
  • SRVB/SVB - Service Binding (requires service_definition, optional binding_version, binding_category)

Service Binding Operations (2 tools) - NEW

Tool Description Mode
PublishServiceBinding Publish a service binding to make it available as OData service Expert
UnpublishServiceBinding Unpublish a service binding Expert

Parameters:

  • service_name (required) - Service binding name
  • service_version (default: "0001")

Class Include Operations (3 tools)

Tool Description Mode
GetClassInclude Get class include (definitions, implementations, macros, testclasses) Expert
CreateTestInclude Create test classes include Expert
UpdateClassInclude Update class include source Expert

Workflow Tools (5 tools)

Composite operations that combine multiple ADT API calls:

Tool Description Steps Mode
EditSource Surgical string replacement (matches Edit tool pattern) GetSource → FindReplace → SyntaxCheck → Lock → Update → Unlock → Activate Focused
WriteProgram Update program with activation Lock → SyntaxCheck → Update → Unlock → Activate Expert
WriteClass Update class with activation Lock → SyntaxCheck → Update → Unlock → Activate Expert
CreateAndActivateProgram Create new program Create → UpdateSource → Activate Expert
CreateClassWithTests Create class with unit tests Create → Lock → Update → CreateTestInclude → WriteTests → Unlock → Activate → RunUnitTests Expert

File-Based Deployment Tools (5 tools)

Solves token limit problem for large files:

Tool Description Mode
ImportFromFile File → SAP - Smart deploy with auto create/update detection Focused
ExportToFile SAP → File - Save object source to local file Focused
DeployFromFile Legacy name for ImportFromFile Expert
SaveToFile Legacy name for ExportToFile Expert
RenameObject Rename object by creating copy Expert

Supported Extensions (matched without regard to case):

  • .clas.abap - Classes (plus .clas.testclasses.abap, .clas.locals_def.abap, .clas.locals_imp.abap, .clas.macros.abap)
  • .prog.abap - Programs. When the .prog.xml abapGit writes beside it says <SUBC>I</SUBC>, it is the include named for the file (abapGit keeps includes this way); otherwise it must open with REPORT/PROGRAM naming the file's program.
  • .incl.abap - Includes (ExportToFile writes includes with this suffix)
  • .intf.abap - Interfaces
  • .fugr.abap - Function Groups
  • {group}.fugr.{module}.abap - Function Modules, abapGit's name (ExportToFile writes this when the group is known). {group}.fugr.{module}.func.abap and {module}.func.abap are still read; without the group in the name, a module cannot be deployed.
  • .ddls.asddls - CDS DDL Sources (ABAPGit format)
  • .bdef.asbdef - Behavior Definitions (ABAPGit format)
  • .srvd.srvdsrv - Service Definitions (ABAPGit format)
  • A typed file's object is always the one in its file name (# stands for /), never the one in its content. A file whose main statement names another object is refused rather than deployed under either name: zrep_top.prog.abap holding PROGRAM zrep. does not overwrite ZREP. In a .clas.abap/.intf.abap, DEFERRED, LOAD and local (non-PUBLIC) declarations before the global one are passed over.
  • Plain {name}.abap - typed from its first statement, only when that statement names {name} itself (REPORT zfoo. in zfoo.abap). A class or interface must be declared PUBLIC. A file with no such statement is read as include {name}, which is how older exports wrote includes. Anything else, such as a TOP include that opens with its main program's PROGRAM statement, is refused with a message saying how to rename it.

Code Intelligence Tools (7 tools)

Tool Description Mode
FindDefinition Navigate to symbol definition Focused
FindReferences Find all references to symbol Focused
CodeCompletion Get code completion suggestions Expert
PrettyPrint Format ABAP source code Expert
GetPrettyPrinterSettings Get formatter settings Expert
SetPrettyPrinterSettings Update formatter settings Expert
GetTypeHierarchy Get type hierarchy (supertypes/subtypes) Expert

Transport Tools (3 tools)

Tool Description Mode
CreateTransport Create transport request Expert
GetTransportInfo Get transport details Expert
ReleaseTransport Release transport Expert
GetUserTransports List a user's transports: workbench/customizing, modifiable/released, grouped by target and CTS project. Parameters request_type (KWT), request_status (DR), released_from/released_to, targets, source (auto/params/config/sql), config_uri Expert
GetInactiveObjects List inactive objects Expert

ExecuteABAP (Expert Mode)

Execute arbitrary ABAP code via unit test wrapper:

Tool Description Mode
ExecuteABAP Run ABAP code and capture output Expert

Risk Levels:

  • harmless - Read-only, no external calls
  • dangerous - Can write to DB, call external
  • critical - Full system access

See ExecuteABAP Implementation Report for details.


Runtime Errors / Short Dumps (2 tools) - RABAX

Tool Description Mode
ListDumps List runtime errors with filters (error type, program, user, date range) Focused
GetDump One dump in detail: header, termination point, application component, call stack Focused

Use Cases:

  • Monitor system health by checking recent dumps
  • Debug production issues by examining dump details
  • Track error patterns by error type

The rest of the post-mortem lives on the universal tool (hyperfocused mode), because it is a set of questions about a dump rather than more tools:

SAP(action="analyze", params={"type": "group_dumps"})       what keeps failing, not what failed once
SAP(action="analyze", params={"type": "explain_dump"})      the stack, plus the application log ranked by argument
SAP(action="analyze", params={"type": "similar_dumps"})     is this new, and how often
SAP(action="analyze", params={"type": "dump_impact"})       who else reaches the code that failed
SAP(action="analyze", params={"type": "application_log"})   SLG1 headers by program, user, log object; messages=true decodes BALDAT
SAP(action="analyze", params={"type": "cluster_read"})      any cluster table (BALDAT, INDX, STXL) decoded: objects, typed fields, rows

The same ground the CLI covers with vsp dumps, vsp applog and vsp cluster.


ABAP Profiler / Traces (2 tools) - ATRA

Tool Description Mode
ListTraces List ABAP runtime traces (profiler results) Focused
GetTrace Get trace analysis (hitlist, statements, dbAccesses) Focused

Analysis Types:

  • hitlist - Hot spots by execution time
  • statements - Statement-level trace
  • dbAccesses - Database access analysis

SQL Trace (2 tools) - ST05

Tool Description Mode
GetSQLTraceState Check if SQL trace is currently active Focused
ListSQLTraces List SQL trace files Focused

Git / abapGit Tools (2 tools) - NEW v2.16.0

Exports ABAP objects using abapGit's native serialization. Requires abapGit installed on SAP system.

Tool Description Mode
GitTypes Get list of 158 supported abapGit object types Focused
GitExport Export packages/objects as abapGit-compatible ZIP (base64) Focused

GitExport Parameters:

  • packages - Comma-separated package names (e.g., "$ZRAY,$TMP")
  • objects - JSON array of objects: [{"type":"CLAS","name":"ZCL_TEST"}]
  • include_subpackages - Include subpackages (default: true)

Returns: Base64-encoded ZIP with abapGit file structure:

src/
├── zcl_example.clas.abap      # Class source
├── zcl_example.clas.xml       # Class metadata
├── zif_example.intf.abap      # Interface source
└── ...

Tool Group: Git tools can be disabled with --disabled-groups G

SAP Requirements:

  • ZCL_ABAPGIT_OBJECTS - Core serialization class
  • ZCL_ABAPGIT_FACTORY - TADIR access factory
  • Install via abapGit standalone or S/4HANA Developer Edition

Install/Setup Tools - NEW v2.17.0

Deploy VSP components and dependencies to SAP systems via ADT.

Tool Description Mode
InstallZADTVSP Deploy ZADT_VSP WebSocket handler (6 ABAP objects) Focused
ListDependencies List available dependencies for installation Focused

InstallZADTVSP Parameters:

  • package - Target package name (default: $ZADT_VSP)
  • skip_git_service - Skip Git service if no abapGit (default: auto-detected)
  • check_only - Only check prerequisites, don't deploy

abapGit: install is CLI-only (standalone edition) for now: vsp install abapgit --edition standalone. The MCP install tool is being rebuilt (#277); the developer edition is not installable yet.

Architecture:

embedded/
├── abap/           # ZADT_VSP source (raw ABAP, go:embed)
│   ├── zif_vsp_service.intf.abap
│   ├── zcl_vsp_*.clas.abap
│   └── embed.go
│
└── deps/           # Dependencies (abapGit ZIP format)
    ├── abapgit-standalone.zip  # Embedded standalone ZABAPGIT
    ├── abapgit-full.zip        # Empty placeholder (#277)
    └── embed.go                # Unzip + deploy logic

Tool Group: Install tools can be disabled with --disabled-groups I


Report Execution Tools (6 tools) - NEW v2.19.0

Execute ABAP reports with parameters and capture ALV output. Includes async pattern for long-running reports.

Tool Description Mode
RunReport Execute report with params/variant, capture ALV output Focused
RunReportAsync Start report in background, returns task_id Focused
GetAsyncResult Poll or wait for async task completion Focused
GetVariants List available variants for a report Focused
GetTextElements Get selection texts and text symbols Focused
SetTextElements Update selection texts and text symbols Focused

Async Pattern:

1. RunReportAsync(report="RFITEMGL", params={...})
   → {"task_id": "report_1736034567_1", "status": "started"}

2. GetAsyncResult(task_id="...", wait=true)
   → Blocks up to 60s, returns full result when complete

Requires: ZADT_VSP WebSocket handler deployed to SAP system.

Tool Group: Report tools can be disabled with --disabled-groups R


Tool Count Summary

Mode Tools Description
Focused 54 Essential tools for AI-assisted development
Expert 99 All tools including low-level operations and RAP creation

Token Savings with Focused Mode:

  • Tool definitions: 50% reduction (~5,000 → ~2,500 tokens)
  • Typical workflow: 60% reduction
  • Decision clarity: 48 choices instead of 96