Skip to main content
Glama

code_history

Read-only

Retrieve past session edits, user requests, failures, commits, and call graph links for a file or symbol before changing code.

Instructions

History of a file or symbol across past agent sessions: which sessions edited it and the user request behind each edit, failures right after, commits, plus callers/callees from the graphify code graph. Use before changing code that was worked on before. For code structure questions use graphify itself.

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": {
      "target": "<target>"
    },
    "name": "code_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoNosubstring of the repo path; default: the current repo, then all repos
targetYesfile path (absolute, repo-relative or file name) or symbol name
sessionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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 declare readOnlyHint=true and openWorldHint=false, so safety is covered; the description goes further by disclosing what the response contains (per-session edits, the originating user request, follow-on failures, commits, graph callers/callees). With no output schema, this return-content disclosure is the main value-add. It does not mention ordering, truncation, or what happens when the target is unknown.

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?

Three sentences, front-loaded with the resource and its returned contents before the usage directive. The enumerated list is dense but every item carries information; no filler or restatement of the name.

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?

With no output schema, the description carries the burden of explaining what comes back, and it does so concretely. For a read-only lookup tool this is nearly complete; only retrieval edge cases (unknown target, empty history, session ordering) are left unaddressed.

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 coverage is 67%, so most parameters are already documented. The description adds no meaning beyond the schema for 'repo' or 'sessions' (defaults, limits), and for 'target' it only echoes that both file paths and symbol names are accepted. Baseline 3 is appropriate.

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 description names a specific resource (history of a file or symbol across past agent sessions) and enumerates what the history contains: editing sessions, the user request behind each edit, failures right after, commits, and callers/callees from the code graph. It clearly distinguishes itself from graphify, but does not differentiate from siblings like search_sessions or session_brief.

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?

It gives an explicit trigger ('Use before changing code that was worked on before') and one clear alternative with its condition ('For code structure questions use graphify itself'). It stops short of saying when NOT to use it relative to the session-search siblings, but the core guidance is unambiguous.

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