Skip to main content
Glama
sap-mcp

sap-mcp

by abap-studio

create_function_module

Creates a function module in an existing function group, writes its full source, and optionally activates it. Requires create_function_group first; blocked on production profiles.

Instructions

Create a new function module inside an EXISTING function group, write its source, and optionally activate. Refuses to run on production profiles. Create the group first with create_function_group. Provide the full source/main text (FUNCTION . ... ENDFUNCTION.).

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>",
      "description": "<description>",
      "source": "<source>"
    },
    "name": "create_function_module"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesComplete FM source as ADT stores it (FUNCTION ... ENDFUNCTION.)
activateNoActivate after writing. Default false - activate in SE37/SE80.
transportNoTransport request. Omit only for $TMP objects.
descriptionYesShort description
functionGroupYesFunction group name WITHOUT the SAPL prefix, e.g. ZABL_UTIL
functionModuleYesFunction module name, e.g. Z_ABL_DO_THING

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key safety behavior: it refuses to run on production profiles, and activation is optional rather than automatic. It does not say what happens if the module already exists (fail vs overwrite), nor what the response looks like, which keeps it short of a 5.

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 short sentences, front-loaded with the action and scope, then the prerequisite, then the required input format. Nothing is redundant and nothing is buried.

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 six-parameter mutation tool with no annotations and no output schema, the description covers the critical gaps: environment restriction, prerequisite ordering, and source shape. Missing are the failure/overwrite semantics for an existing module and any return-value expectation, which is the only meaningful shortfall.

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%, so all six parameters are already documented, including the full-source format and the 'no SAPL prefix' rule for functionGroup. The description restates the source format but adds no syntax, constraints, or examples beyond what the schema provides, so the 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 ('Create a new function module') plus secondary actions (write source, optionally activate) and explicitly scopes it to an EXISTING function group. It also differentiates itself from the create_function_group sibling by naming it, so an agent can tell the two apart without opening either schema.

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?

Gives an explicit prerequisite ('Create the group first with create_function_group') and an explicit refusal condition ('Refuses to run on production profiles'), which is a genuine when-not-to-use rule. The activation alternative (activate later in SE37/SE80, reinforced by the activate default of false) further routes the agent.

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