Skip to main content
Glama
sprine

ontario-data-mcp

by sprine

query_cached

Read-only

Run SQL queries against locally cached Ontario open data using DuckDB. Supports aggregations, joins, and full SQL syntax.

Instructions

Run a SQL query against locally cached data in DuckDB.

Use table names from download_resource or cache_info. Supports full DuckDB SQL: aggregations, window functions, CTEs, JOINs across tables.

Use SUM(quantity_col) not COUNT() when rows contain per-row counts (e.g. a "count" or "number_of" column). COUNT() counts rows, not quantities. Column names vary across resources in the same dataset — always DESCRIBE first. Use SELECT * RENAME ("old col" AS new_col) to normalize column names when joining across datasets. Values containing semicolons should be matched with LIKE patterns, not = equality. Quote table names with double quotes in SQL.

Args: sql: SQL query (e.g. SELECT * FROM "ds_my_table_abc12345" LIMIT 10)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL query that was executed
rowsYesResult rows as JSON objects
columnsYesColumn names in result order
total_rowsNoTotal rows matched (may exceed rows if truncated)
truncatedYesTrue if results were truncated to MAX_QUERY_ROWS
warningsYesHeuristic warnings (e.g. COUNT(*) vs SUM suggestion)
Behavior4/5

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

Annotations already indicate readOnlyHint true and destructiveHint false, so safety is clear. The description adds valuable behavioral details: query execution semantics, SQL dialect support, and specific data handling gotchas (COUNT vs SUM, semicolons) that go beyond annotations.

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 front-loaded with a clear one-line purpose, followed by bulleted tips and an Args section. While comprehensive, some tips could be condensed without losing meaning. Overall well-organized and efficient.

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 single parameter and the presence of an output schema, the description covers query construction thoroughly. It omits return format details, but that is acceptable since output schema exists. It addresses common pitfalls and usage patterns, making it complete for a cached query tool.

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?

The input schema has 0% coverage for the sole parameter 'sql'. The description provides a minimal arg description with an example, but the extensive SQL guidance in the main text compensates partially. However, more structured parameter-specific details would improve semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Run a SQL query against locally cached data in DuckDB', specifying the action and resource. It distinguishes from siblings by emphasizing local cache and referencing table names from download_resource or cache_info, though it could more explicitly contrast with query_resource or sql_query.

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?

Provides extensive usage tips: use SUM not COUNT, DESCRIBE first, use RENAME for column normalization, use LIKE for semicolons, and quote table names. However, it lacks explicit guidance on when to choose this tool over alternative query tools like query_resource.

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/sprine/ontario-data-mcp'

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