Skip to main content
Glama

GetTable

Retrieve ABAP table structure from SAP systems to analyze database schema, understand field definitions, and support development workflows.

Instructions

Retrieve ABAP table structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the ABAP table

Implementation Reference

  • The handler function that implements the core logic of the GetTable tool. It fetches the ABAP table structure source code from the SAP ADT endpoint using the provided table_name.
    export async function handleGetTable(args: any) {
        try {
            if (!args?.table_name) {
                throw new McpError(ErrorCode.InvalidParams, 'Table name is required');
            }
            const encodedTableName = encodeURIComponent(args.table_name);
            const url = `${await getBaseUrl()}/sap/bc/adt/ddic/tables/${encodedTableName}/source/main`;
            const response = await makeAdtRequest(url, 'GET', 30000);
            return return_response(response);
        } catch (error) {
            return return_error(error);
        }
    }
  • Input schema definition for the GetTable tool, requiring a 'table_name' parameter.
    name: 'GetTable',
    description: 'Retrieve ABAP table structure',
    inputSchema: {
      type: 'object',
      properties: {
        table_name: {
          type: 'string',
          description: 'Name of the ABAP table'
        }
      },
      required: ['table_name']
    }
  • src/index.ts:317-318 (registration)
    Registration of the GetTable tool handler in the CallToolRequest switch statement, dispatching calls to handleGetTable.
    case 'GetTable':
      return await handleGetTable(request.params.arguments);
  • src/index.ts:18-18 (registration)
    Import statement for the GetTable handler function.
    import { handleGetTable } from './handlers/handleGetTable';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'retrieve' but doesn't clarify if this is a read-only operation, what permissions are needed, how errors are handled, or the format of the returned structure. This leaves significant gaps for a tool that likely interacts with a database system.

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 a single, efficient sentence with no wasted words. It is appropriately sized for a simple tool and front-loaded with the core action, making it easy to understand at a glance.

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

Completeness2/5

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

Given the complexity of retrieving database table structures, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'structure' entails (e.g., fields, types, keys), potential errors, or usage context, leaving the agent with insufficient information for reliable invocation.

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?

Schema description coverage is 100%, with the parameter 'table_name' fully documented in the schema as 'Name of the ABAP table'. The description adds no additional meaning beyond this, such as syntax examples or constraints, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the verb 'retrieve' and the resource 'ABAP table structure', making the purpose understandable. However, it doesn't differentiate from sibling tools like GetStructure or GetTableContents, which likely retrieve similar ABAP objects, so it doesn't fully distinguish itself.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like GetStructure or GetTableContents. The description lacks context about prerequisites, such as whether the table must exist or be accessible, or any exclusions for usage.

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

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