Skip to main content
Glama
alcastaro

datosgobdo-mcp

by alcastaro

query_resource

Read-only

Run read-only SQL queries on cached open data resources, including CSV, TSV, XLSX, JSON, and ODS files. Supports SELECT statements with row limits for safe analysis.

Instructions

Run an ad-hoc read-only SQL query against a cached resource via DuckDB.

Power-user escape hatch when filter_resource / aggregate_resource don't cover the case. The cached resource is exposed as the in-memory table 'data'. SQL is DuckDB dialect — see https://duckdb.org/docs/sql/introduction. Supports CSV, TSV, XLSX, XLS, JSON, and ODS (auto-converted to CSV).

Safety:

  • Only SELECT/WITH statements (CTEs allowed); multi-statement blocked.

  • DDL/DML keywords (INSERT/UPDATE/DELETE/DROP/CREATE/ALTER/COPY/EXPORT/ IMPORT/TRUNCATE/GRANT/REVOKE/PRAGMA/SET/LOAD/INSTALL/ATTACH/DETACH/ VACUUM/ANALYZE) rejected outright.

  • Sandboxed: the resource is materialized in memory and external access is disabled, so table functions (read_text/read_csv/glob/...) cannot read local files or reach the network.

  • Row cap always applied via outer wrapper.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesDirect URL to the file (CKAN resource 'url' field).
formatYesFormat declared in CKAN. Accepts: csv, tsv, xlsx, xls, json, ods.
sqlYesRead-only SQL query against table 'data'. Only SELECT/WITH allowed; DDL/DML rejected. The query is wrapped in 'SELECT * FROM (<your sql>) LIMIT <limit>' so a row cap is always enforced. Example: "SELECT Estatus, COUNT(*) c FROM data WHERE Año=2026 AND Mes='Abril' GROUP BY Estatus ORDER BY c DESC"
limitNoHard cap on returned rows (1-1000).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
hintNo
source_urlNo
formatNo
cacheNo
sql_executedNo
rows_returnedNo
columnsNo
rowsNo
Behavior5/5

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

Goes well beyond annotations by detailing SQL dialect (DuckDB), sandboxing, file format support, and the fact that the query is wrapped with a LIMIT, providing comprehensive behavioral context.

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?

Well-structured with sections for purpose, dialect link, supported formats, and safety bullet points. Slightly lengthy but every sentence is informative; front-loaded with purpose.

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

Completeness5/5

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

Given the presence of an output schema, the description adequately covers purpose, usage, safety, and edge cases, making it fully informative for an agent.

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 coverage is 100% with good per-parameter descriptions. The description adds value by clarifying the underlying table name 'data' and the wrapping behavior of the SQL query, though not essential.

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?

Clearly states it runs an ad-hoc read-only SQL query against a cached resource via DuckDB, distinguishing itself from filter_resource and aggregate_resource as a power-user escape hatch.

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?

Explicitly tells when to use ('when filter_resource/aggregate_resource don't cover the case') and provides safety constraints like only SELECT/WITH and row cap, guiding appropriate usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alcastaro/datos.gob.do-MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server