/** * GetUsageSnippets handler — line-level where-used hits * Endpoint: POST /sap/bc/adt/repository/informationsystem/usageSnippets * * Input is either the object_identifier values returned by GetWhereUsed, or an * object (object_name + object_type) for which the where-used search runs first. * Requires @babamba2/mcp-abap-adt-clients >= 3.15.0 (getUsageSnippets). */ import type { HandlerContext } from '../../../lib/handlers/interfaces'; /** Identifiers per usageSnippets POST. Keeps single requests small on large where-used results. */ export declare const SNIPPET_BATCH_SIZE = 50; export declare const TOOL_DEFINITION: { readonly name: "GetUsageSnippets"; readonly available_in: readonly ["onprem", "cloud", "legacy"]; readonly description: "[read-only] Line-level where-used hits: for each referencing object, the source lines that use the searched object, with uri \".../source/main#start=,\", line, column and the source line. Pass object_identifiers from GetWhereUsed references[].object_identifier, or object_name + object_type to run the where-used search first (customer_only / package filters apply to that search). Works on ECC 7.40 and S/4HANA."; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly object_identifiers: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly description: "object_identifier values from GetWhereUsed references[]. Takes precedence over object_name / object_type."; }; readonly object_name: { readonly type: "string"; readonly description: "Object to search (used when object_identifiers is not given)."; }; readonly object_type: { readonly type: "string"; readonly description: "Object type for object_name: class, interface, program, include, functiongroup, function_module, table, structure, dataelement, domain, view, tabletype (ECC), transaction (ECC), messageclass (ECC), package"; }; readonly customer_only: { readonly type: "boolean"; readonly description: "With object_name: only customer referencing objects (Z / Y name, or package Z* / Y* / $*). Default: false."; readonly default: false; }; readonly package: { readonly type: "string"; readonly description: "With object_name: package filter on the referencing objects (exact, or prefix with trailing *)."; }; readonly max_objects: { readonly type: "number"; readonly description: "Cap on referencing objects whose snippets are fetched. Default: 200. truncated=true when more were available."; }; readonly include_context: { readonly type: "boolean"; readonly description: "Include the multi-line context SAP returns per hit (description). Default: false."; readonly default: false; }; readonly timeout_ms: { readonly type: "number"; readonly description: "Optional request timeout in ms per SAP request (the where-used search and each snippet batch)."; }; }; readonly required: readonly []; }; }; interface UsageSnippetsArgs { object_identifiers?: string[]; object_name?: string; object_type?: string; customer_only?: boolean; package?: string; max_objects?: number; include_context?: boolean; timeout_ms?: number; } /** Split a list into chunks of `size`. */ export declare function chunk(items: T[], size: number): T[][]; export declare function handleGetUsageSnippets(context: HandlerContext, args: UsageSnippetsArgs): Promise<{ isError: boolean; content: { type: string; json: { requested_objects: number; available_objects: number; truncated: boolean; returned_objects: number; total_snippets: number; objects: any[]; notes: string[]; object_name?: string | undefined; object_type?: string | undefined; source: "object_identifiers" | "where_used"; }; }[]; } | { isError: boolean; content: { type: string; text: string; }[]; }>; export {}; //# sourceMappingURL=handleGetUsageSnippets.d.ts.map