Skip to main content
Glama

Create DataLens connection

datalens_connections_create

Creates a DataLens connection and returns its ID. Supply workbook_id or dir_path to set its location; create Google Sheets connections in the DataLens interface first.

Instructions

Create a connection and return its id.

Give workbook_id (or dir_path) for where it lies. The password or the token you give is stored by DataLens and never returned by connections_get. A connection to Google Sheets (gsheets) cannot be created here: the API answers that the type is not editable; it is made in the DataLens interface and then read like any other.

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": {
      "connection": "<connection>"
    },
    "name": "datalens_connections_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
dry_runNoSend nothing: answer `{dry_run: true, request}`, the first write the tool would make (null: none).
connectionYesThe new connection; ``type`` says which kind it is and selects its schema. Its schema is not listed here: read `ConnectionCreate` with schema_get(service="datalens", name="ConnectionCreate"), then the definitions it refers to.

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?

Annotations already declare the write profile (readOnlyHint=false, destructiveHint=false, openWorldHint=true, idempotentHint=false), so the bar is lower. The description still adds non-obvious behavior: the password/token is persisted by DataLens and deliberately never echoed back by connections_get, and one connection type will fail server-side with an 'not editable' answer. It does not discuss retry/idempotency implications of repeated creates.

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

Conciseness3/5

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

Front-loaded with the action and return value, and no sentence is filler. However, the second paragraph is dense and slightly cryptic ('for where it lies'), mixing placement rules, secret handling, and a type exclusion in one run-on block, which slows scanning.

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?

A create tool with a nested, schema-by-reference payload and no output schema; the description covers placement, secret retention, the returned id, and the one blocked type, which is enough to call it correctly. It could say more about what happens when the referenced ConnectionCreate schema is followed incorrectly, but nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline would be 3. The description goes further by explaining that the connection object's `type` selects the schema variant and by directing the agent to resolve ConnectionCreate via schema_get before writing, which the inline schema hints at but does not fully operationalize. Location semantics for workbook_id versus dir_path are mentioned but their precedence is not made explicit.

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 and resource ('Create a connection') plus the return value ('return its id'), which is more than most create tools say. It implicitly separates itself from the read/update/delete siblings by pointing at connections_get for later retrieval, though it never explicitly contrasts with connections_update.

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

Usage Guidelines4/5

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

Gives concrete context requirements (workbook_id or dir_path for placement) and a genuine when-not: gsheets connections cannot be created here because the API rejects the type, so they must be made in the UI and then read normally. The alternative for gsheets is described as an external interface rather than a sibling tool, but the exclusion itself is explicit and actionable.

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