Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

get_enho_source

Reads the full ABAP source of a hook Enhancement Implementation (ENHO/XHH), including all ENHANCEMENT blocks, so you can inspect or modify SAP hook enhancements.

Instructions

Read the ABAP source of a hook Enhancement Implementation (ENHO/XHH) from SAP. Returns the full implementation source with all ENHANCEMENT blocks. Only ENHO/XHH (hook) objects have a text source - for BAdI implementations (ENHO/XHB) read the implementing class with get_class_source instead.

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": {
      "enhoName": "<enhoName>"
    },
    "name": "get_enho_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
subtypeNoENHO subtype: 'xhh' = hook (default, has source), 'xhb' = BAdI (no source - edit the implementing class)xhh
enhoNameYesEnhancement implementation name, e.g. ZEH_MY_HOOK

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does disclose the key behavioral trait: the full implementation source is returned, including all ENHANCEMENT blocks, and only hook objects have a text source. It does not cover error behavior, authorization requirements, or size limits, which are minor gaps for a read-only source tool but still omissions.

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?

Three sentences, front-loaded with the core action and followed immediately by the scope constraint and the alternative. Every sentence adds distinct information, with no repetition or filler.

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

Completeness4/5

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

For a simple two-parameter read tool with no output schema, the description explains what is returned (full source with ENHANCEMENT blocks) and how the subtype affects availability. Remaining omissions such as error cases and result size limits are not critical for selecting or invoking the tool correctly.

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 baseline is 3, but the description adds meaning beyond the schema by explaining why subtype matters: xhh is a hook with source, while xhb is a BAdI with no source and should be edited through its implementing class. This reinforces the enum semantics rather than merely repeating them.

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 the ABAP source of a hook Enhancement Implementation (ENHO/XHH) from SAP." It explicitly scopes the tool to hook objects and names the sibling get_class_source for BAdI implementations, so an agent can distinguish it from alternatives without inspecting schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance (ENHO/XHH hook objects only) and an explicit alternative for the excluded case (BAdI implementations, ENHO/XHB, should use get_class_source). It also clarifies that the xhb subtype has no editable source, which prevents a common misuse of the subtype parameter.

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