Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

Clean Up or Truncate Log Files

logs_cleanup

Delete or truncate specified log files, or purge directory logs older than a set number of days to reclaim disk space.

Instructions

批量删除或截断清空指定的日志文件,或清理指定目录中超过 retentionDays 天的过期日志。

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

Input Schema

NameRequiredDescriptionDefault
pathsNo要清理的具体日志文件路径列表
directoryNo按过期天数批量清理时的目录路径
truncateOnlyNo为 true 时仅清空文件内容(0 字节)而不删除文件本身
olderThanDaysNo配合 directory 使用,清理超过指定天数的日志文件

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden. It does disclose the key behavioral trait that truncateOnly=false means irreversible deletion while true zeroes the file's contents, but it says nothing about permission requirements, recursion into subdirectories, symlink handling, behavior on missing paths, or what the tool returns after cleaning.

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?

One compact sentence that front-loads the primary action (delete/truncate specific files) before the secondary directory-retention mode. No filler, though it is terse for the destructiveness involved.

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

Completeness3/5

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

For a zero-annotation destructive tool with no output schema, the definition covers both operating modes and the truncate flag but leaves out scope questions an agent needs answered before destroying data: recursion, non-log files in the directory, and error behavior. Adequate but with clear gaps.

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 the schema already explains all four parameters and this is the baseline case. The description does add the pairing logic (directory works with the age threshold) but refers to it as 'retentionDays' while the actual parameter is named 'olderThanDays', a small naming mismatch that could cost an agent a beat.

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?

The description gives specific verbs and a resource: batch delete (删除) or truncate (截断清空) named log files, plus retention-based cleanup of expired logs in a directory. An agent can tell it does file-level destructive log maintenance, but it never contrasts itself with fs_delete or logs_list_files, so sibling differentiation is left to inference.

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?

Usage is only implied through the two modes: pass explicit file paths to target specific logs, or pass a directory plus an age threshold for retention cleanup. There is no statement of when to prefer this over fs_delete/system_cleanup_audit_logs, and no prerequisites such as required permissions or a confirmation step before destruction.

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