Skip to main content
Glama
Datris MCP Server

Datris MCP Server

query_sqlserver

Run read-only T-SQL SELECT or WITH queries against a pipeline's SQL Server or Azure SQL destination, with server-resolved credentials and automatic row limits; omit SQL to preview the loaded table.

Instructions

Run a read-only query against the SQL Server or Azure SQL database a pipeline loads into. Pass the pipeline name; the server resolves the host, database, and credentials (any authMethod) from the pipeline's config — same connection the loader uses, credentials never leave the server. Only works for pipelines whose destination is SQL Server (database with useSqlServer=true). Allowed statements: SELECT and WITH (CTE) only, written in T-SQL. Rows are capped automatically: a statement with a top-level ORDER BY gets OFFSET 0 ROWS FETCH NEXT ROWS ONLY, any other is wrapped in SELECT TOP () — do not add LIMIT (not T-SQL). Omit sql to preview the pipeline's destination table (the 'did my load land?' check). Metadata discovery uses the same tool through INFORMATION_SCHEMA views — there are no separate list_sqlserver_* tools: SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES, SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = '<table>'. Queries run on the customer's server — keep them targeted and let the default limit stand unless the user asks for more.

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": {
      "pipeline": "<pipeline>"
    },
    "name": "query_sqlserver"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNoRead-only T-SQL statement: SELECT or WITH. Omit to preview the pipeline's destination table.
limitNoMaximum rows to return (default: 100). Pass -1 for unlimited.
pipelineYesPipeline name (from list_pipelines). Must have a SQL Server destination.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does: it discloses credential resolution from pipeline config (credentials never leave the server), row-capping mechanics (OFFSET/FETCH rewrite vs. SELECT TOP wrap), the read-only statement whitelist, and the customer-hosted execution constraint. These are behaviors an agent could not infer from the schema.

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-loaded with purpose and connection behavior, then constraints, then metadata examples — a logical order. It is dense and long for a three-parameter tool, and the INFORMATION_SCHEMA example queries could be trimmed, but nearly every sentence carries actionable information.

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?

There is no output schema and no annotations, yet the definition covers connection provenance, allowed syntax, row limits, and the no-arg preview mode, which is what an agent needs to invoke it correctly. It is silent on failure modes (missing table, timeout, permission denial) and on result shape, which are minor gaps for a query tool.

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 the baseline is 3; the description adds real meaning by explaining how `limit` is enforced (automatic TOP/OFFSET-FETCH rewriting) and by warning not to write LIMIT, plus reiterating that omitting `sql` yields a table preview. It does not add syntax guidance for the `pipeline` parameter beyond pointing at list_pipelines, which the schema already does.

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 specific verb and resource ('Run a read-only query against the SQL Server or Azure SQL database a pipeline loads into') and scopes it to pipelines whose destination is SQL Server, which cleanly separates it from the query_postgres/query_snowflake siblings. An agent can identify the tool's job without opening the schema.

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

Usage Guidelines5/5

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

Explicitly states when it applies (SELECT/WITH in T-SQL, useSqlServer=true pipelines), when it does not (non-SQL-Server destinations), and what to do instead for metadata needs — INFORMATION_SCHEMA queries through this same tool, since no list_sqlserver_* tools exist. Also tells the agent to omit `sql` for the destination-table 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