Skip to main content
Glama
doris-mcp

doris-mcp

by fhm0520

doris_execute_query

Read-onlyIdempotent

Run read-only SQL queries against Doris and return result columns and rows, with non-read-only statements rejected and oversized results truncated at max_rows.

Instructions

执行只读 SQL 并返回列与行。非 SELECT/SHOW/DESC/EXPLAIN/WITH 一律拒绝, 本服务没有任何写通道。结果超出 max_rows 时 truncated=true。

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": "<sql>"
    },
    "name": "doris_execute_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes只读 SQL:SELECT / SHOW / DESC / EXPLAIN / WITH
databaseNo可选,执行前切换到的库
max_rowsNo可选,本次返回的最大行数

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true and destructiveHint=false, so the description isn't burdened with the safety story. It still adds real value beyond them: the enforced statement whitelist, the guarantee of no write channel, and the fact that overflow past max_rows surfaces as truncated=true rather than an error. Auth requirements and any server-side row/time limits are unmentioned.

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

Conciseness5/5

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

Three short clauses, front-loaded with the core action, then the rejection rule, then the truncation behaviour. Nothing is redundant and no sentence fails to earn its place.

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?

With rich annotations, a full-coverage schema, and an output schema to explain return values, the description covers the essential gaps: what is permitted, that writes are impossible, and how overflow is signalled. Only the database-switching semantics and any per-call cost or timeout expectations are left implicit.

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 the schema already explains sql, database, and max_rows. The description adds one piece of meaning the schema lacks, the truncated flag behaviour when max_rows is exceeded, but says nothing extra about the database switching parameter. Baseline 3 is appropriate.

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 gives a specific verb and resource: execute read-only SQL and return columns and rows. The allowed-statement whitelist (SELECT/SHOW/DESC/EXPLAIN/WITH) sharpens the scope, though it never names a sibling such as doris_explain_query to distinguish overlapping use cases.

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?

It states the when-not condition clearly: anything outside the whitelist is rejected and there is no write path in the service at all. It stops short of routing the agent to an alternative tool for explain plans or metadata lookups, which siblings like doris_explain_query and doris_describe_table would cover.

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