Skip to main content
Glama

query_decisions

Read-onlyIdempotent

Find recorded architecture decisions by type, subproject, code symbol, file path, tag, or time to answer why a design was chosen. Includes review status, staleness verification, and compact output options.

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. Use service_name to scope to a subproject. Defaults to auto+human-approved decisions; use include_pending or review_status for other tiers. Rows carry cluster_ids when part of a topical cluster (see clusters_summary). Read-only. Returns JSON: { decisions: [{ id, title, type, content, tags, review_status, cluster_ids? }], clusters_summary?, total_results }. Supports output_format: "toon". Capped by memory.recall.timeoutMs (default 5000ms); on timeout returns { decisions: [], total_results: 0, degraded: true }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagYesFilter by tag
typeNoFilter by decision type
as_ofYesOnly decisions active at this ISO timestamp
limitNoMax results (default: 50)
searchNoFull-text search query (FTS5 with porter stemming)
verifyNoStaleness 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.
order_byNoResult ordering: "recency" (default, valid_from DESC), "created_at" DESC, or "heat" (time-decay favoring frequently-recalled + fresh; degrades to recency if disabled in config).
file_pathYesFilter by linked file path
symbol_idYesFilter by linked symbol FQN
git_branchNoBranch filter: "current" (default) = current branch + branch-agnostic; "all" = every branch; any other value = that branch + branch-agnostic.
index_onlyNoProgressive 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`.
service_nameNoFilter by subproject name (e.g., "auth-api")
verificationNoFilter by verification verdict (implies verify=true). "stale" = any flagged row; "ok" = verified-fresh only. Omit to return all rows annotated in place.
output_formatNoOutput 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.
review_statusNoRestrict to a single review tier (overrides default + include_pending). Use "pending" to fetch the review queue.
include_pendingNoAlso return decisions in the review queue (review_status="pending"). Default: false — only auto-approved and approved rows are returned.
include_invalidatedNoInclude invalidated decisions (default: false)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 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."
  2. 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"
      +}
  3. Addedv1.41.0
  4. Removedv1.38.0
  5. 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"
      +]
  6. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Goes far beyond the readOnly/idempotent annotations by disclosing the default approval tier, conditional cluster_ids, exact JSON return shape, support for the 'toon' output format, and the timeout/degraded response behavior. There is no conflict with annotations.

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 dense and front-loaded: purpose and filters come first, followed by return format and edge behavior. Minor redundancy such as 'Read-only' (already in annotations) prevents a perfect score.

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?

Given 17 parameters, no output schema, and no external return documentation, the description is unusually complete: it specifies the response object, optional clusters_summary, total_results, default tier behavior, and degraded timeout behavior. An agent has enough information to invoke and interpret the result correctly.

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?

All 17 parameters already have schema descriptions, so the baseline is 3; the description mostly restates what those descriptions say (service_name scoping, review tiers, output format). It also leaves a mismatch: the input schema marks symbol_id, file_path, tag, and as_of as required while the description presents them as optional filters.

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?

Opens with a specific verb and resource: 'Query the decision knowledge graph.' It then lists the filter dimensions and ties the tool to the concrete question 'why was this architecture chosen?', which clearly distinguishes it from generic siblings like search_text or search.

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?

Provides clear operational guidance: use service_name to scope to a subproject, and use include_pending or review_status to select decision tiers beyond the default. It does not explicitly name alternative tools or state when not to use this tool, so it stops short of a 5.

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

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/nikolai-vysotskyi/trace-mcp'

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