search_object
Search ABAP repository objects by name pattern using wildcards. Specify max results and optional system ID to locate development objects in SAP systems via ADT API.
Instructions
Search for ABAP repository objects by name pattern. Supports wildcards (*) for partial matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (e.g. Z_MY* or CL_ABAP*) | |
| max_results | No | Maximum results to return (default: 100) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/adt-client.ts:92-98 (handler)The actual implementation of searchObject in the AdtClient class. It performs an HTTP GET request to the SAP ADT repository information system search API with a query string and optional maxResults parameter, returning the raw XML response.
async searchObject(query: string, maxResults = 100): Promise<string> { const response = await this.http.get<string>( `/sap/bc/adt/repository/informationsystem/search?operation=quickSearch&query=${encodeURIComponent(query)}&maxResults=${maxResults}`, { headers: { Accept: "*/*" }, responseType: "text" } ); return response.data; } - src/mcp-server.ts:19-22 (schema)Zod schema (SearchObjectSchema) defining the input validation for the search_object tool: required 'query' string and optional 'max_results' number.
const SearchObjectSchema = z.object({ query: z.string(), max_results: z.number().optional(), }); - src/mcp-server.ts:433-445 (registration)Registration of the 'search_object' tool in the ListTools handler, defining its name, description, and input schema properties (query, max_results, system_id).
{ name: "search_object", description: "Search for ABAP repository objects by name pattern. Supports wildcards (*) for partial matches.", inputSchema: { type: "object" as const, properties: { query: { type: "string", description: "Search query (e.g. Z_MY* or CL_ABAP*)" }, max_results: { type: "number", description: "Maximum results to return (default: 100)" }, ...SYSTEM_ID_PROP, }, required: ["query"], }, }, - src/mcp-server.ts:1093-1097 (handler)The tool invocation handler for 'search_object' in the CallToolRequest handler. It parses args via SearchObjectSchema and calls client.searchObject(query, max_results), returning the result as text content.
case "search_object": { const { query, max_results } = SearchObjectSchema.parse(args); const results = await client.searchObject(query, max_results); return { content: [{ type: "text", text: results }] }; }