Skip to main content
Glama
Aryan-Jhaveri

Statistics Canada MCP Server

fetch_vectors_to_database

Fetch multiple Statistics Canada vector IDs in a single call and store results into a SQLite table, eliminating separate insert steps. Ideal for multi-series analysis like provincial breakdowns.

Instructions

PREFERRED tool for multi-series analysis. Fetches data for multiple StatCan vector IDs in a single API call and immediately stores the results in a SQLite table — no separate create/insert steps needed.

*** USE THIS TOOL whenever you need data for multiple provinces, age groups, industries, or any other breakdown. It replaces the slow pattern of calling get_data_from_cube_pid_coord_and_latest_n_periods once per series. ***

Typical workflow:

  1. search_cubes_by_title("unemployment rate") → find productId

  2. get_cube_metadata(productId=...) → find vectorIds for each series you want

  3. fetch_vectors_to_database( vectorIds=["v111","v222","v333"], table_name="unemployment_by_province", startRefPeriod="2023-01-01", endRefPeriod="2024-12-31" ) ← single call fetches + stores everything

  4. query_database("SELECT * FROM unemployment_by_province") → analyze

Args: input_data.vectorIds: List of vector IDs to fetch (strings, e.g. ["111","222"]). input_data.table_name: SQLite table to create and populate. input_data.startRefPeriod: Optional start date (YYYY-MM-DD). input_data.endRefPeriod: Optional end date (YYYY-MM-DD).

Returns: Dict with table name, columns, rows_inserted, and a 5-row sample so you can verify the data looks right before querying.

IMPORTANT: In your final response cite the vectorIds and reference period used.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vectorIdsYesList of StatCan vector IDs to fetch (e.g. ['111', '222', '333']). Get these from get_cube_metadata → dimension members → vectorId field.
table_nameYesName of the SQLite table to create and populate. Use snake_case, e.g. 'unemployment_by_province'.
sample_sizeNoNumber of sample rows to include in the response preview. Default 5.
endRefPeriodNoEnd of the reference period to fetch, inclusive. Format: YYYY-MM-DD.
startRefPeriodNoStart of the reference period to fetch, inclusive. Format: YYYY-MM-DD.
Behavior4/5

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

No annotations are present, so the description carries full burden. It discloses the side effect (SQLite table write), the return format (dict with table_name, columns, rows_inserted, sample), and a specific instruction to cite vectorIds and reference period in the final response. However, it does not state behavior if the table already exists or whether the operation is transactional, which is a modest gap.

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 clear sections (preferred usage, workflow, args, returns, important note) and front-loads the core purpose. It is somewhat verbose but every section serves a purpose; there is minimal redundancy (e.g., 'single call' is repeated) which keeps it from a perfect 5.

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?

With 5 parameters, no output schema, and no annotations, the description is remarkably complete: it explains the return value shape, gives a concrete code example, defines the workflow, and includes an important citation instruction. It gives an agent everything needed to invoke the tool correctly and interpret results.

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%, and the schema already explains each parameter (vectorIds, table_name, sample_size, startRefPeriod, endRefPeriod). The description's Args block restates the same information without adding substantive detail beyond what the schema provides, 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?

The description clearly states a specific action: 'Fetches data for multiple StatCan vector IDs in a single API call and immediately stores the results in a SQLite table'. It explicitly contrasts with the slower per-series pattern, distinguishing it from sibling tools like get_data_from_cube_pid_coord_and_latest_n_periods and create_table_from_data + insert_data_into_table.

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?

The description provides explicit when-to-use guidance: 'USE THIS TOOL whenever you need data for multiple provinces, age groups, industries, or any other breakdown.' It also provides a step-by-step workflow showing the tool's place in the pipeline and names the alternative it replaces, giving the agent clear decision criteria.

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