Skip to main content
Glama
cvm-mcp
by msperlin

run_query

Read-only

Run read-only SQL queries across cached CVM tables to combine datasets, compute custom aggregates, and inspect data before writing longer queries. Use SELECT or WITH; results are row-limited.

Instructions

Run SQL across cached CVM tables (DuckDB engine).

Use it for questions that combine datasets, for aggregates the curated tools do not expose, and to inspect a table before writing a longer query. Only SELECT/WITH is allowed; the result is capped by limit.

Input Schema

NameRequiredDescriptionDefault
sqlYesA single read-only SELECT/WITH query. Views are named <dataset>__<table>, e.g. dfp__dre_con, fi_inf_diario__informe, vlmo__transacoes. Only cached periods exist.
limitNoMaximum rows returned.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

With readOnlyHint and openWorldHint already present, the description adds useful behavioral context: the DuckDB engine, SELECT/WITH-only restriction, cached-table scope, and result capping via limit. It does not cover error behavior or how cached periods are discovered, but the annotations carry much of the safety profile.

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?

The description is short, front-loaded with the core operation, and then immediately states the main usage cases and query restriction. Every sentence contributes without redundancy.

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 a complete input schema, an output schema, and annotations, the description is sufficient for an agent to call run_query correctly. It could be slightly stronger by pointing to dataset/table discovery tools or explaining how available cached periods are identified, but the core execution constraints are present.

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%, so both parameters are already documented in detail, including view naming and the maximum row cap. The description reinforces the read-only SELECT/WITH restriction and limit behavior but does not add syntax or format guidance beyond the 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 states a specific verb and resource: run SQL across cached CVM tables using DuckDB. It also distinguishes the tool from the curated domain-specific siblings by framing it as the option for cross-dataset or otherwise unexposed queries.

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 gives clear conditions for use: questions combining datasets, aggregates not exposed by curated tools, and inspecting a table before writing a longer query. It implies alternatives through 'curated tools' but does not name specific siblings or explicitly state when not to use it.

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