Skip to main content
Glama

GetInclude

Need the source code of an ABAP include? Provide the include name to retrieve it.

Instructions

[read-only] Retrieve source code of a specific ABAP include file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_nameYesName of the ABAP Include

Implementation Reference

  • Main handler function that fetches an ABAP include's source code via ADT REST API and returns it as text content.
    export async function handleGetInclude(context: HandlerContext, args: any) {
      const { connection, logger } = context;
      try {
        if (!args?.include_name) {
          throw new McpError(ErrorCode.InvalidParams, 'Include name is required');
        }
        const url = `/sap/bc/adt/programs/includes/${encodeSapObjectName(args.include_name)}/source/main`;
        logger?.info(`Fetching include: ${args.include_name}`);
        const response = await makeAdtRequestWithTimeout(
          connection,
          url,
          'GET',
          'default',
        );
        const plainText = response.data;
        if (args.filePath) {
          writeResultToFile(plainText, args.filePath);
        }
        logger?.info(`✅ GetInclude completed: ${args.include_name}`);
        return {
          isError: false,
          content: [
            {
              type: 'text',
              text: plainText,
            },
          ],
        };
      } catch (error) {
        logger?.error(
          `Error getting include ${args?.include_name ?? ''}: ${error instanceof Error ? error.message : String(error)}`,
        );
        return {
          isError: true,
          content: [
            {
              type: 'text',
              text: error instanceof Error ? error.message : String(error),
            },
          ],
        };
      }
    }
  • Tool definition/schema for GetInclude, specifying name, availability, description, and input schema with include_name as required string.
    export const TOOL_DEFINITION = {
      name: 'GetInclude',
      available_in: ['onprem', 'cloud', 'legacy'] as const,
      description:
        '[read-only] Retrieve source code of a specific ABAP include file.',
      inputSchema: {
        include_name: z.string().describe('Name of the ABAP Include'),
      },
    } as const;
  • Registration of the GetInclude tool in the ReadOnlyHandlersGroup, mapping the tool definition to its handler function.
    {
      toolDefinition: GetInclude_Tool,
      handler: (args: any) => handleGetInclude(this.context, args),
    },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden. It states the tool is read-only, which is positive, but does not disclose other behaviors like potential errors, authentication needs, or rate limits. The disclosure is minimal but not harmful.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: one sentence with 11 words. Every word is necessary, and the read-only hint is front-placed. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema), the description is nearly complete. It covers the main purpose and read-only nature. A minor improvement could be stating the return format, but it is adequate for an agent to select and invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for the single parameter 'include_name'. The description adds no extra meaning beyond 'Name of the ABAP Include'. Baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'Retrieve source code' of a specific ABAP include file. The verb 'Retrieve' and resource 'ABAP include file' are specific, and the name 'GetInclude' aligns perfectly. It naturally distinguishes from sibling Get tools for other ABAP objects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions '[read-only]' indicating no side effects, which guides appropriate usage. Though it does not explicitly list alternatives or when-not-to-use, the context of sibling tools and the name make the use case clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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