Skip to main content
Glama

query_records

Retrieve and filter Mexico City open data records from datasets like crime reports, 911 calls, air quality, and business registries using SQL-like queries.

Instructions

Query records from a CDMX dataset (CKAN datastore, PostgreSQL).

Args: dataset_id: id on datos.cdmx.gob.mx (or shortcut: fgj, 911, ids, aire). where: SQL-ish WHERE, e.g. anio_hecho=2025 AND alcaldia_hecho="BENITO JUAREZ". String literals can use single or double quotes; identifiers are quoted automatically. select: comma-separated columns (for fewer tokens). order_by: e.g. "fecha_hecho desc". limit: 1-100. Defaults to 50. offset: for pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_idYes
whereNo
selectNo
order_byNo
limitNo
offsetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses some behavioral traits: it queries from a specific data source (CDMX dataset, CKAN datastore, PostgreSQL), mentions SQL-ish syntax for filtering, and notes defaults (limit defaults to 50). However, it lacks details on permissions, rate limits, error handling, or what the output looks like, leaving gaps for a query tool.

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 appropriately sized and front-loaded: the first sentence states the purpose, followed by a structured 'Args:' section with bullet-like explanations for each parameter. Every sentence adds value, with no wasted words, making it efficient and easy to scan.

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 (6 parameters, query functionality) and no annotations, the description is largely complete: it covers purpose, parameter semantics, and basic behavior. However, it lacks details on authentication, error cases, or output format, though the presence of an output schema mitigates the need to explain return values. Slight gaps remain in behavioral context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema: explains dataset_id shortcuts (fgj, 911, ids, aire), provides syntax examples for where, select, and order_by, clarifies string literal quoting, and states limit range (1-100) and defaults. This fully documents all 6 parameters with practical guidance.

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: 'Query records from a CDMX dataset (CKAN datastore, PostgreSQL).' It specifies the verb ('query'), resource ('records'), and context ('CDMX dataset'), distinguishing it from siblings like 'aggregate' or 'list_datasets' which serve different functions.

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?

The description provides clear context for usage by mentioning the CDMX dataset and CKAN datastore, but does not explicitly state when to use this tool versus alternatives like 'describe_dataset' or 'aggregate'. It implies usage for querying records but lacks explicit exclusions or comparisons to sibling tools.

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/devcsar/cdmx-mcp'

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