Skip to main content
Glama

pg_sub_worktree

Create and manage isolated module sub-worktrees, run in-memory 3-way merge conflict preflight, then merge or clean up safely.

Instructions

Manage isolated module sub-worktrees with in-memory git merge-tree --write-tree 3-way conflict preflight.

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": {
      "sub_action": "<sub_action>"
    },
    "name": "pg_sub_worktree"
  }
}

Input Schema

NameRequiredDescriptionDefault
msgNoMerge commit message when sub_action='merge'.
slotNoWorkspace slot name (optional if only one slot is open or `--slot` default is set).
sub_idNoSub-worktree identifier (required except for 'list').
cleanupNoRemove sub-worktree after clean merge (default: true).
sub_actionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.1

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one genuinely useful trait: the conflict preflight is in-memory and uses git merge-tree --write-tree, implying it does not touch the working tree. It says nothing about whether merge mutates the parent branch, what removal does to uncommitted work, or whether actions require a lock, so the mutation profile stays opaque.

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?

A single front-loaded sentence with no filler. The backtick-quoted git invocation is implementation detail that costs readability for an agent, but it does encode the preflight semantics, so it largely earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a five-parameter, five-action tool with no annotations and no output schema, and the description explains only the preflight action. Create, list, merge, and remove — including that cleanup defaults to true and will delete the sub-worktree — go undescribed, which is a significant gap for a tool that can destroy worktrees.

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 description coverage is 80%, so the schema already documents msg, slot, sub_id, and cleanup; baseline is 3. The description adds a small amount of meaning by framing the operation around module-level sub-worktrees, but it contributes no per-parameter detail (e.g. how slot resolves when omitted).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The resource is specific (isolated module sub-worktrees) and the preflight mechanism is named, but the verb is the vague 'Manage' and the five enum actions (list/create/preflight/merge/remove) are never enumerated. Nothing distinguishes this from the slot-oriented siblings such as pg_slot_open or pg_slot_close, so an agent cannot tell which family to reach for.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no exclusions, and no named alternative. The description never says when to pick a sub-worktree versus a slot, nor when preflight should precede merge, leaving the agent to infer the workflow entirely from the enum.

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