Foremerge
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FOREMERGE_DB | No | Path to the SQLite database. Overrides the default storage location in the Git common directory. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| accept_changesetA | Accept a ChangeSet as done so other agents may build on it. Use this after run_verification passes; use record_commit later, once the work has actually landed on the target branch. Foremerge re-checks every gate before accepting: the worktree must be clean and unchanged since publication, verification must have passed (unless the repository's policy is advisory and nothing was verified), no HIGH conflict on the intent may be OPEN or COORDINATING (resolve_conflict clears an agreed one, and discard_work dismisses the conflicts of work you drop), and every intent in the ChangeSet's dependencies must already be accepted, with its accepted commit in this commit's history. On success it marks the ChangeSet and intent ACCEPTED, pins the commit as accepted_commit, writes refs/foremerge/accepted/, and returns the updated ChangeSet. A failed gate returns an error naming it (CHECK_FAILED, BLOCKING_CONFLICT, UNSATISFIED_DEPENDENCY, STALE_CHANGESET, INVALID_TRANSITION) and changes nothing. Overriding a gate is an operator action on the CLI or HTTP API and is refused over MCP, so ask a human when a gate should be bypassed. |
| check_conflictsA | Ask whether planned work collides with other agents' active work, before any code changes exist. Read-only: nothing is stored. Pass intent_id alone to list the persisted OPEN or COORDINATING conflicts on a published intent (use this before publish_changeset and before run_verification, since conflicts are raised when the later intent publishes). Pass intent text with scopes, or intent_id with replacement scopes, for a what-if check against every intent from INTENT through VALIDATED, excluding ACCEPTED, COMMITTED and DISCARDED; those findings carry ephemeral eph_ ids and are not recorded. Returns conflicts (each with severity, explanation, evidence and a suggested coordination step), checked_intents, blocking (true when any finding is HIGH), and the active policy. To record a decision about overlap, use record_assessment or resolve_conflict instead. |
| claim_workA | Tell other agents you are working on specific scopes of your own intent, for a limited time. Use this after publish_intent and record_assessment, and before start_work. Claims are advisory and never lock: if any other intent, another of yours included, holds a live claim on a matching scope (symbols match loosely by name), you still get the claim, and a claim-overlap conflict is recorded and returned as a warning. The first claim moves the intent from INTENT to CLAIMED. Claiming a scope the intent already holds renews its lease instead of adding a second claim, which is how long-running work keeps its claims. Only the intent's owner may claim, and only while the intent is INTENT, CLAIMED or IN_PROGRESS. Returns the created or renewed claims, overlap warnings, and advisory_only: true. |
| coordinate_with_agentA | Send a stored message to another registered agent, usually to agree how two overlapping pieces of work should coexist. Use it when check_conflicts or related_work shows a clash you need the other agent to act on; afterwards, a party to the conflict records the agreement with resolve_conflict, naming this message's id. Linking a conflict_id moves that conflict from OPEN to COORDINATING. The message is appended to a durable log with status UNREAD; it does not interrupt or control the other agent. No MCP tool reads messages: the recipient reads them with the CLI, foremerge coordinate inbox. Returns the stored message, including its msg_ id. |
| discard_workA | Abandon one of your own intents that will not be finished, for example a duplicate or work another agent took over. It sets the intent to DISCARDED, releases all of its active claims, and dismisses its OPEN or COORDINATING conflicts so they stop blocking the other party. The history stays in the event log, but a discarded intent cannot be resumed; publish a new intent instead. Only the owner may discard, and not once the intent is ACCEPTED, COMMITTED or already DISCARDED. Returns the updated intent. To agree that two intents can coexist, use resolve_conflict instead. |
| get_changesetA | Read one ChangeSet by id. Use it to check a ChangeSet's status (PROVISIONAL, VALIDATED, ACCEPTED, COMMITTED or SUPERSEDED), its fingerprint, and its commit provenance: accepted_commit, pinned at acceptance and never changed, and integration_commit, set by record_commit. Read-only. Use get_intent for the work item itself. To find an id, status lists PROVISIONAL, VALIDATED and ACCEPTED ChangeSets, and query_work shows each intent's latest one. |
| get_intentA | Read one intent by id, with its owning agent and the count and ids of its OPEN or COORDINATING conflicts (check_conflicts with intent_id shows severity). Use it to see an intent's current status (INTENT, CLAIMED, IN_PROGRESS, PROVISIONAL, VALIDATED, ACCEPTED, COMMITTED or DISCARDED), declared scopes and depends_on, for example before assessing someone else's related work. Read-only. Use query_work to search intents by agent, status or scope, and status for everything at once. |
| list_agentsA | List every registered agent in registration order, with its id, name, model, capabilities, worktree, Git branch and head at registration, and status. Read-only and takes no arguments. Use it to find the agent id of another participant before coordinate_with_agent. Use status for the active agents alongside their current work. |
| publish_changesetA | Record a finished unit of implementation for your intent so it can be verified and accepted. Use it once the change is committed in your worktree, after check_conflicts and before run_verification. Foremerge snapshots the worktree (defaulting to your registered one), resolves the candidate commit and its diff base, and stores a fingerprint that verification and acceptance are later checked against. files and symbols are inferred only from uncommitted changes, so list them yourself for committed work. The ChangeSet starts PROVISIONAL and the intent becomes PROVISIONAL. Publishing again while the previous ChangeSet is PROVISIONAL or VALIDATED creates a new one, marks the old one SUPERSEDED, and resets verification. Only the intent's owner may publish, while the intent is CLAIMED, IN_PROGRESS, PROVISIONAL or VALIDATED. Git itself is not modified. Returns the ChangeSet, including its chg_ id, fingerprint, and open_conflicts on the intent at that moment. |
| publish_intentA | Announce work you are about to do, and the scopes it will change, before editing any code. This is the first call for every task, after register_agent. The intent is stored with status INTENT and compared against every other active intent. Returns the intent (with its int_ id), any conflicts detected immediately, and related_work: active intents, your own others included, that may relate to yours. Entries with asserted: true are collisions with both declared operations stated; the rest are candidates, with why_surfaced saying why. Assess each related_work entry and call record_assessment before writing code, then claim_work and start_work. Use check_conflicts instead for a what-if check that stores nothing. |
| query_workA | Search intents by owner, status or scope, to answer questions like who is changing this symbol, or which work still has open conflicts. Read-only. Each result joins an intent to its agent, its claims, its latest ChangeSet (id and full object), the ids of intents that depend on it, and its count of OPEN or COORDINATING conflicts. Results are an array, capped by limit. With no filters it returns intents of every status, including finished ones. Use get_intent when you already have an id, and status for a grouped overview of everything at once. |
| record_assessmentA | Record what you concluded about one entry from related_work. Foremerge states which scopes overlap and how the declared operations relate; deciding what that means is yours. Call this once per related intent, after publish_intent and before you write code. Each call appends a new assessment rather than replacing an earlier one, and changes no statuses: it does not open, resolve or dismiss conflicts. Act on the verdict with coordinate_with_agent, resolve_conflict or discard_work as needed. Only the intent's owner may assess it. Returns the stored assessment with its asm_ id. |
| record_commitA | Record where accepted work finally landed, after it has been merged through ordinary Git or a pull request. Use it last, after accept_changeset and the merge. The commit must contain the accepted commit in its history, otherwise the call fails with TARGET_DIVERGED. On success it stores integration_commit, moves the ChangeSet to COMMITTED, and returns the updated ChangeSet. accepted_commit is kept unchanged, so the record shows both what was verified and where it landed. Foremerge does not merge or push anything itself. |
| register_agentA | Register yourself as a participant and get the agent id every other write tool needs. Call it once at the start of each session, before publish_intent. Every call creates a new agent record, even for a name already in use; a warning is returned when an active agent with the same name and worktree exists, because that record's intents cannot be claimed by the new one. Passing a worktree records its Git branch and head; it must be inside the repository this server is bound to, normally the one it was launched in, or it is rejected with INVALID_INPUT. Returns the agent, including its agt_ id, and any warnings. |
| resolve_conflictA | Record an audited resolution decision for a durable cfl_* conflict so blocked work can proceed. Over MCP only an agent whose intent is a party may resolve it, and the decision is recorded under its agent id. Foremerge does not verify agreement or message ids, so either party can clear the gate alone: resolve only after the other party agrees. Use coordinate_with_agent first to reach that agreement, and discard_work instead when one side is simply dropping its work. Resolving moves the conflict to RESOLVED, which clears it from the acceptance gate for both intents; it does not change any code. It fails if the conflict is already resolved or dismissed. Returns the updated conflict. |
| run_verificationA | Run one named check from the trusted Foremerge registry of the repository this store is bound to. Raw commands are intentionally not accepted over MCP, and the registry cannot be selected by the caller or the server's working directory. Use it after publish_changeset and before accept_changeset; acceptance relies on this result, not on tests you report yourself. The check's command runs in the ChangeSet's worktree with the registry's timeout. It may create only generated files excluded from the fingerprint: changing any other file fails with STALE_CHANGESET, and excluded files left from an earlier run fail with CHECK_FAILED before it starts. The worktree must still match the fingerprint recorded at publication, or the call fails with STALE_CHANGESET and you must publish again. A pass moves the ChangeSet to VALIDATED; a failure leaves or returns it to PROVISIONAL. Returns the validation record: whether it passed, the exit code, captured stdout and stderr, the duration, and the fingerprint it ran against. |
| start_workA | Mark your claimed intent as being implemented. Call it after claim_work, immediately before you begin editing code. It moves the intent from CLAIMED to IN_PROGRESS and fails in any other state, or if you do not own the intent. It does not create or renew claims; use claim_work for that. Returns the updated intent with open_conflicts, the count and ids of its OPEN or COORDINATING conflicts; check their severity with check_conflicts before going further. |
| statusA | Get the whole coordination picture in one call, taken from a single consistent read: active agents, all intents grouped by lifecycle status, unexpired claims, OPEN or COORDINATING conflicts with both parties named, and ChangeSets grouped by status. Read-only and takes no arguments. Use it to orient at the start of a session or before choosing work. Use query_work to filter by agent, status or scope, and get_intent or get_changeset for full detail on one item. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 18 tools
Every tool targets a distinct resource or lifecycle step: reads are separated by entity (intent, changeset, overview/search), and state transitions have explicit sequential roles. The overlap among publish/claim/start/verify/accept/record is intentional and clearly sequenced, so an agent should not confuse one for another.
All tools use lower_snake_case and follow a predictable verb_noun pattern (get_intent, publish_changeset, resolve_conflict, run_verification), with only status as a noun-only outlier. There is no mixing of camelCase, bare generic verbs, or multiple verbs for the same action.
At 18 tools the server sits in the 16–25 range that feels heavy for an MCP toolset, even though the coordination workflow genuinely needs most of them. The count is defensible, but it is borderline rather than lean.
The full lifecycle is covered: register, publish intent, assess/claim/start, publish changeset, verify, accept, and record commit, with conflict and overview tools throughout. The main gap is that coordinated messages cannot be read through MCP, only sent, so an agent must use the CLI to receive the other side of the conversation.