Skip to main content
Glama

Lock ABAP Object

lock_abap_object

Locks an ABAP object for the current SAP session and returns a handle, preventing other users from editing it across multiple calls until released.

Instructions

Take an exclusive edit lock (enqueue) on an ABAP object and return the lock handle; the lock belongs to this conversation's SAP session and blocks other users from changing the object. Rarely needed: write_abap_object_source locks and unlocks by itself, and abap_activate releases a held lock. Use it only to keep an object locked across several calls, and release it with unlock_abap_object. Fails if another user or session already holds the lock.

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": {
      "url": "<url>"
    },
    "name": "lock_abap_object"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesADT object URL (e.g. /sap/bc/adt/programs/programs/ZREPORT, /sap/bc/adt/oo/classes/zcl_order_api)
connectionIdNoSAP system connection ID (default connection if omitted)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.16.2
    • changedInput schema / properties / connectionId / description
      Previous value: -"SAP system connection ID"New value: +"SAP system connection ID (default connection if omitted)"
    • changedInput schema / properties / url / description
      Previous value: -"ADT object URL"New value: +"ADT object URL (e.g. /sap/bc/adt/programs/programs/ZREPORT, /sap/bc/adt/oo/classes/zcl_order_api)"
  2. First observedv1.16.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations: the lock is scoped to 'this conversation's SAP session', it blocks other users, and it 'fails if another user or session already holds the lock' – all key preconditions not expressed by readOnlyHint/openWorldHint/idempotentHint. This is consistent with idempotentHint=false (a second call would fail rather than be a no-op) and with destructiveHint=false (it blocks, but does not modify content).

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 dense sentences, front-loaded with what the tool does and immediately followed by the 'rarely needed' routing advice. No filler, and the failure condition is placed where an agent will read it before calling.

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 two-parameter tool with full schema coverage and no output schema, the description covers everything an agent needs: what the lock does, session ownership, contention failure, when to use it instead of alternatives, and how to release it. Nothing material is left out.

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% and both parameters (url, connectionId) are already documented in the schema, including URL format examples and the default-connection behavior. The description adds no syntax, format, or constraint detail for either parameter, so the baseline of 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?

Names a specific verb and resource ('Take an exclusive edit lock (enqueue) on an ABAP object') and states what is returned (the lock handle). It also explains the practical effect of the lock, so an agent can distinguish it from unlock_abap_object, write_abap_object_source, and abap_activate 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 Guidelines5/5

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

Explicitly says the tool is 'rarely needed', names the two siblings that already handle locking (write_abap_object_source, abap_activate), and gives the narrow condition that selects this tool: keeping an object locked across several calls. It also names the required counterpart, unlock_abap_object, so the full lifecycle is covered.

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