Skip to main content
Glama

worktree_apply

Destructive

Apply selected audit recommendation items (policy/hook/seed/tool-prune) after user consent. Requires confirm=true to mutate; without it returns the plan. Never removes worktrees or user files.

Instructions

Apply selected audit recommendation items (policy/hook/seed/tool-prune) after user consent. Requires confirm=true to mutate; without it returns the plan. Never removes worktrees or user files.

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": "worktree_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemNoAudit item ids to apply (e.g. policy, hook, seed:pnpm)
jsonNoReturn JSON instead of text
confirmNotrue mutates; false or omitted returns the plan
all_safeNoApply every safe item that needs no extra consent
workspace_pathNoAbsolute thread workspace directory; must map to this project. Omit only when the server cwd is the thread workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.13.0

TDQS

A4.2/5.0
Behavior4/5

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

With destructiveHint=true already declared, the description adds real value: it names the consent precondition, states the default is a non-mutating plan, and bounds the blast radius ('Never removes worktrees or user files'). It stops short of describing exactly what files/config it writes when confirmed, but the safety envelope is well disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loaded with purpose and immediately followed by the consent/confirm gate and the scope guarantee. No filler.

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

Completeness4/5

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

For a 5-param, 0-required mutation tool with no output schema, it covers the essential agent questions: consent, default behavior, and scope of destruction. It omits partial-failure behavior and how item vs all_safe selection interacts, but nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so item, confirm, json, all_safe and workspace_path are all documented in the schema itself. The description reinforces confirm's plan-vs-mutate semantics but adds no new syntax or format detail beyond the schema, so baseline 3 applies.

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?

States a specific verb (Apply) and resource (selected audit recommendation items) and enumerates the item kinds it handles (policy/hook/seed/tool-prune). This clearly distinguishes it from the audit-producing sibling worktree_audit and from read-only siblings like worktree_status.

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?

It says when the mutation actually happens ('Requires confirm=true to mutate; without it returns the plan'), which tells the agent to call it in dry-run first. It does not point at an explicit alternative tool for inspecting recommendations, so it stops short of full when/when-not routing.

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