Skip to main content
Glama

logs_prune

Prune session logs to free disk space by applying retention policies; defaults to dry-run for safe preview, with irreversible deletion requiring confirmation.

Instructions

会话日志的保留策略与清理入口(日志只增不减时用)。

★ 默认 dry_run=True:只列出会删哪些文件、能回收多少空间,什么都不删。 要真删:dry_run=False + confirm=True,且隔离档位需为 write (删除不可逆——那些日志往往是几天前那次偶发故障的唯一现场)。

keep_days / keep_count 传 0(默认)时用内置策略:保留最近 30 天 / 最新 200 个。 ⓘ 日志会原样记录串口收发内容,可能含 WiFi 密码 / token 等凭据,分享前请检查。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNo
dry_runNo
keep_daysNo
keep_countNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the default no-op behavior, the exact flag combination and permission tier needed to mutate, the irreversibility of deletion, the built-in retention defaults, and that logs may contain credentials.

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?

Front-loads the safety-critical default first and uses markers (★, ⓘ) to make scanning easy; every sentence carries needed information for a destructive tool. It is somewhat long, but the length is largely justified by the risk profile.

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?

An output schema exists, so return values need not be explained. Combined with defaults, prerequisites, irreversibility and the credential warning, an agent has everything needed to call this destructive tool correctly.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate and does: dry_run's default/effect, confirm's role in enabling real deletion, and the meaning of keep_days/keep_count=0 (built-in 30-day / 200-item policy). All four params get semantics beyond the bare schema.

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?

Names a specific verb+resource (session-log retention policy / cleanup entry) and immediately scopes it with the condition 'when logs only grow'. No sibling does pruning, so the agent can identify this tool unambiguously.

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?

Gives precise conditions: dry_run=True is the default safe path that deletes nothing, and real deletion requires dry_run=False + confirm=True + write isolation tier. Strong when/when-not guidance, though it never names an alternative tool (e.g. sessions_list/analyze_log) for inspecting logs first.

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