Skip to main content
Glama

Stale branches

stale_branches
Read-onlyIdempotent

Find branches whose latest commit is at least N days old, oldest first, and check if each is already merged into HEAD to flag cleanup candidates.

Instructions

List branches whose latest commit is at least N days old, oldest first, and whether each is already merged into HEAD.

Input Schema

NameRequiredDescriptionDefault
daysNoTime window in days.
repoNoRepo name or path; defaults to the first configured repo.
limitNoMaximum number of results.
mergedOnlyNoOnly list branches already merged into HEAD, i.e. safe cleanup candidates.
includeRemoteNoAlso include remote-tracking branches.

Output Schema

NameRequiredDescriptionDefault
repoYesName of the repository that was queried.
branchesYes
staleCountYes
thresholdDaysYes
totalBranchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.0
    • changedInput schema / properties / days / description
      Previous value: -"Size of the time window in days."New value: +"Time window in days."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results (1-200)."New value: +"Maximum number of results."
    • changedInput schema / properties / repo / description
      Previous value: -"Repository name or absolute path from the allowlist. Defaults to the first configured repo."New value: +"Repo name or path; defaults to the first configured repo."
  2. First observedv0.2.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so safety is covered. The description still adds behavior not captured there: result ordering (oldest first) and the inclusion of per-branch merge status against HEAD.

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?

A single sentence with no filler; the stale-threshold filter is front-loaded, followed by ordering and output content. Nothing is repeated or padded.

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?

With an output schema present and full annotation coverage, the description need not explain return values, and it correctly focuses on filter and ordering semantics. Minor gaps remain around default-repo behavior and remote-branch handling, but those are covered in the schema.

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 description coverage is 100% and every parameter (days, repo, limit, mergedOnly, includeRemote) is documented in-schema with defaults and bounds. The description restates the days threshold and the merged-into-HEAD condition, which loosely maps to days and mergedOnly, but adds no syntax or format detail beyond the schema. Baseline 3 applies.

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

Purpose4/5

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

States a specific verb (list), resource (branches), and a precise filter (latest commit at least N days old), plus the ordering (oldest first) and an output dimension (merged into HEAD). It is clearly distinguishable in practice from siblings like list_tags or recent_activity, though it never names an alternative to anchor that distinction.

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

Usage Guidelines3/5

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

There is no explicit when-to-use statement, no prerequisites, and no named alternative among the many siblings. The only usage signal is indirect, via mergedOnly's schema note about 'safe cleanup candidates,' which implies branch-pruning intent but leaves the agent to infer when this beats compare_refs or recent_activity.

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