Skip to main content
Glama

query_decisions

Read-onlyIdempotent

Find the actual decision record behind any architecture choice. Filter by type, code symbol, file path, tag, or time; read-only answers 'why was this chosen?'

Instructions

Query the decision knowledge graph. Filter by type, subproject, code symbol, file path, tag, or time — answers "why was this architecture chosen?" with the actual decision record. Defaults to approved decisions; use include_pending or review_status for other tiers. Read-only. Returns JSON: { decisions: [{ id, title, type, content, tags, review_status, cluster_ids? }], clusters_summary?, total_results }. Supports output_format: "toon".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNoFilter by tag
typeNoFilter by decision type
as_ofNoOnly decisions active at this ISO timestamp
limitNoMax results (default: 50)
searchNoFull-text search query (FTS5 with porter stemming)
verifyNoVerify linked code is still fresh (default true); stale rows are flagged `stale: true`. false skips the check.
order_byNoResult ordering: "recency" (default), "created_at", or "heat" (popular + fresh; falls back to recency when disabled)
file_pathNoFilter by linked file path
symbol_idNoFilter by linked symbol FQN
git_branchNoBranch filter: "current" (default), "all", or a branch name
index_onlyNoOmit full `content` (default false) — pick ids cheaply, then pull content with `get_decision`
service_nameNoFilter by subproject name (e.g., "auth-api")
verificationNoFilter by verification verdict (implies verify=true): "stale" or "ok"
output_formatNoOutput format: "json" (default), "markdown" (tool-specific), or "toon" (30-60% fewer tokens on tabular data).
review_statusNoRestrict to one review tier ("pending" = review queue; overrides default)
include_pendingNoAlso return pending review-queue decisions (default: approved only)
include_invalidatedNoInclude invalidated decisions (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv3.31.3
    • changedInput schema / properties / git_branch / description
      Previous value: -"Branch filter: \"current\" (default) = current branch + branch-agnostic; \"all\" = every branch; any other value = that branch + branch-agnostic."New value: +"Branch filter: \"current\" (default), \"all\", or a branch name"
    • changedInput schema / properties / include_pending / description
      Previous value: -"Also return decisions in the review queue (review_status=\"pending\"). Default: false — only auto-approved and approved rows are returned."New value: +"Also return pending review-queue decisions (default: approved only)"
    • changedInput schema / properties / index_only / description
      Previous value: -"Progressive disclosure (default false). true omits full `content` — just id, title, type, anchors, tags, ~1-line `summary`. Pick ids cheaply, then pull full content with `get_decision`."New value: +"Omit full `content` (default false) — pick ids cheaply, then pull content with `get_decision`"
    • changedInput schema / properties / order_by / description
      Previous value: -"Result ordering: \"recency\" (default, valid_from DESC), \"created_at\" DESC, or \"heat\" (time-decay favoring frequently-recalled + fresh; degrades to recency if disabled in config)."New value: +"Result ordering: \"recency\" (default), \"created_at\", or \"heat\" (popular + fresh; falls back to recency when disabled)"
    • changedInput schema / properties / output_format / description
      Previous value: -"Output format. \"json\" (default), \"markdown\" (LLM-friendly fenced markdown, tool-specific), or \"toon\" (Token-Oriented Object Notation — 30-60% fewer tokens on tabular data, lossless)."New value: +"Output format: \"json\" (default), \"markdown\" (tool-specific), or \"toon\" (30-60% fewer tokens on tabular data)."
    • changedInput schema / properties / review_status / description
      Previous value: -"Restrict to a single review tier (overrides default + include_pending). Use \"pending\" to fetch the review queue."New value: +"Restrict to one review tier (\"pending\" = review queue; overrides default)"
    • changedInput schema / properties / verification / description
      Previous value: -"Filter by verification verdict (implies verify=true). \"stale\" = any flagged row; \"ok\" = verified-fresh only. Omit to return all rows annotated in place."New value: +"Filter by verification verdict (implies verify=true): \"stale\" or \"ok\""
    • changedInput schema / properties / verify / description
      Previous value: -"Staleness verification (default true). Checks each `symbol_id`-linked decision against the live index + git history; deleted/renamed/materially-changed code is flagged `verification` + `stale: true`. false skips the check."New value: +"Verify linked code is still fresh (default true); stale rows are flagged `stale: true`. false skips the check."
  2. Changed2 schema fields changedv3.22.0
    • changedInput schema / properties / output_format / description
      Previous value: -"Output format. \"json\" (default) returns JSON, \"markdown\" returns LLM-friendly fenced markdown (tool-specific), \"toon\" returns Token-Oriented Object Notation — 30-60% fewer tokens on tabular data, fully lossless."New value: +"Output format. \"json\" (default), \"markdown\" (LLM-friendly fenced markdown, tool-specific), or \"toon\" (Token-Oriented Object Notation — 30-60% fewer tokens on tabular data, lossless)."
    • removedInput schema / required
      Removed value: -[
      -  "symbol_id",
      -  "file_path",
      -  "tag",
      -  "as_of"
      -]
  3. Changed6 schema fields changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedInput schema / properties / git_branch / description
      Previous value: -"Branch filter. \"current\" (default) → current branch + branch-agnostic decisions. \"all\" → every branch. Any other value → that specific branch + branch-agnostic decisions."New value: +"Branch filter: \"current\" (default) = current branch + branch-agnostic; \"all\" = every branch; any other value = that branch + branch-agnostic."
    • changedInput schema / properties / index_only / description
      Previous value: -"Progressive disclosure (default: false). When true, each decision is returned WITHOUT its full `content` — just id, title, type, code anchors, tags, and a ~1-line `summary`. Pick the relevant ids cheaply, then pull full content with `get_decision`. Pure token-saver."New value: +"Progressive disclosure (default false). true omits full `content` — just id, title, type, anchors, tags, ~1-line `summary`. Pick ids cheaply, then pull full content with `get_decision`."
    • changedInput schema / properties / order_by / description
      Previous value: -"Result ordering. \"recency\" (default): valid_from DESC. \"created_at\": created_at DESC. \"heat\": time-decay scoring biased toward frequently-recalled + fresh decisions. When heat is disabled in config, \"heat\" gracefully degrades to \"recency\"."New value: +"Result ordering: \"recency\" (default, valid_from DESC), \"created_at\" DESC, or \"heat\" (time-decay favoring frequently-recalled + fresh; degrades to recency if disabled in config)."
    • changedInput schema / properties / verification / description
      Previous value: -"Filter by verification verdict (implies verify). \"stale\" returns any flagged row (symbol_missing OR code_changed); \"ok\" returns only verified-fresh rows. Omit to return all rows annotated in place."New value: +"Filter by verification verdict (implies verify=true). \"stale\" = any flagged row; \"ok\" = verified-fresh only. Omit to return all rows annotated in place."
    • changedInput schema / properties / verify / description
      Previous value: -"Staleness verification (default: true). When true, each decision linked to a `symbol_id` is checked against the live index + git history; rows whose code was deleted/renamed or materially changed since `created_at` are flagged with `verification` (\"symbol_missing\" | \"code_changed\") and `stale: true`. Pass false to skip the check entirely."New value: +"Staleness verification (default true). Checks each `symbol_id`-linked decision against the live index + git history; deleted/renamed/materially-changed code is flagged `verification` + `stale: true`. false skips the check."
  4. Changed3 schema fields changedv1.43.3
    • addedInput schema / properties / index_only
      Added value: +{
      +  "description": "Progressive disclosure (default: false). When true, each decision is returned WITHOUT its full `content` — just id, title, type, code anchors, tags, and a ~1-line `summary`. Pick the relevant ids cheaply, then pull full content with `get_decision`. Pure token-saver.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / verification
      Added value: +{
      +  "description": "Filter by verification verdict (implies verify). \"stale\" returns any flagged row (symbol_missing OR code_changed); \"ok\" returns only verified-fresh rows. Omit to return all rows annotated in place.",
      +  "enum": [
      +    "ok",
      +    "symbol_missing",
      +    "code_changed",
      +    "stale"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / verify
      Added value: +{
      +  "description": "Staleness verification (default: true). When true, each decision linked to a `symbol_id` is checked against the live index + git history; rows whose code was deleted/renamed or materially changed since `created_at` are flagged with `verification` (\"symbol_missing\" | \"code_changed\") and `stale: true`. Pass false to skip the check entirely.",
      +  "type": "boolean"
      +}
  5. Addedv1.41.0
  6. Removedv1.38.0
  7. Changed5 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / git_branch
      Added value: +{
      +  "description": "Branch filter. \"current\" (default) → current branch + branch-agnostic decisions. \"all\" → every branch. Any other value → that specific branch + branch-agnostic decisions.",
      +  "maxLength": 256,
      +  "type": "string"
      +}
    • addedInput schema / properties / include_pending
      Added value: +{
      +  "description": "Also return decisions in the review queue (review_status=\"pending\"). Default: false — only auto-approved and approved rows are returned.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / review_status
      Added value: +{
      +  "description": "Restrict to a single review tier (overrides default + include_pending). Use \"pending\" to fetch the review queue.",
      +  "enum": [
      +    "pending",
      +    "approved",
      +    "rejected"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "symbol_id",
      +  "file_path",
      +  "tag",
      +  "as_of"
      +]
  8. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare read-only, idempotent, and non-destructive, so the bar is lower. The description adds valuable behavior: defaults to approved decisions, returns JSON with specific fields, supports the 'toon' output format for token savings, and explains the verify flag's effect on stale rows. It could further clarify the interpretation of 'active' for as_of and the fallback behavior of 'heat', but these are minor.

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 a single paragraph that front-loads the purpose and key filters, then covers defaults, output format, and read-only nature. It is fairly concise, but the field list in the output JSON is a bit dense and could be trimmed without losing value. Still, it earns its sentences with concrete details.

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 complex tool with 17 parameters, the description effectively summarizes the major filter categories, defaults, output format, and read-only nature. The schema covers individual parameter semantics, so the description need not repeat every detail. The mention of the toon format is a nice touch, given the presence of output_format. Complete for the intended use.

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?

The schema has 100% coverage, so the baseline is 3. The description adds context beyond the schema: it explains that decisions are part of a knowledge graph, mentions the 'toon' output format's benefit, and clarifies that 'verify' defaults to true (schema only lists the flag). This goes slightly beyond the schema, justifying a 4.

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 the tool queries the decision knowledge graph, lists the filter dimensions (type, subproject, code symbol, file path, tag, time), and explains the core use case (answering 'why was this architecture chosen?'). It is specific about the resource and distinguishes it from siblings like search, get_symbol, and remember_decision.

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?

The description implies when to use it (querying decision records) and mentions defaults (approved decisions, include_pending/review_status for other tiers), but it does not explicitly state when not to use it or name alternative tools for similar purposes. The 'read-only' note and the output format hint provide context, but exclusions are missing.

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