Skip to main content
Glama
treasure-data

Treasure Data MCP Server

Official

query

Execute read-only SQL statements (SELECT, SHOW, DESCRIBE) in Trino dialect with Treasure Data UDFs to inspect data; use td_interval time filters for large tables.

Instructions

Execute a read-only SQL query (SELECT, SHOW, DESCRIBE) using Trino SQL dialect with Treasure Data UDFs. For better performance on large tables, use td_interval(time, '-30d/now') to limit the time range.

Input Schema

NameRequiredDescriptionDefault
sqlYesThe SQL query to execute using Trino SQL dialect. Supports Treasure Data UDFs like td_interval() and td_time_range(). For tables with time column, consider using these UDFs in WHERE clause to improve performance. Examples: td_interval(time, '-30d/now') for last 30 days, td_interval(time, '-7d/now') for last 7 days, td_interval(time, '-1d') for yesterday, td_interval(time, '-1h/now') for last hour, td_time_range(time, '2024-01-01', '2024-01-31') for specific date range.
limitNoMaximum number of rows to return (default: 40)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the burden and does usefully disclose the read-only constraint and the permitted statement classes, which is meaningful behavioral context. It omits permissions/auth requirements, timeouts, whether results are truncated, and how errors surface — significant gaps for a query-execution tool with zero annotation coverage.

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?

Two sentences, zero waste: purpose and dialect first, then the single most valuable performance tip. Nothing is buried or redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter tool with a fully described schema, the description covers dialect, statement types, and performance guidance adequately. But with no annotations and no output schema, it says nothing about what a result set looks like, how rows/columns are returned, or what happens on query failure — details an agent would want before invoking a raw SQL executor.

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 both `sql` and `limit` are already well documented, including UDF examples and the default/max row limits. The description repeats the td_interval performance advice already present in the schema, adding little beyond it; baseline 3 applies.

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 (Execute) and resource (read-only SQL query) and narrows scope with the allowed statement types (SELECT, SHOW, DESCRIBE) and Trino dialect. It clearly separates itself from list_databases/list_tables/describe_table, but it does not distinguish itself from the sibling tool named 'execute', which is the most likely confusion point.

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 second sentence gives a concrete usage condition for td_interval on large tables, which is genuinely actionable. However, there is no guidance on when to prefer this tool over the sibling 'execute' or over describe_table/list_tables, and no prerequisites or exclusions are stated.

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