Skip to main content
Glama

GetClass

Retrieve ABAP class source code from SAP systems to access development artifacts for analysis or modification.

Instructions

Retrieve ABAP class source code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesName of the ABAP class

Implementation Reference

  • The main handler function that implements the logic for the GetClass tool. It fetches the source code of the specified ABAP class via the SAP ADT REST API.
    export async function handleGetClass(args: any) { try { if (!args?.class_name) { throw new McpError(ErrorCode.InvalidParams, 'Class name is required'); } const encodedClassName = encodeURIComponent(args.class_name); const url = `${await getBaseUrl()}/sap/bc/adt/oo/classes/${encodedClassName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
  • The schema definition for the GetClass tool, including name, description, and input schema specifying the required 'class_name' parameter.
    { name: 'GetClass', description: 'Retrieve ABAP class source code', inputSchema: { type: 'object', properties: { class_name: { type: 'string', description: 'Name of the ABAP class' } }, required: ['class_name'] } },
  • src/index.ts:309-310 (registration)
    Registration of the GetClass handler in the tool dispatch switch statement within the CallToolRequest handler.
    case 'GetClass': return await handleGetClass(request.params.arguments);
  • src/index.ts:15-15 (registration)
    Import statement registering the handleGetClass function for use in the MCP server.
    import { handleGetClass } from './handlers/handleGetClass';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mario-andreschak/mcp-abap-adt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server