Skip to main content
Glama
MapleStats MCP

MapleStats MCP

Plan query

plan_query
Read-onlyIdempotent

Plans how to answer Canadian data questions from official sources, returning the topics, ordered tools, local portals, and caveats needed before querying.

Instructions

Plan how to answer a question about Canadian data from official sources.

Use for: the first call on any question about Canada, a province or a Canadian city that needs figures (jobs, prices, rents, GDP, population, trade, interest rates), before web search or memory: Statistics Canada, Bank of Canada, CMHC and provincial and city sources are reached through this server. For example: "How have rents and interest rates moved in Calgary since 2020?". Returns the topics it touches, the tools to call for each in order, local portals for any province or city named, and caveats on combining them. Then run the steps with call_tool. Read-only and offline: it matches the question against this server's source map and calls no external API. Use search_tools instead to find a single tool for a narrow, single-source need. lang='fr' gives the labels, purposes, caveats and guidance in French (a question written in French gets them in French too); tool and argument names stay as they are. Each step's call holds its first arguments: pass them to call_tool with the step's tool, with no search_tools call first. A step with blocked: true sits on a StatCan path that answered with its bot check in the last 15 minutes: it is listed last and has no call; use the working route listed before it. Keywords: plan, which data source, where to find, combine sources, cross-source, question, research, Canada data. Mots-clés : planifier, quelle source de données, où trouver, combiner des sources, question, recherche, données canadiennes, statistiques.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "question": "<question>"
    },
    "name": "plan_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoen
questionYes

Output Schema

NameRequiredDescriptionDefault
placesYes
topicsYesBest match first; at most 4.
guidanceYes
questionYes
provenanceYesWhere a result came from and how fresh/complete it is. Embedded in every module's response models (composition, not inheritance) so a tool can return `MyResult(provenance=..., ...)` without fighting Pydantic's model-inheritance rules for extra fields.
out_of_scopeNoSet when the question is about a place outside Canada that this server has no data for; topics and fallback steps are then empty.
fallback_stepsYesOnly when no topic matched.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.6.0
    • addedOutput schema / properties / fallback_steps / items / properties / call
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The arguments of a first call to this step's tool, as JSON with <...> where only the question can supply a value. Pass them to call_tool with `tool` directly; no search_tools call is needed first."
      +}
    • addedOutput schema / properties / places / items / properties / steps / items / properties / call
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The arguments of a first call to this step's tool, as JSON with <...> where only the question can supply a value. Pass them to call_tool with `tool` directly; no search_tools call is needed first."
      +}
    • addedOutput schema / properties / provenance / properties / substituted_for
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set only when this result came from another official source because the tool's own one was blocked or paused (for example 'wds' for a Statistics Canada Web Data Service tool answered from the Bank of Canada, the CCEI SDMX space or the Alberta dashboard). `source` and `url` then name the host that answered and `caveats` say why, in the call's language. Null for every ordinary result."
      +}
    • addedOutput schema / properties / topics / items / properties / steps / items / properties / call
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The arguments of a first call to this step's tool, as JSON with <...> where only the question can supply a value. Pass them to call_tool with `tool` directly; no search_tools call is needed first."
      +}
  2. Changed2 schema fields changedv0.4.7
    • addedOutput schema / properties / provenance / properties / lang
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The language MapleStats wrote this result's own text in ('en' or 'fr'): notes, limits, caveats, labels. Values and the publisher's own text are as published."
      +}
    • changedOutput schema / properties / provenance / properties / reproduce / default
      Previous value: -"For R, Python, Stata and Julia scripts that fetch and clean these data, call reproduce_code with this tool's name and arguments."New value: +"For scripts, call reproduce_code with this tool's name and arguments."
  3. Changed2 schema fields changedv0.4.3
    • addedOutput schema / properties / provenance / properties / caveats
      Added value: +{
      +  "description": "Fitness-for-use cautions for this table or source, from MapleStats' rules (docs://planner/fitness-rules).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / provenance / properties / commercial_use
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "allowed",
      +        "not_allowed",
      +        "varies",
      +        "unknown"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Whether the licence allows commercial reuse without asking the publisher: 'allowed', 'not_allowed' (non-commercial use only, or written permission needed), 'varies' (each dataset or feed has its own licence: read licence) or 'unknown' (terms silent, conflicting or not found). Null when no licence applies. The conditions themselves are in licence."
      +}
  4. Changed1 schema field changedv0.4.0
    • changedOutput schema / properties / provenance / properties / reproduce / default
      Previous value: -"For R, Python, Stata and Julia scripts that fetch and clean this data, call reproduce_code with this tool's name and arguments."New value: +"For R, Python, Stata and Julia scripts that fetch and clean these data, call reproduce_code with this tool's name and arguments."
  5. Changed2 schema fields changedv0.2.0
    • addedOutput schema / properties / out_of_scope
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Set when the question is about a place outside Canada that this server has no data for; topics and fallback steps are then empty."
      +}
    • addedOutput schema / properties / provenance / properties / licence
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Licence and attribution the upstream publisher requires, when it has one (set for every Statistics Canada result)."
      +}
  6. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false and idempotentHint=true, but the description still adds real context: it matches against an internal source map and calls no external API. It also discloses a non-obvious failure mode — a step with `blocked: true` on a StatCan path that hit a bot check in the last 15 minutes, listed last with no `call` — plus the French-language behavior for labels, purposes, caveats and guidance.

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?

Purpose and the 'Use for:' block are front-loaded, followed by return shape, execution guidance and the lang note in a sensible order. The trailing keyword lists in English and French (including 'Mots-clés') repeat concepts already stated and are the main padding, though they aid retrieval.

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?

For a planner tool with two parameters, this covers everything an agent needs: when to call it, what it returns (topics, ordered tools, local portals, caveats), how to act on the output, the blocked-step edge case, and the language switch. The return-value detail is somewhat redundant with the output schema but reinforces the call_tool handoff correctly.

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

Parameters4/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 carry the parameter meaning, and it does for `lang`: 'en'/'fr' controls labels, purposes, caveats and guidance, and a French question yields French output while tool and argument names stay unchanged. The `question` parameter is only implied rather than defined, which leaves a small gap given the zero coverage.

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 first sentence gives a specific verb and resource ('Plan how to answer a question about Canadian data from official sources'), and the body names the exact source families reached (Statistics Canada, Bank of Canada, CMHC, provincial/city). It explicitly distinguishes itself from both siblings: 'Use search_tools instead to find a single tool' and 'Then run the steps with call_tool.'

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 states the triggering condition precisely — 'the first call on any question about Canada ... before web search or memory' — and enumerates the question classes it covers (jobs, prices, rents, GDP, population, trade, interest rates). It gives an explicit exclusion with an alternative ('search_tools ... for a narrow, single-source need') and the required follow-up workflow with call_tool, including that no search_tools call is needed first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools