Skip to main content
Glama

get_context

Read-only

Get a file, symbol, or component's relationships, signatures, hotspot and fix history in one call, with optional callers, references, or tests, to triage before reading source.

Instructions

Triage card for files / modules / symbols — relationships, not source bytes.

Returns summary, signatures with lines, hotspot, fix_history and
decision titles; either risk cue means get_risk. Batch targets in one
call. Whole file, body-elided and line-verified: include=["skeleton"]
in ONE call, or Read it; do not call get_symbol per signature. Rename:
include=["references"] is the whole edit set when ``complete``. Which
files in a directory lack tests: include=["files"] on it.

Args:
    targets: paths, "path::Symbol", "component:<name>",
        "change:<id>" (pr-123 or a sha), "package:<name>".
    include: callers | callees | references (+ adds comments) | skeleton | skeleton+
        | files | symbols (all, not top 15) | decisions | full_doc
        | ownership | last_change | metrics | community | health
        | doc_drift | changes | provenance | suspects | facts.
    compact: False adds structure, imports, docstrings.
    symptom: issue text or stack trace to rank ``suspects`` on.
    repo: usually omitted.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "targets": "<targets>"
    },
    "name": "get_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoNo
compactNo
includeNo
symptomNo
targetsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.60.1
    • removedInput schema / properties / compact / title
      Removed value: -"Compact"
    • removedInput schema / properties / include / default
      Removed value: -null
    • removedInput schema / properties / include / title
      Removed value: -"Include"
    • removedInput schema / properties / repo / default
      Removed value: -null
    • removedInput schema / properties / repo / title
      Removed value: -"Repo"
    • removedInput schema / properties / symptom / default
      Removed value: -null
    • removedInput schema / properties / symptom / title
      Removed value: -"Symptom"
    • removedInput schema / properties / targets / title
      Removed value: -"Targets"
    • removedInput schema / title
      Removed value: -"get_contextArguments"
  2. Changed1 schema field changedv0.59.0
    • addedInput schema / properties / symptom
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Symptom"
      +}
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false), so the bar is lower. The description still adds real behavioral context — batch multiple targets in one call, the output is body-elided and line-verified, and "complete" governs whether references is the whole edit set — but it does not disclose cost, size limits, or failure behavior for resident/large targets.

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?

Front-loaded with the core framing and the get_symbol exclusion before the mechanics, with no filler sentences. The long include enumeration is defensible given the absent schema descriptions, though the telegraphic fragments ("either risk cue means get_risk") and duplicated skeleton/skeleton+ entries make it denser than it needs to be.

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 5-parameter tool with an output schema present, the description covers all parameters, the discovery/rename/test-coverage use cases, and defers return-value detail appropriately since the output schema exists. The remaining gap is semantic coverage of most include values, which an agent cannot resolve from either the description or the schema.

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?

With 0% schema coverage this description must carry all parameter meaning, and it does a lot: it enumerates target syntaxes ("path::Symbol", "component:<name>", "change:<id>" accepting pr-123 or a sha, "package:<name>") and explains compact ("False adds structure, imports, docstrings"), symptom, and repo ("usually omitted"). The weakness is the ~20-value include enum, where only a handful (references, symbols, skeleton) are glossed — values like metrics, community, health, provenance, facts are left opaque despite 0% schema coverage.

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?

"Triage card for files / modules / symbols — relationships, not source bytes" names the resource and frames the output, and it explicitly separates itself from get_symbol ("do not call get_symbol per signature"). The phrasing is telegraphic rather than a clean verb+resource statement, so the intent takes a moment to extract, but the scope is unambiguous once parsed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete routing rules with named alternatives: "either risk cue means get_risk," "do not call get_symbol per signature," "include=[\"skeleton\"] in ONE call, or Read it," plus task-oriented recipes ("Which files in a directory lack tests: include=[\"files\"]", "Rename: include=[\"references\"] is the whole edit set"). An agent has explicit when-to-use, when-not-to, and the fallback tool for each case.

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