Skip to main content
Glama

delimit_ledger_auto_close_external

Automatically close ledger items linked to resolved GitHub issues or pull requests. Scans descriptions and tags for GitHub references, checks their status, and marks done or archives accordingly.

Instructions

Auto-close ledger items whose linked GitHub issue/PR already resolved.

When to use: as periodic maintenance to keep the ledger in sync with external reality — LEDs whose tracked GitHub issue/PR is closed/merged should not stay open. When NOT to use: to close one item by hand (use delimit_ledger_done) or to read external state (delimit_resource_get).

Sibling contrast: delimit_ledger_done is per-item; this auto-detects across many items.

Side effects: when dry_run=False, marks/archives via delimit_ledger_bulk under the hood. Default dry_run=True returns a plan only. Detection scans description/context/last_note/tags for github links / shorthand / gh: tag form.

Detection scans description / context / last_note / tags for:

  • https://github.com///(issues|pull)/

  • /# (short form)

  • gh:// (explicit tag form)

Action map (per LED-1146 deliberation):

  • PR with merged=true → mark_done with merge SHA in note

  • issue/PR closed with state_reason="completed" → mark_done with closed_at

  • issue/PR closed with state_reason="not_planned" or no reason → archive

  • state="open" → leave alone

  • gh API error / 404 → leave alone, recorded in errors

Implementation re-uses bulk_action() under the hood; nothing new on the write path. dry_run=True (default) returns a plan; dry_run=False applies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ventureNoproject name or path. Auto-detects if empty.
dry_runNoTrue (default) returns a plan without writing.
max_itemsNohard cap on items processed in one call (default 200). When the candidate set exceeds this, the response is `truncated=True`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully discloses side effects (marks/archives on dry_run=False), default behavior (dry_run=True returns plan), detection methods, action mapping per resolution state, error handling (API errors leave alone), and implementation reuse. No contradictions.

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?

Well-structured with sections (when to use, side effects, detection, action map). Front-loaded with purpose. However, it is somewhat verbose; some details could be moved to output schema or shortened.

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?

Given complexity (3 params, output schema exists, no annotations), the description is thorough: covers detection logic, action mapping, side effects, defaults, and error handling. Nothing critical is 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 100%, so baseline is 3. The description adds behavioral context for dry_run (default true, returns plan vs applies) and max_items (hard cap, truncation flag), which goes beyond the schema definitions. venture is explained briefly but clearly.

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?

The description clearly states the tool's purpose: auto-close ledger items whose linked GitHub issue/PR is resolved. It uses specific verbs and resources, and differentiates from siblings like delimit_ledger_done (per-item) and delimit_resource_get (read external state).

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?

Explicitly states when to use (periodic maintenance) and when not to (manual close, read external state). Names alternative tools for those cases, providing clear guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/delimit-ai/delimit-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server