Skip to main content
Glama
doris-mcp

doris-mcp

by fhm0520

doris_explain_query

Read-onlyIdempotent

Inspect Doris SQL execution plans with EXPLAIN, VERBOSE, or GRAPH output to diagnose join and scan distribution before optimizing queries.

Instructions

看执行计划:EXPLAIN / EXPLAIN VERBOSE / EXPLAIN GRAPH。 graph 输出 ASCII 执行图,排查 join/scan 分布最直观(1.2 实测可用)。

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_explain_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes要分析的只读 SQL(SELECT/WITH)
formatNoplan(默认)/ verbose / graphplan
databaseNo可选,切换到的库

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered. The description adds that graph mode emits an ASCII execution diagram and notes a version caveat (verified on 1.2), which is genuine extra context, but says nothing about cost, latency, or side effects beyond that.

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 short lines, front-loaded with the purpose, and the format rationale follows immediately. The parenthetical version note is slightly informal but earns its place as a reliability hint.

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 simple three-parameter read-only tool with rich annotations and an output schema, the description covers purpose, format choices, and the main diagnostic use case. Only the relationship to sibling diagnostic tools is left unstated.

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 coverage is 100% and each parameter carries its own description, so the baseline is 3. The description clarifies what the graph value of format actually produces, which helps value selection, but leaves verbose and database unelaborated.

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 names a concrete verb and resource (view the execution plan) and enumerates the three EXPLAIN variants the tool exposes. An agent can tell this is plan inspection rather than query execution, though it never names the sibling it differs from (doris_execute_query / doris_get_query_profile).

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?

It gives one useful usage cue: use graph output when diagnosing join/scan distribution. There is no guidance on when to prefer this over doris_get_query_profile or doris_execute_query, and no exclusions or prerequisites are stated.

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