Skip to main content
Glama

GetTableContents

Retrieve data from ABAP tables in SAP systems to analyze content, extract information, or debug applications by specifying table names and row limits.

Instructions

Retrieve contents of an ABAP table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the ABAP table
max_rowsNoMaximum number of rows to retrieve

Implementation Reference

  • The main handler function that implements the GetTableContents tool. It validates input, constructs a custom ADT URL for table contents, makes the request, and returns the response or error.
    export async function handleGetTableContents(args: any) {
        try {
            if (!args?.table_name) {
                throw new McpError(ErrorCode.InvalidParams, 'Table name is required');
            }
            const maxRows = args.max_rows || 100;
            const encodedTableName = encodeURIComponent(args.table_name);
            //NOTE: This service requires a custom service implementation
            const url = `${await getBaseUrl()}/z_mcp_abap_adt/z_tablecontent/${encodedTableName}?maxRows=${maxRows}`;
            const response = await makeAdtRequest(url, 'GET', 30000);
            return return_response(response);
        } catch (error) {
            // Specific error message for GetTableContents since it requires custom implementation
            return return_error(error);
        }
    }
  • Defines the tool's metadata, description, and input schema including required 'table_name' and optional 'max_rows'.
    {
      name: 'GetTableContents',
      description: 'Retrieve contents of an ABAP table',
      inputSchema: {
        type: 'object',
        properties: {
          table_name: {
            type: 'string',
            description: 'Name of the ABAP table'
          },
          max_rows: {
            type: 'number',
            description: 'Maximum number of rows to retrieve',
            default: 100
          }
        },
        required: ['table_name']
      }
    },
  • src/index.ts:319-320 (registration)
    Registers and dispatches the CallToolRequest for 'GetTableContents' to the corresponding handler function.
    case 'GetTableContents':
      return await handleGetTableContents(request.params.arguments);
  • src/index.ts:20-20 (registration)
    Imports the handler function for GetTableContents.
    import { handleGetTableContents } from './handlers/handleGetTableContents';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action 'retrieve' but lacks details on permissions required, error handling, rate limits, or what the output looks like (e.g., format, pagination). This is a significant gap for a read operation tool with no annotation coverage.

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 that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an agent to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It does not explain behavioral aspects like what 'contents' includes (e.g., rows, columns), potential limitations, or error cases. For a tool with two parameters and no structured output information, more context is needed to guide effective use.

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, clearly documenting both parameters ('table_name' and 'max_rows') with defaults and requirements. The description does not add any additional meaning beyond this, such as examples or constraints, so it meets the baseline for adequate but not enhanced parameter semantics.

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 'contents of an ABAP table', making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'GetTable' (which might retrieve table metadata rather than contents) or 'SearchObject' (which might search across objects), leaving some ambiguity about when to choose this specific tool.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing the table name, or compare it to siblings like 'GetTable' or 'SearchObject', leaving the agent to infer usage context without explicit direction.

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