Skip to main content
Glama

Run DataLens saved SQL query

datalens_sqlqueries_run

Executes a saved SQL query on its DataLens connection and returns each statement's result, including any data changes it makes.

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.

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": {
      "sql_query_id": "<sql_query_id>"
    },
    "name": "datalens_sqlqueries_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsNoThe values of the parameters, by name; one left out takes its default.
dry_runNoSend nothing: answer `{dry_run: true, request}`, the first write the tool would make (null: none).
sql_query_idYesSQL query id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.142.2
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "default": false,
      +  "description": "Send nothing: answer `{dry_run: true, request}`, the first write the tool would make (null: none).",
      +  "type": "boolean"
      +}
  2. Addedv0.122.1

TDQS

A3.9/5.0
Behavior4/5

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

Adds genuine context beyond the annotations: the text runs exactly as saved, so a statement that changes data will change it, and the tool is experimental and 'not measured' in the DataLens API. These are real operational warnings, though there is a mild tension with destructiveHint:false that an agent must resolve by trusting the prose warning about data-changing statements.

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?

Front-loads purpose in the first sentence, follows with a mutation warning, and closes with a caveat about experimental status. Three sentences, no filler, though 'written from its document: not measured' is slightly cryptic phrasing.

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?

For a 3-parameter execution tool with no output schema, the definition covers what it does, what it returns, the mutation hazard, and the experimental caveat. Only the relationship to sibling tools and the semantics of multi-statement runs remain unaddressed.

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 all three parameters (sql_query_id, params, dry_run) are documented in the schema itself. The description adds no parameter-level syntax or defaults beyond that, which is acceptable given the schema is complete.

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?

States a concrete verb and resource – 'Run a saved SQL query on its connection' – plus the return shape, 'return the result of each statement'. This distinguishes it cleanly from the sibling CRUD tools (create/get/update/delete) in the sqlqueries family.

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 makes clear it executes an already-saved query, so its use is implicit. It does not state when to prefer this over related operations, nor does it mention prerequisites (e.g., the query must already exist, the connection/SQL being the saved one, or when to use the dry-run mode to preview).

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