Skip to main content
Glama

hana_describe_table

Analyze and retrieve the structure of a specified table in SAP HANA Cloud Database using schema and table names, enabling efficient data management and integration with Cursor IDE.

Instructions

Describe the structure of a specific table

Input Schema

NameRequiredDescriptionDefault
schema_nameNoName of the schema containing the table (optional)
table_nameYesName of the table to describe

Input Schema (JSON Schema)

{ "properties": { "schema_name": { "description": "Name of the schema containing the table (optional)", "type": "string" }, "table_name": { "description": "Name of the table to describe", "type": "string" } }, "required": [ "table_name" ], "type": "object" }

Implementation Reference

  • The static async describeTable(args) method that implements the core logic of the hana_describe_table tool: handles optional schema_name using config default, validates inputs, queries table columns via QueryExecutor.getTableColumns(schema_name, table_name), formats the structure, and returns formatted response or error.
    static async describeTable(args) { logger.tool('hana_describe_table', args); let { schema_name, table_name } = args || {}; // Use default schema if not provided if (!schema_name) { if (config.hasDefaultSchema()) { schema_name = config.getDefaultSchema(); logger.info(`Using default schema: ${schema_name}`); } else { return Formatters.createErrorResponse( 'Schema name is required', 'Please provide schema_name parameter or set HANA_SCHEMA environment variable' ); } } // Validate required parameters const validation = Validators.validateRequired(args, ['table_name'], 'hana_describe_table'); if (!validation.valid) { return Formatters.createErrorResponse('Error: table_name parameter is required', validation.error); } // Validate schema and table names const schemaValidation = Validators.validateSchemaName(schema_name); if (!schemaValidation.valid) { return Formatters.createErrorResponse('Invalid schema name', schemaValidation.error); } const tableValidation = Validators.validateTableName(table_name); if (!tableValidation.valid) { return Formatters.createErrorResponse('Invalid table name', tableValidation.error); } try { const columns = await QueryExecutor.getTableColumns(schema_name, table_name); if (columns.length === 0) { return Formatters.createErrorResponse(`Table '${schema_name}.${table_name}' not found or no columns available`); } const formattedStructure = Formatters.formatTableStructure(columns, schema_name, table_name); return Formatters.createResponse(formattedStructure); } catch (error) { logger.error('Error describing table:', error.message); return Formatters.createErrorResponse('Error describing table', error.message); } }
  • Input schema definition for hana_describe_table tool specifying properties schema_name (optional string) and table_name (required string).
    { name: "hana_describe_table", description: "Describe the structure of a specific table", inputSchema: { type: "object", properties: { schema_name: { type: "string", description: "Name of the schema containing the table (optional)" }, table_name: { type: "string", description: "Name of the table to describe" } }, required: ["table_name"] } },
  • TOOL_IMPLEMENTATIONS mapping registers 'hana_describe_table' to TableTools.describeTable function.
    const TOOL_IMPLEMENTATIONS = { hana_show_config: ConfigTools.showConfig, hana_test_connection: ConfigTools.testConnection, hana_show_env_vars: ConfigTools.showEnvVars, hana_list_schemas: SchemaTools.listSchemas, hana_list_tables: TableTools.listTables, hana_describe_table: TableTools.describeTable, hana_list_indexes: IndexTools.listIndexes, hana_describe_index: IndexTools.describeIndex, hana_execute_query: QueryTools.executeQuery };

Other Tools

Related 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/HatriGt/hana-mcp-server'

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