Skip to main content
Glama

Check a RAP behavior/service definition

check_rap_behavior
Read-onlyIdempotent

Validate RAP behavior and CDS service definitions offline for syntax, structural, and cross-file consistency defects before they reach ADT.

Instructions

Check RAP behavior definitions (.bdef.asbdef) and CDS service definitions (.srvd.srvdsrv) for syntax and structural-consistency defects, offline, using abap-mcp's own BDL/SDL parser — abaplint does not deep-parse either file type (it stores a BDEF behind a single regex and a SRVD not at all), so this is the only static feedback these files get without a system. Reports the draft/etag/lock/authorization/numbering consistency set, strict-mode obligations, action/operation/validation/determination/side-effect coherence, projection 'use' statements against the base BDEF, and service 'expose' sets against the CDS entities you pass in the same call; with abapRelease set, it also flags constructs newer than that release from a bundled, dated copy of SAP's RAP BDL feature table. Use this when you have written or generated a BDEF/SRVD (by hand, from scaffold_rap_bo, or from a model that may have invented RAP syntax) and want it checked before it reaches ADT — and pass the base BDEF and the .ddls.asddls views alongside it, because the cross-file rules only run on files present in the call. It does NOT connect to SAP, does not activate anything, does not run ATC, cannot see DDIC tables, behavior-pool classes or CDS field types, and cannot certify that ADT would accept the file — the grammar is derived from SAP's published feature tables plus a 102-file corpus of Apache-2.0 SAP sample sources, so constructs it does not recognise are reported as info, never as errors. For ABAP classes use lint_abap; for a new BO use scaffold_rap_bo; for what a release added use explain_abap_release. Example: check_rap_behavior({ "files": [ { "filename": "zr_travel.bdef.asbdef", "source": "managed implementation in class zbp_travel unique;\nstrict ( 2 );\nwith draft;\n\ndefine behavior for ZR_Travel alias Travel\npersistent table ztravel\nlock master\n{ create; }\n" } ], "abapRelease": "2508" }).

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": {
      "files": "<files>"
    },
    "name": "check_rap_behavior"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesThe BDEF/SRVD files to check, plus any .ddls.asddls or base .bdef.asbdef you want cross-checked in the same call. Up to 32 files, 100k chars each — passing the base BDEF and the CDS views is what turns on the cross-file half of the rule set.
strictNoRun the strict-mode rules even when the BDEF does not declare strict/strict(2) — use it to see what a BO would have to fix before it can be released under the C0/C1 contract. Default false: strict rules run only on BDEFs that declare strict.
abapReleaseNoTarget ABAP Cloud release, e.g. "2508". When set, constructs whose SAP-documented minimum release is newer are reported as warnings (rule RAP900) from the bundled, dated feature table. Omit to skip release gating.

Output Schema

NameRequiredDescriptionDefault
filesYesOne row per supplied file: what it was taken to be, and whether it parsed.
summaryYesCounts, including the two honesty counters that make coverage gaps measurable.
findingsYesEvery rule finding, sorted by file, line, column, rule id.
scopeNoteYesExactly what this checker proves and does not prove — abaplint did not parse these files, and ADT remains the authority.
validatedYesChecked by abap-mcp's own RAP parser + rule set at the stamped grammar/rules version. It does NOT claim abaplint parsed it, that SAP's parser would accept it, or that the object would activate.
releaseGateNoPresent only when abapRelease was passed.
rulesVersionYesWhich rule set judged them, e.g. "rap-rules/1.0.0".
grammarVersionYesWhich BDL/SDL grammar read the files, e.g. "bdl/2026-09-10".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.13.2
    • changedInput schema / properties / abapRelease / enum
      Previous value: -[
      -  "2502",
      -  "2505",
      -  "2508",
      -  "2511",
      -  "2602",
      -  "2605",
      -  "2608",
      -  "pre-2502",
      -  "platform-2025"
      -]New value: +[
      +  "2502",
      +  "2505",
      +  "2508",
      +  "2511",
      +  "2602",
      +  "2605",
      +  "2608",
      +  "2611",
      +  "pre-2502",
      +  "platform-2025"
      +]
  2. Addedv0.12.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint=false and idempotentHint, but the description goes well beyond them: no SAP connection, no activation, no ATC, no visibility into DDIC tables, behavior-pool classes or CDS field types, and no certification that ADT would accept the file. It also discloses the false-positive policy (unrecognised constructs reported as info, never errors) and the provenance of the grammar, which is exactly the context needed to judge trust in results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The critical information (what is checked, that it is offline, and the call example) is front-loaded and the example anchors usage. It is dense and parenthetical-heavy in the middle, which slows parsing, but almost every clause carries distinct information rather than restating the name.

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

Completeness5/5

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

For a three-parameter analysis tool with a full output schema and no need to describe return values, the description still covers the rule set checked, cross-file requirements, release gating via RAP900, and a clear list of limitations. Nothing an agent needs to decide whether to call it or how to prepare inputs is missing.

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 schema already documents files, strict and abapRelease. The description still adds meaning by explaining why filename matters (cross-file checks key off names), why passing the base BDEF and DDLS turns on the cross-file half of the rule set, and what strict=true reveals (what a BO must fix to meet the C0/C1 contract).

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?

Opens with a specific verb and two named resources (BDEF .bdef.asbdef and SRVD .srvd.srvdsrv) and a specific defect class (syntax and structural consistency), scoped as offline. It then explicitly contrasts with abaplint and with siblings, so an agent can tell it apart from lint_abap or scaffold_rap_bo without opening a 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?

States the trigger condition precisely (after writing or generating a BDEF/SRVD by hand, from scaffold_rap_bo, or from a model that may have invented RAP syntax) and the precondition for full coverage (pass the base BDEF and .ddls.asddls views because cross-file rules only run on files present). It also names three alternatives with the condition that selects them: lint_abap for classes, scaffold_rap_bo for a new BO, explain_abap_release for release deltas.

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