Skip to main content
Glama

Run DataLens saved SQL query

datalens_sqlqueries_run

Run a saved SQL query with optional parameters and return each statement's result, supporting both data reads and modifications via DataLens.

Instructions

Run a saved SQL query on its connection and return the result of each statement.

The text runs as it is saved: one that changes data changes it. Experimental in the DataLens API and written from its document: not measured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNoThe values of the parameters, by name; one left out takes its default.
sql_query_idYesSQL query id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.122.1

TDQS

B3.4/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true). The description adds real context beyond that: the query mutates data exactly as saved, results are returned per statement, and the tool is flagged as experimental and unverified. No contradiction with destructiveHint=false, since mutating data is not the same as irreversible destruction.

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 tightly written sentences with the action front-loaded and the mutation caveat immediately after. The experimental disclaimer is meta rather than operational, but it is short and does communicate a reliability caveat, so it earns its place.

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?

For a 2-parameter tool with no output schema, the description does cover the return shape ('result of each statement') and mutation semantics, which annotations already imply. It omits operational prerequisites such as how to find a valid sql_query_id and any authentication/permission expectations, leaving a usage gap.

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% and both parameters (sql_query_id, params) are documented in the schema, so the baseline is 3. The description adds nothing about parameter meaning, formats, or how named params map to the saved query.

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?

States a specific verb+resource: 'Run a saved SQL query on its connection and return the result of each statement.' The verb 'run' cleanly separates it from siblings like datalens_sqlqueries_get/create/update/delete. It does not explicitly name a sibling, but the execution semantics are unambiguous.

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 when-to-use guidance, no prerequisites, and no alternatives named. It never tells the agent how to obtain the required sql_query_id (e.g., via datalens_sqlqueries_get/list/create), nor when to prefer this over fetching the query definition. Only a mutability caution is offered.

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

Deploy Server

Other Tools