Skip to main content
Glama
josecarlos3390

SAP HANA MCP Server

Execute SQL query

hana_execute_query
Destructive

Prevent runaway queries by executing SQL against SAP HANA with enforced row limits, pagination, and write protection, enabling safe data access and exploration.

Instructions

Execute SQL against HANA. When HANA_QUERY_LIMITS_ENABLED=true, SELECT/WITH queries are wrapped with LIMIT/OFFSET (HANA_MAX_RESULT_ROWS) and row/column/cell caps apply; results are returned as-is otherwise. INSERT/UPDATE/DELETE are blocked by default; set HANA_ALLOW_INSERT, HANA_ALLOW_UPDATE, HANA_ALLOW_DELETE=true individually to permit each. Use limit, offset, maxRows, includeTotal as needed. If truncated, snapshotId may be returned for hana_query_next_page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoDeprecated alias for maxRows; prefer maxRows
queryYesThe SQL query to execute
offsetNoRow offset for paged reads (SELECT/WITH only)
maxRowsNoMax data rows to return this page (capped by HANA_MAX_RESULT_ROWS)
parametersNoOptional parameters for the query (for prepared statements)
timeout_msNoQuery timeout in milliseconds. 0 or omitted uses HANA_QUERY_TIMEOUT_MS (default 0 = disabled).
includeTotalNoIf true, run COUNT(*) on the same SELECT subquery (extra cost). Only for SELECT/WITH.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYes
rowsYes
offsetYes
columnsYes
maxRowsYes
elapsedMsNo
totalRowsNo
truncatedYes
nextOffsetNo
snapshotIdNo
appliedWrapYes
returnedRowsYes
columnsOmittedYes
Behavior5/5

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

The description goes well beyond the annotations by explaining the LIMIT/OFFSET wrapping, row/column/cell caps, default blocking of INSERT/UPDATE/DELETE with env vars to enable them, and the snapshotId for pagination. These are critical behavioral traits not present in the annotations (which only indicate destructiveness).

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

Conciseness4/5

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

The description is dense but efficient, front-loaded with the core purpose, followed by conditional behaviors and a brief parameter note. Every sentence adds value, though it could be slightly more scannable with clearer bullet points or separation between the query-limit and write-permission sections.

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 complexity (7 params, output schema, many siblings), the description covers the key behaviors: limits, write blocking, and pagination. It leaves some ambiguity about non-DML statements (e.g., DDL) when limits are enabled, but overall it is sufficiently complete for an agent to invoke it correctly in most scenarios.

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 already provides 100% coverage for parameters, so the description adds limited new meaning. It mentions 'Use limit, offset, maxRows, includeTotal as needed' but does not fundamentally expand on the schema's existing descriptions. The connection between maxRows and truncation/snapshotId is helpful but marginal.

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 opens with 'Execute SQL against HANA', a specific verb+resource that clearly defines the tool's core purpose. It further distinguishes itself from siblings by detailing the SQL execution behavior and referencing hana_query_next_page for pagination, showing it is the primary general-purpose query tool.

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

Usage Guidelines3/5

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

The description offers context about when queries are wrapped (HANA_QUERY_LIMITS_ENABLED=true) and when writes are permitted (via env vars), but it does not explicitly state when to use this tool versus alternatives like hana_get_sample_data or hana_explain_plan. It mentions hana_query_next_page as a continuation path, but lacks a clear 'use this for X, not Y' guideline.

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/josecarlos3390/sap-hana-mcp-server'

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