Skip to main content
Glama

Search ABAP Object Source Lines

search_abap_object_lines
Read-onlyIdempotent

Search a single ABAP object's source for case-insensitive regex matches and return numbered matching lines to locate statements before editing or setting breakpoints.

Instructions

Find lines in one object's source that match a case-insensitive regular expression and return them as numbered lines (line number, then text). Use it to locate a statement before editing or setting a breakpoint; use where_used for references across objects and get_abap_object_lines to read the whole source. Read-only; searches a single object per call and reads the full source first.

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>",
      "pattern": "<pattern>"
    },
    "name": "search_abap_object_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesADT URL of the object or its source (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main)
patternYesCase-insensitive JavaScript regular expression; a plain word works as a substring (e.g. SELECT .* FROM MARA). An invalid expression fails the call.
connectionIdNoSAP system connection ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.16.2
    • changedInput schema / properties / pattern / description
      Previous value: -"Search pattern (case-insensitive substring or regex)"New value: +"Case-insensitive JavaScript regular expression; a plain word works as a substring (e.g. SELECT .* FROM MARA). An invalid expression fails the call."
    • changedInput schema / properties / url / description
      Previous value: -"ADT source URL of the object"New value: +"ADT URL of the object or its source (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main)"
  2. First observedv1.16.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, so the safety profile is covered; the description nonetheless adds the non-obvious operational detail that it 'reads the full source first' and searches only a single object per call. It does not detail result limits or ordering beyond the numbered-line format, keeping it just 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?

Two sentences, front-loaded with purpose and return format, then routing guidance. Every clause carries information — the editing/breakpoint motivation, the sibling routing, and the read-only plus single-object constraints — 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?

With no output schema, the description correctly compensates by describing the return as numbered lines (line number, then text). Combined with the full schema coverage and annotations, an agent has what it needs to call correctly; only per-call result limits or pagination behavior remain unstated.

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%, including the regex semantics and the invalid-expression failure mode, so the description only echoes what the schema already states. It adds no new meaning for connectionId or the ADT url format, leaving the schema to carry all parameter guidance.

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 opens with a specific verb and resource ('Find lines in one object's source that match a case-insensitive regular expression') and immediately states the return shape. The scope constraint 'one object's source' pairs with named alternatives, so an agent can distinguish it from get_abap_object_lines and where_used 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 an explicit use case ('locate a statement before editing or setting a breakpoint') and names two alternatives with the condition that selects each: where_used for references across objects, get_abap_object_lines for the whole source. When-not guidance is therefore implicit but unambiguous.

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