Skip to main content
Glama

infer_history

Analyze a repository's git commit history to extract structured development intents and decisions, building a knowledge base of past changes.

Instructions

Analyze a repository's git commit history and produce structured development knowledge (intents and decisions) for the repo.

When to use:

  • To bootstrap a repository that has no recorded intents/decisions yet.

  • To extend coverage for new commits since the last run (resumes automatically when no commits value is provided).

Inputs of note:

  • estimateOnly (default true): returns a token/cost estimate without running. Call with estimateOnly: true first to preview cost, then re-call with estimateOnly: false to run.

  • commits (optional): how many recent commits to analyze. Omit to resume from where the last run stopped (or fall back to a sensible default on first run).

  • commitRange (optional): git revspec selecting a specific window — "sha1..sha2", "branch1..branch2", "sha1^!" for a single commit. Mutually exclusive with commits. Useful for recovering from dropped batches or backfilling specific PRs / branches without re-running the full history.

  • contextIssues: include PR/MR descriptions and issue discussions when an authenticated forge CLI (gh or glab) is available; auto-skipped otherwise.

  • allowCommitSplitting: enable when commit history is messy and a single commit may cover unrelated changes.

  • model, maxStories: Anthropic model and per-run cap.

  • force (default false): override the re-run guard (see Behavior).

Behavior:

  • A run is asynchronous — returns immediately with a started/pending status; progress is reported separately.

  • Results are persisted as intents and decisions for the repo on completion.

  • If interrupted, re-running resumes from where it left off.

  • Re-run guard: a clean incremental resume runs automatically. But if the repo already has intents and the run cannot cleanly resume (missing/unreachable cursor), or HEAD is not on the default branch, the call STOPS and returns needsDecision instead of running — re-running blind there risks duplicate intents. Present the reason to the user and, if they confirm, re-call with force: true. Run on the default branch (main/master) whenever possible; inferring a feature branch is what force is for.

  • GitHub and GitLab are supported; the forge is detected from the remote origin.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoOverride the re-run guard. When the repo already has intents and infer_history cannot cleanly resume (missing/unreachable cursor), or when HEAD is not on the default branch, the run is stopped and a confirmation is requested. Set `force: true` to proceed anyway, accepting the duplicate-intent risk. Exact-commit duplicates are still skipped automatically; overlapping re-groupings are not. A forced run on a non-default branch additionally does NOT advance the resume cursor. Does not override a hard failure such as the desktop app being unreachable.
modelNoAnthropic model to use (default: claude-sonnet-4-20250514)
commitsNoNumber of recent commits to analyze. If omitted, the server resumes from the last commit infer_history processed for this repo (or falls back to 50 on first run). Mutually exclusive with `commitRange`.
repoPathYesLocal path to the repository root
maxStoriesNoMaximum number of stories to analyze in this run (0 = unlimited).
commitRangeNoOptional git revspec to process a specific commit range instead of the N most recent (e.g. "sha1..sha2", "branch1..branch2", "sha1^!" for a single commit). Useful for recovering from dropped batches or targeted backfills. Mutually exclusive with `commits`.
estimateOnlyNoIf true (default), only estimate token cost without running the pipeline. Set to false to run the full pipeline.
contextIssuesNoInclude context issues from commit date range (requires gh/glab CLI)
allowCommitSplittingNoAllow splitting a single commit into multiple stories when it contains unrelated changes (recommended for repos with messy commit history)
Behavior5/5

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

No annotations provided, so description carries full burden. It thoroughly describes async execution, automatic resume on interruption, the re-run guard (needsDecision scenario), forced run behavior on non-default branches, and supported forges. No contradictions.

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 well-structured with clear sections (When to use, Inputs, Behavior) and front-loaded purpose. While long, each sentence adds necessary detail for a complex tool. Slightly verbose but justified.

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?

Given the tool's complexity (9 params, no output schema, no annotations), the description is remarkably complete. It covers parameter interactions, edge cases (resume, force), async nature, and prerequisites (gh/glab). Leaves no major gaps for an agent to infer.

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%, but the description adds significant meaning beyond schema: default values (estimateOnly, force), mutual exclusivity of commits and commitRange, resume logic for commits, conditional contextIssues availability, and detailed force behavior including duplicate-intent risks.

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 starts with a clear verb+resource: 'Analyze a repository's git commit history and produce structured development knowledge (intents and decisions).' Immediately distinguishes from sibling tools that manage existing intents/decisions rather than generating them.

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 'When to use' section explicitly states bootstrap and new-commit scenarios. It explains the re-run guard and force flag for special cases. However, it does not explicitly say when to avoid this tool in favor of alternatives, missing a perfect score.

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/CodeAwareness/kawa.mcp'

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