Skip to main content
Glama
handleGetInclude.tsâ€ĸ1.51 kB
import { McpError, ErrorCode, AxiosResponse } from '../lib/utils'; import { makeAdtRequestWithTimeout, return_error, return_response, getBaseUrl, encodeSapObjectName } from '../lib/utils'; import { writeResultToFile } from '../lib/writeResultToFile'; import * as z from 'zod'; export const TOOL_DEFINITION = { name: "GetInclude", description: "Retrieve source code of a specific ABAP include file.", inputSchema: { include_name: z.string().describe("Name of the ABAP Include") } } as const; export async function handleGetInclude(args: any) { try { if (!args?.include_name) { throw new McpError(ErrorCode.InvalidParams, 'Include name is required'); } const url = `${await getBaseUrl()}/sap/bc/adt/programs/includes/${encodeSapObjectName(args.include_name)}/source/main`; const response = await makeAdtRequestWithTimeout(url, 'GET', 'default'); const plainText = response.data; if (args.filePath) { writeResultToFile(plainText, args.filePath); } return { isError: false, content: [ { type: "text", text: plainText } ] }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : String(error) } ] }; } }

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/fr0ster/mcp-abap-adt'

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