Skip to main content
Glama

query_table

Execute SQL queries against Unity Catalog tables and return results, using a specified SQL warehouse to retrieve data for AI-assisted analysis.

Instructions

Execute a SQL query against a Unity Catalog table and return results. Requires a SQL warehouse.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "warehouse_id": "<warehouse_id>",
      "query": "<query>"
    },
    "name": "query_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesSQL query to execute (e.g., "SELECT * FROM catalog.schema.table LIMIT 10")
schemaNoDefault schema to use (optional)
catalogNoDefault catalog to use (optional)
warehouse_idYesSQL warehouse ID to use for executing the query

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses that results are returned and that a warehouse is required, but says nothing about whether arbitrary DML/DDL (DELETE, DROP) is accepted, whether there are row limits or timeouts, what permissions are needed, or what the result shape looks like. For an arbitrary-SQL execution tool with zero annotation coverage, that is a substantial gap.

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?

Two short sentences with no filler, and the action is front-loaded ahead of the prerequisite. It is efficiently sized; only the lack of any behavioral detail keeps the brevity from being a strength rather than a limitation.

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

Completeness3/5

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

With four documented parameters and no output schema, the description need not explain return values. But with no annotations, a tool that runs arbitrary SQL should say more about read-only behavior, limits, and failure modes than it does. It is minimally adequate rather than complete.

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%, so every parameter including query, warehouse_id, catalog and schema is already documented in the input schema. The description adds no syntax conventions, catalog/schema resolution precedence, or warehouse selection guidance beyond what the schema states. Baseline 3 applies where the schema does the work.

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 states a specific verb and resource: 'Execute a SQL query against a Unity Catalog table and return results.' That is unambiguous and an agent can tell it apart from siblings like delete_table or get_table_details. It stops short of explicitly naming a competing alternative, but the purpose itself is clear.

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?

'Requires a SQL warehouse' is a useful prerequisite, and the mention of Unity Catalog scopes the target. However, there is no guidance on when to use this versus structured tools such as get_table_details, and no note that read-only vs mutating SQL is permitted. Usage is implied rather than stated.

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