Skip to main content
Glama
Hollway

mcp-abap-abap-adt-api

by Hollway

findInSource

Read-only

Locate text or regex in ABAP source and get matching line numbers with context, without loading the full object. Searches source on the server, including INCLUDEd programs, to find FORM, MODULE, or any statement.

Instructions

Find text or a regular expression in the source of an ABAP object and get the matching line numbers with context - without pulling the source through the caller. This is how to locate a FORM, a MODULE or any statement in a report: there is no ADT fragment type for those, and asking fragmentMappings for one is answered with 400. For a report, searchIncludes follows its INCLUDE statements too.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexNoTreat pattern as a regular expression (default false).
patternYesWhat to look for. Plain text by default; set regex to treat it as a JavaScript regular expression.
versionNoWhich version to read: "active", "inactive" or "workingArea". Omit for the ADT default, which is the inactive one.
ignoreCaseNoCase-insensitive search (default true - ABAP source mixes cases freely).
maxMatchesNoStop collecting after this many matches (default 200). The total count is reported either way.
contextLinesNoLines of context to return around each match (default 0).
skipCommentsNoIgnore commented-out code: * in the first column, and anything after a " (default false).
searchIncludesNoAlso search the includes the program pulls in with INCLUDE (default false). One extra read per include.
objectSourceUrlYesSource URL, e.g. /sap/bc/adt/programs/programs/zr_app_foo/source/main

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds behavioral context: it operates 'without pulling the source through the caller', implying efficiency, and notes that searchIncludes causes 'one extra read per include', which is a cost indicator. It doesn't mention error behavior or edge cases, but given the annotations, the description adds meaningful value beyond them.

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?

The description is three sentences, each earning its place: the first states the core function, the second provides the primary use case and why alternatives fail, and the third notes a relevant option. It is front-loaded and free of filler.

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 read-only search tool with fully documented parameters, the description covers purpose, usage context, and key behavioral nuances. It explains why this tool is needed and mentions the searchIncludes option. The absence of an output schema is compensated by the statement that it returns 'matching line numbers with context'. Nothing essential is missing.

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 coverage is 100% with detailed descriptions for every parameter (e.g., regex, pattern, version, ignoreCase, maxMatches, contextLines, skipComments, searchIncludes, objectSourceUrl). The description does not add new parameter meaning beyond what the schema provides; it only references searchIncludes behavior already covered in the schema. Baseline 3 is appropriate.

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 states a specific verb (find) and resource (source of an ABAP object) with the output (matching line numbers with context). It explicitly differentiates from siblings by explaining that this is the only way to locate FORM/MODULE statements, since fragmentMappings returns 400 for those. The purpose is unambiguous and distinct.

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?

The description gives explicit when-to-use guidance: 'This is how to locate a FORM, a MODULE or any statement in a report' and explains why alternatives fail ('asking fragmentMappings for one is answered with 400'). It also mentions that searchIncludes follows INCLUDE statements, which is a usage hint. Clear exclusions and alternatives are provided.

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

Deploy Server

Other Tools