Skip to main content
Glama

query_decisions

Read-onlyIdempotent

Retrieve architecture decisions and tech choices linked to source code by filtering the decision knowledge graph. Query why code was designed a certain way using filters like type, subproject, symbol, file, tag, or time.

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
typeNoFilter by decision type
service_nameNoFilter by subproject name (e.g., "auth-api")
symbol_idYesFilter by linked symbol FQN
file_pathYesFilter by linked file path
tagYesFilter by tag
searchNoFull-text search query (FTS5 with porter stemming)
as_ofYesOnly decisions active at this ISO timestamp
include_invalidatedNoInclude invalidated decisions (default: false)
include_pendingNoAlso return decisions in the review queue (review_status="pending"). Default: false — only auto-approved and approved rows are returned.
review_statusNoRestrict to a single review tier (overrides default + include_pending). Use "pending" to fetch the review queue.
git_branchNoBranch filter. "current" (default) → current branch + branch-agnostic decisions. "all" → every branch. Any other value → that specific branch + branch-agnostic decisions.
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".
limitNoMax results (default: 50)
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.
Behavior5/5

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

Annotations (readOnlyHint=true) are reinforced by explicit 'Read-only' statement. The description adds timeout behavior, degraded mode, output format options, and cluster summary behavior, going well beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose, then filters, behavior, output, and timeout. Every sentence adds value; no redundancy. Length is justified by complexity.

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 tool with 14 parameters and no output schema, the description covers return format, timeout, filtering intricacies, and special features like TOON encoding and cluster summaries. It is fully complete.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description enriches parameter semantics by explaining default behaviors (e.g., review_status default, include_pending interaction, git_branch interpretation, output_format token savings). It adds context like cluster_ids and clusters_summary.

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, explains what it returns (decisions linked to code), and distinguishes from siblings like add_decision and approve_decision by focusing on querying rather than mutations.

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 detailed filtering options and default behaviors (e.g., review_status defaults, include_pending effect, order_by options). It does not explicitly mention when to use alternatives like search or query_by_intent, but the context is thorough enough for correct selection.

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