Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

get_function_module_source

Read the ABAP source of an existing function module to inspect current logic before updating or patching it; pass the function group name without the SAPL prefix.

Instructions

Read the source of an existing ABAP function module. Use this before update_function_module or patch_function_module to see what is already there. Pass the function group WITHOUT the SAPL prefix (e.g. ZFOO, not SAPLZFOO). Read-only, safe on any profile including production.

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": {
      "functionGroup": "<functionGroup>",
      "functionModule": "<functionModule>"
    },
    "name": "get_function_module_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
functionGroupYesFunction group WITHOUT the SAPL prefix, e.g. ZABLMM_QCF_WF. Tip: look up PNAME in TFDIR - SAPL<GROUP> means group <GROUP>.
functionModuleYesFunction module name, e.g. ZABLMM_QCF_WF_APPROVE

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description must carry the safety profile and it does: 'Read-only, safe on any profile including production' is exactly the disclosure an agent needs before calling against a live system. It omits return shape (source text vs. structured) and any size/truncation behavior for large function modules.

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?

Four short sentences, front-loaded with the core action, then usage timing, then the parameter gotcha, then the safety note. Every sentence carries distinct information with no padding.

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 two-parameter read with no output schema and no annotations, the description covers purpose, timing, the common naming pitfall, and safety. The one remaining gap is what the return actually looks like (raw ABAP source, full module vs. include boundaries), which is left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters already documented including the SAPL-prefix rule and the TFDIR lookup tip. The description repeats the prefix warning in different wording but adds no syntax or format meaning beyond what the schema already states, so baseline 3 applies.

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?

States a specific verb and resource: 'Read the source of an existing ABAP function module.' The resource is unambiguous against siblings like get_class_source, get_cds_source, or get_program_source, so an agent can route without opening any schema.

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?

Explicitly says to use it before update_function_module or patch_function_module 'to see what is already there,' which gives a clear workflow condition and names the alternatives. It does not state when-not to use it (e.g., for other object types), but the resource distinction makes that largely implicit.

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