Skip to main content
Glama
Aryan-Jhaveri

Statistics Canada MCP Server

query_database

Executes read-only SQL queries to retrieve Canadian statistical data from the database. Returns results as columns and rows for analysis.

Instructions

Executes a read-only SQL query (SELECT or PRAGMA) against the database and returns the results. WARNING: Potential security risk! Avoid using this tool with untrusted input or queries that modify data (INSERT, UPDATE, DELETE). Prefer more specific tools like list_tables or get_table_schema when possible. Results may be truncated.

Args: query_input: Object containing the sql_query string.

Returns: Dict[str, Any]: Dictionary with 'columns', 'rows' (list of dicts), and optionally a 'message', or an error message.

IMPORTANT: In your final response to the user, you MUST cite the source of your data (e.g., "Query results from table 'my_analysis'").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sql_queryYesThe SQL query to execute.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses security risk, potential truncation of results, the return shape, and the requirement to cite data source. However, it does not elaborate on how the tool enforces read-only or handles errors beyond mentioning an error message.

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 well-structured with a warning, usage preference, args, returns, and citation instruction. It is somewhat verbose but each section serves a purpose. The inaccurate Args line detracts from conciseness.

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 no output schema, the description provides essential context: security warning, truncation, return format, and citation requirement. It is sufficient for selecting and invoking the tool, though minor parameter confusion and lack of error-handling details leave some gaps.

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

Parameters2/5

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

The schema fully covers the single parameter with 'The SQL query to execute.' However, the description's 'Args: query_input: Object containing the sql_query string' suggests a nested object structure that contradicts the actual schema, which expects a top-level 'sql_query' string. This mismatch could mislead the agent on how to invoke the tool.

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 it 'Executes a read-only SQL query (SELECT or PRAGMA) against the database and returns the results' — a specific verb and resource with explicit scope. It also distinguishes itself from siblings by naming alternatives like list_tables and get_table_schema.

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?

It explicitly advises to avoid untrusted input and queries that modify data, and recommends using more specific tools when possible. This gives clear when-to-use and when-not-to-use guidance.

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/Aryan-Jhaveri/mcp-statcan'

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