Skip to main content
Glama
Infinite Code Next

Infinite Code Next

by Kawai-Senpai

agit

Create isolated Git checkpoints in .agit/ before risky edits or refactors, then compare and restore files without touching your real .git history, staging, or branches.

Instructions

Agent-only git history in .agit/, separate from the user's real repo.

WHEN TO USE: action='commit' before any risky edit or broad refactor, so there is something to roll back to. It writes to .agit/, never the user's .git, so it cannot touch their history, staging or branches. AFTER THIS: make the risky change. If it goes wrong, agit(action='restore', paths=[...]) - which does rewrite real working-tree files, so check agit(action='diff') first.

Checkpoint risky work without touching .git. Auto-initialises on first use and adds itself to .gitignore. Per working tree, never central: a checkpoint only means anything against the tree it snapshotted.

Actions: status, diff, commit, log, branches, switch, restore, reset, show.

Args: action: one of the actions above. message: commit message. paths: file paths, relative to the repository root. branch: branch name for switch. create: create the branch if switching to a new one. target: commit-ish for diff, log, reset, show. source: source ref for restore. cached: diff the staged index. hard: use --hard for reset. allow_empty: allow an empty commit. limit: maximum log entries. root: repository path. Defaults to the server's working directory.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "agit"
  }
}

Input Schema

NameRequiredDescriptionDefault
hardNo
rootNo
limitNo
pathsNo
actionNostatus
branchNo
cachedNo
createNo
sourceNoHEAD
targetNo
messageNo
allow_emptyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does: it discloses that writes go only to `.agit/` and never `.git`, that it auto-initialises on first use, that it adds itself to .gitignore, and that checkpoints are per-working-tree rather than central. It also flags the one genuinely destructive surface — restore rewrites real working-tree files — which is exactly the kind of caveat an agent needs.

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 purpose, then WHEN TO USE, then AFTER THIS, then behaviour, then the action and arg lists — a sensible ladder. The arg block is slightly padded ('action: one of the actions above' restates the list just given), but given 0% schema coverage that redundancy is largely load-bearing.

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?

For a twelve-parameter, zero-annotation tool, the description covers the workflow, the safety boundary against `.git`, the lifecycle (auto-init, .gitignore), and every parameter by name. An output schema exists, so return values need no prose, and nothing an agent needs in order to call this safely appears to be missing.

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?

Schema coverage is 0%, so the description must supply meaning, and it does list all twelve parameters with terse semantics: 'target' is a commit-ish for diff/log/reset/show, 'cached' diffs the staged index, 'hard' maps to --hard for reset, 'root' defaults to the server working directory, and paths are relative to the repo root. The gaps are that the action set is not presented as an enumerated constraint and a few params (limit, allow_empty, message) get no more than their name.

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?

Opens with a specific verb+resource+scope: an agent-only git history kept in `.agit/`, explicitly separated from 'the user's real repo.' An agent immediately knows what this is and what it is not, with no sibling confusion needed.

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?

Gives an explicit workflow: call action='commit' before any risky edit or broad refactor, then make the change, and if it goes wrong use action='restore'. It also states a precondition for the destructive path (check action='diff' first, since restore rewrites real working-tree files). That is about as actionable as guidance gets.

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