Skip to main content
Glama

get_why

Read-only

Explains why code is shaped this way using decision records and evidence commits, so you can check rationale before refactoring or diverging from established patterns.

Instructions

Why this code is shaped this way — decision records + evidence commits.

Call before a refactor or pattern divergence. Query: a question, a file
path, a question with ``targets``, or nothing (decision dashboard).
Falls back to git archaeology, never empty. ``authority: accepted``
means somebody signed the decision; ``answer_basis`` names the strongest
evidence lane, and only ``decision`` is a ruling.

Args:
    query: question, file/module path, or omit for the dashboard.
    targets: file paths to anchor the search.
    id: decision or ``ev_...`` evidence id from any tool.
    reference: structured evidence reference.
    repo: usually omitted.

Input Schema

NameRequiredDescriptionDefault
idNo
repoNo
queryNo
targetsNo
referenceNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv0.60.1
    • removedInput schema / properties / id / default
      Removed value: -null
    • removedInput schema / properties / id / title
      Removed value: -"Id"
    • removedInput schema / properties / query / default
      Removed value: -null
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • removedInput schema / properties / reference / default
      Removed value: -null
    • removedInput schema / properties / reference / title
      Removed value: -"Reference"
    • removedInput schema / properties / repo / default
      Removed value: -null
    • removedInput schema / properties / repo / title
      Removed value: -"Repo"
    • removedInput schema / properties / targets / default
      Removed value: -null
    • removedInput schema / properties / targets / title
      Removed value: -"Targets"
    • removedInput schema / title
      Removed value: -"get_whyArguments"
  2. Changed2 schema fields changedv0.48.0
    • addedInput schema / properties / id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Id"
      +}
    • addedInput schema / properties / reference
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Reference"
      +}
  3. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), yet the description adds real behavioral context: it falls back to git archaeology rather than returning empty, and it explains how to read results via ``authority: accepted`` and ``answer_basis``. That is genuine disclosure beyond structured fields, though it stops short of describing result shape or latency/cost.

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 purpose and activation trigger are front-loaded, and the Args block is compact. The doubled-backtick markup is noisy and the query/shape guidance is repeated between the body and Args, but nothing is badly 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 five-parameter, all-optional tool with zero schema descriptions and an output schema, the description supplies the missing decision rules (which input combos are legal, what the fallback is, how to interpret authority). The gap is the undocumented ``reference`` object and how ``id`` interacts with ``query`` when both are supplied.

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?

Schema description coverage is 0%, so the description carries the burden and does document all five args at a surface level, including the useful ``ev_...`` id hint and the "omit for the dashboard" default. However, ``reference`` is dismissed as "structured evidence reference" with no shape at all despite being a free-form object, and ``repo: usually omitted`` gives no guidance on when it is not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line names both the resource (decision records + evidence commits) and the question it answers ("why this code is shaped this way"), which is a distinct job from siblings like get_health or get_dead_code. It doesn't explicitly name a sibling it is not, so it falls short of a 5, but the purpose is unmistakable.

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?

"Call before a refactor or pattern divergence" gives a concrete activation trigger, and the description enumerates the accepted input shapes (question, path, question+targets, or nothing for the dashboard). It never states when to prefer get_answer or get_context instead, so it stops short of full alternative routing.

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