Skip to main content
Glama
GeminiDesk MCP
by LZ7TOP

Scan & List Log Files

logs_list_files

Scan log directories to list files sorted by size descending, helping you identify large logs for cleanup. Filter by directory, depth, file count, or minimum size.

Instructions

扫描指定目录或默认日志目录(含 MCP 审计日志目录与 ~/Library/Logs)中的日志文件,按大小降序展示以便清理。

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_list_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxDepthNo最大扫描目录深度
maxFilesNo最大返回文件数
directoryNo要扫描的目录,留空则扫描 MCP 审计日志目录与 ~/Library/Logs
minSizeBytesNo最小文件字节过滤

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, the description carries the full burden; it does disclose the default scan targets and the size-descending result order, which are useful behavioral facts. It does not state that the operation is read-only/non-destructive, whether hidden files or symlinks are followed, or anything about scan cost. Given it is a listing tool the safety risk is low, but the disclosure is still partial.

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?

A single compact sentence that front-loads the action and scope, with the default directories and sort order following logically. No filler or repetition; only minor cost is that the cleanup motivation is tacked on the end rather than stated up front.

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 four-parameter, no-output-schema scan tool, the description plus the fully documented schema covers the inputs and hints at the return ordering. It stops short of saying the tool is purely read-only and what the returned entries look like, which would matter for an agent deciding between listing and deleting logs.

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%, so the schema already documents maxDepth, maxFiles, directory, and minSizeBytes in detail. The description only restates the directory fallback (which the schema says verbatim) and adds the size-descending sort order. Baseline 3 is appropriate since it adds little beyond the schema.

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 and resource (扫描日志文件) plus the scope: a caller-specified directory or the default set of MCP audit logs and ~/Library/Logs. The ordering (按大小降序) and the cleanup-oriented motivation further pin down what the tool returns. It does not explicitly name a sibling such as logs_cleanup or fs_list_directory, so differentiation is only implied by the word 日志.

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?

The phrase 以便清理 gives an implied use case (find large logs before cleanup), and the description explains the fallback behavior when no directory is supplied. However, there is no explicit statement of when to prefer this over logs_cleanup or fs_list_directory, and no exclusion of non-log directories beyond the default.

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