Skip to main content
Glama

Calgary Query

calgary_query
Read-onlyIdempotent

Run a raw SoQL query against any Calgary open-data resource (data.calgary.ca) by its Socrata id (8-char like "iahh-g8bj"). Full SoQL: where/select/group/order/limit/offset. Use calgary_datasets to find a resource id, or calgary_recent for the common ones.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "limit": 100,
      "where": "incident_year=2025",
      "_apiKey": "your-data-calgary-api-key",
      "resource_id": "iahh-g8bj"
    },
    "name": "calgary_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
groupNoSoQL $group (e.g. "incident_category").
limitNoMax rows (default 100, max 5000).
orderNoSoQL $order (e.g. "incident_datetime DESC").
whereNoSoQL $where filter (e.g. "incident_year=2025").
offsetNoRow offset for paging.
selectNoSoQL $select (e.g. "incident_category, count(*)").
_apiKeyNoOptional, your own Socrata app token for higher rate limits. Omit to use the keyless endpoint.
resource_idYesSocrata resource id, e.g. "iahh-g8bj" (police incidents).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / _apiKey / description
      Previous value: -"Optional — your own Socrata app token for higher rate limits. Omit to use the keyless endpoint."New value: +"Optional, your own Socrata app token for higher rate limits. Omit to use the keyless endpoint."
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "_apiKey": "your-data-calgary-api-key",
      +    "limit": 100,
      +    "resource_id": "iahh-g8bj",
      +    "where": "incident_year=2025"
      +  },
      +  {
      +    "_apiKey": "your-data-calgary-api-key",
      +    "group": "incident_category",
      +    "order": "count(*) DESC",
      +    "resource_id": "iahh-g8bj",
      +    "select": "incident_category, count(*)"
      +  }
      +]
  3. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and non-destructive, so the safety profile is covered. The description adds that arbitrary SoQL where/select/group/order/limit/offset is passed through, but says nothing about the result payload shape, pagination behavior, or error modes (invalid resource id / malformed SoQL), which matters for a tool with no output schema.

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?

Three short sentences, front-loaded with the core action, then the id format, then the sibling routing. No filler or duplicated schema content.

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?

For an 8-parameter open-world query tool with no output schema, the definition covers purpose, id requirements, supported clauses, and where to get ids. The remaining gap is the response format (rows vs. aggregate results, paging via offset semantics), which an agent would have to discover empirically.

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%, with each SoQL clause parameter documented inline including examples and the limit cap (default 100, max 5000). The description mirrors that clause list rather than adding new semantics, so the baseline of 3 applies.

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?

States a specific verb and resource: "Run a raw SoQL query against any Calgary open-data resource (data.calgary.ca) by its Socrata id". It also names the exact id shape (8-char, e.g. "iahh-g8bj") and enumerates supported SoQL clauses, so an agent can distinguish this raw-query tool from the discovery siblings without opening the schema.

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?

Explicitly routes the agent: "Use calgary_datasets to find a resource id, or calgary_recent for the common ones", giving both the prerequisite step and the shortcut alternative. It lacks any when-not-to-use statement (e.g. that SoQL syntax knowledge is required, or that common queries are better served by calgary_recent), which keeps it below a 5.

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.