Skip to main content
Glama

analyze_log

Analyze local log files to extract errors, identify root causes with supporting evidence, and suggest fixes using local Ollama or built-in rules.

Instructions

智能分析日志:自动抽取错误,给出根因、证据与修复建议。

优先使用本地 Ollama 大模型;未安装或未启动时自动降级为内置规则引擎。

Args: file_path: 日志文件绝对路径。 max_lines: 送入分析的最大日志行数,0 表示使用配置默认值(400)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
max_linesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does disclose a key non-obvious behavior: it prioritizes local Ollama LLM and automatically falls back to a built-in rule engine if unavailable. It does not explicitly state read-only side effects or file-access prerequisites, but it goes well beyond the minimum.

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?

The description is front-loaded with purpose and fallback behavior, then lists only the two arguments. Every sentence adds unique value with no redundant or filler content.

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?

An output schema exists, so return values need not be explained. The description covers parameters and the LLM fallback behavior, but it omits guidance on when to choose this tool over the many sibling log-analysis tools.

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 description coverage is 0%, so the description fully compensates by documenting both parameters. It specifies that file_path must be an absolute path and explains max_lines semantics including that 0 uses the configured default of 400.

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 states a specific verb and resource ('智能分析日志') plus its high-level outputs (自动抽取错误、根因、证据、修复建议). It does not explicitly differentiate itself from sibling tools like analyze_error_text or get_log_stats, so it stops short of the top score.

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

Usage Guidelines2/5

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

No guidance is given on when to use this tool versus siblings such as analyze_error_text, search_log_keyword, or read_log_tail. The fallback behavior is described, but that is behavioral transparency, not usage routing.

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