Skip to main content
Glama

Run a spending query

run_plan
Read-onlyIdempotent

Run a QueryPlan (see get_catalog.plan_schema). Returns status (ok | clarify | unsupported | error), a one-paragraph answer, columns, rows (max 100), the SQL that ran, caveats, how names were resolved to codes, and page: the same answer on spendquery.com, run live, to cite or open.

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": {
      "plan": "<plan>"
    },
    "name": "run_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
planYesA QueryPlan object in business terms, following get_catalog's plan_schema, e.g. {"intent": "aggregate", "metric": "obligations", "group_by": ["agency"], "fiscal_years": [2025], "award_category": "contract"} (award_category is a field of its own, not a filter).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "run_planDictOutput",
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / plan / description
      Previous value: -"A QueryPlan object in business terms, following get_catalog's plan_schema, e.g. {\"intent\": \"aggregate\", \"metric\": \"obligations\", \"group_by\": [\"agency\"], \"fiscal_years\": [2025], \"filters\": [{\"dimension\": \"award_category\", \"values\": [\"contract\"]}]}."New value: +"A QueryPlan object in business terms, following get_catalog's plan_schema, e.g. {\"intent\": \"aggregate\", \"metric\": \"obligations\", \"group_by\": [\"agency\"], \"fiscal_years\": [2025], \"award_category\": \"contract\"} (award_category is a field of its own, not a filter)."
  3. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description goes well beyond that: it enumerates the four possible status outcomes, caps rows at 100, discloses that caveats and name-to-code resolutions are returned, and explains that `page` is a live, citable run on spendquery.com — behavior an agent could not infer from annotations alone.

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?

Front-loaded with the action and the schema pointer, and the parenthetical status list is compact and informative. The long roll-call of return fields is somewhat redundant given an output schema exists, but it is dense rather than padded.

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 a tool with a nested, free-form plan object and an existing output schema, pointing to plan_schema plus describing the response envelope is sufficient to call it correctly. What is missing is operational context around non-ok statuses — whether to retry, revise the plan, or escalate — which matters for a tool whose primary failure mode is 'clarify'.

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 100% and the single `plan` parameter already carries an example plus the note that award_category is a field of its own, so the baseline would be 3. The description adds a small amount by characterizing the plan as 'in business terms' and routing the agent to get_catalog's plan_schema for the full grammar.

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?

Names a specific verb (run) and resource (QueryPlan) and immediately ties it to the schema that defines the input via get_catalog.plan_schema. The return contract (status values, columns, rows, SQL, caveats, resolutions, page link) makes it unmistakable what this tool produces, which no sibling in the list does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The reference to get_catalog.plan_schema implies the workflow (fetch the plan schema first, then submit a plan), which is useful implied guidance. However, there is no explicit when-to-use versus when-not statement, and no guidance on what an agent should do differently for a 'clarify' or 'unsupported' status.

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.

Resources