Skip to main content
Glama

infer_history

Analyze a repository's git commit history to extract intents and decisions, bootstrapping or extending structured development knowledge with automatic resume.

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?

With no annotations, description fully discloses async behavior, persistence, resume logic, re-run guard with force, and forge detection. Covers edge cases like non-default branches.

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?

Well-structured with sections, but somewhat lengthy. Every sentence earns its place, but could be tightened.

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 9 parameters and no output schema, description comprehensively covers interactions, async behavior, error states, and re-run logic. Highly 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?

Adds significant value beyond 100% schema coverage—explains mutual exclusivity of commits/commitRange, defaults, and usage context for each parameter.

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?

Clearly states it analyzes git commit history to produce structured intents/decisions. Distinguishes from sibling tools that manage intents/decisions but don't infer them from history.

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?

Explicitly states when to use: bootstrap repos or extend coverage. Provides context on default branch and force flag, but could mention alternative tools more directly.

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

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