Skip to main content
Glama

query_decisions

Read-onlyIdempotent

Retrieve architecture decisions connected to code by filtering on type, symbol, file path, tag, or time. Answers why a design was chosen.

Instructions

Query the decision knowledge graph. Filter by type, subproject, code symbol, file path, tag, or time. Returns decisions linked to code — "why was this architecture chosen?" answered with the actual decision record. Use service_name to filter by a specific subproject within the project. By default returns auto-approved + human-approved decisions (review_status NULL or "approved"); use include_pending to also return the review queue, or review_status to fetch a specific tier. Each row carries cluster_ids when the decision belongs to any topical cluster, and the response includes a clusters_summary keyed off those ids. Read-only. Returns JSON: { decisions: [{ id, title, type, content, tags, review_status, cluster_ids? }], clusters_summary?, total_results }. Set output_format: "toon" for lossless TOON encoding — cheaper LLM tokens on tabular payloads. Hard-capped by memory.recall.timeoutMs (default 5000 ms); 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). 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.
order_byNoResult 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".
file_pathYesFilter by linked file path
symbol_idYesFilter by linked symbol FQN
git_branchNoBranch filter. "current" (default) → current branch + branch-agnostic decisions. "all" → every branch. Any other value → that specific branch + branch-agnostic decisions.
index_onlyNoProgressive 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.
service_nameNoFilter by subproject name (e.g., "auth-api")
verificationNoFilter 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.
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)
Behavior5/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds significant behavioral context beyond these: explains read-only nature, hard-cap timeout with degraded response, staleness verification, output format options (including TOON for token savings), and cluster behavior. No contradictions 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 appropriately sized given the tool's complexity (17 parameters, 5 enums). Each sentence adds value, covering purpose, filtering, output format, timeout, verification, and clustering. It is front-loaded with the main purpose and structured logically, though it could be slightly more concise.

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 17 parameters, 5 enums, and no output schema, the description provides extensive context: filter options, default behaviors, output shape (JSON with decisions and clusters_summary), timeout handling, and verification details. It covers most important aspects for an agent to use it correctly, though some edge cases (e.g., exact content fields) might require schema inspection.

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 coverage is 100% with detailed parameter descriptions. The description adds extra context for several parameters, such as order_by heat degradation, git_branch defaults, verify staleness check, and output_format TOON explanation. It goes beyond the schema by clarifying behavior and defaults, justifying a score above baseline 3.

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, filtering by multiple criteria, and returns decisions linked to code. It uses a specific verb ('Query') and resource ('decision knowledge graph'), and distinguishes itself from siblings like add_decision, get_decision, and other query tools by focusing on the knowledge graph with rich filtering.

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 provides explicit guidance on when to use parameters like service_name for subproject filtering, include_pending for review queue, and review_status for specific tiers. It also mentions default behavior (auto-approved + human-approved) and alternatives (get_decision for full content with index_only). However, it does not explicitly state when not to use this tool.

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

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