Skip to main content
Glama

query_data

Execute a structured query against connected data sources. Convert the user's question to a structured intent and call this tool — do NOT try to write SQL or parse column names yourself. The engine resolves column meaning from mathematical relationships and statistical structure only. It works on any dataset without configuration. The governed filter shape is a record-predicate contract over normalized rows, not a SQL predicate language, so it also applies to Redis and other non-SQL sources.

Structural roles (use in metric.role):

  • derived_measure: the main financial/operational aggregate (revenue, spend, value)

  • base_measure: counts, quantities, discrete amounts

  • unit_measure: per-unit prices, rates

  • ratio: percentages, margins, fill rates (0-1 range)

  • metric: let the engine pick the best numeric column

If clarification_required is true, or if confidence < 0.85, check the candidates list and ask the user to clarify. Never fabricate column names or SQL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoTop-N limit. Use for 'top 5 customers' type questions.
orderNodesc
filterNo
metricNoWhat to measure.
sourcesNoData sources to query. Usually omitted when dataset_id is provided.
group_byNoDimension words from the user's question (e.g. ['customer', 'region']). The engine finds the best matching column.
dataset_idNoPreferred path. dataset_id returned by connect_data or list_data.
aggregationNoHow to aggregate the metric column.sum

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses key behaviors: the engine resolves column meaning from mathematical relationships, works on any dataset without configuration, uses a governed filter shape, and applies to non-SQL sources. It also states not to fabricate column names. However, it does not describe error handling or response format.

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?

The description is detailed but well-structured, starting with the main action, followed by warnings, role explanations, and error handling guidance. It is dense with information without being excessively verbose. Minor room for condensing, but overall effective.

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?

Given the tool's complexity (8 parameters, nested objects, no output schema), the description covers key aspects: roles, filter shape, error handling, and important constraints. It does not explain return format or detailed error states, but it provides sufficient context for typical queries.

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 description coverage is high (75%), so baseline is 3. The description adds significant meaning beyond schema: it explains the structural roles for metric (e.g., derived_measure, unit_measure) and provides usage hints like 'Use for top 5 customers type questions' for limit. This enhances understanding beyond the JSON schema.

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?

The description clearly states the tool's purpose: executing structured queries against connected data sources by converting user questions to structured intents. It explicitly distinguishes from writing SQL or fabricating column names, and the sibling tool 'query_sql_report' reinforces this distinction.

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?

The description provides explicit when-to-use and when-not-to-use guidance. It instructs to use this tool for structured queries from user questions, warns against writing SQL or parsing columns, and specifies to check clarification_required or confidence < 0.85 to ask for clarification. This effectively guides agent behavior.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

C2.7/5.0
Disambiguation4/5

Most tools target distinct resources or actions, but there is some overlap (e.g., run_repository_fix vs run_repository_pipeline vs simulate_repository) that could cause confusion. Overall, descriptions help differentiate.

Naming Consistency3/5

Tool names are primarily snake_case with a verb_noun pattern, but there are inconsistencies (e.g., single-word verbs like 'simulate', 'tokenize', and mixed prefixes like 'preview_', 'product_'). The pattern is readable but not uniform.

Tool Count1/5

With 140 tools, the server is extremely over-scoped for typical MCP usage. This overwhelms agents and suggests poor separation of concerns, likely violating the principle of minimal tool surfaces.

Completeness4/5

The tool set covers a wide range of functionalities including data onboarding, simulation, decisions, repository management, and admin operations. Minor gaps exist (e.g., no update_agent_run), but core workflows are well-supported.

Resources