get_package
Retrieve a list of all objects with their types and descriptions contained in an ABAP package from an SAP system by specifying the package name and optional system ID.
Instructions
Fetch ABAP package contents (list of objects with types and descriptions) from SAP system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Package name (e.g. $TMP) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:425-432 (registration)Registration of the get_package tool in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (requires a package name, plus optional system_id).
name: "get_package", description: "Fetch ABAP package contents (list of objects with types and descriptions) from SAP system", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Package name (e.g. $TMP)" }, ...SYSTEM_ID_PROP }, required: ["name"], }, }, - src/mcp-server.ts:1087-1091 (handler)Handler for the get_package tool in the CallToolRequestSchema handler. Parses the 'name' argument and delegates to client.getPackageContents(), returning the results as text.
case "get_package": { const { name: pkgName } = NameSchema.parse(args); const contents = await client.getPackageContents(pkgName); return { content: [{ type: "text", text: contents }] }; } - src/adt-client.ts:109-117 (helper)The getPackageContents() method on AdtClient which performs the actual API call. Sends a POST request to /sap/bc/adt/repository/nodestructure with the package name to fetch the package's contents (list of objects with types and descriptions).
async getPackageContents(name: string): Promise<string> { const body = `parent_type=DEVC%2FK&parent_name=${encodeURIComponent(name.toUpperCase())}&withShortDescriptions=true`; return (await this.postWithCsrf( "/sap/bc/adt/repository/nodestructure", body, "*/*", "application/x-www-form-urlencoded" )).data as string; }