Skip to main content
Glama

lean_diagnostic_messages

Read-onlyIdempotent

Retrieve compiler errors, warnings, and infos for Lean files, with optional filtering by severity or line range to diagnose issues.

Instructions

Get compiler diagnostics (errors, warnings, infos) for a Lean file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_lineNoFilter to line
severityNoFilter by severity level. Returns all levels when omitted.
file_pathYesAbsolute or project-root-relative path to Lean file
timeout_sNoMax seconds to wait for elaboration. On timeout returns partial=true with still_elaborating_lines - poll again. Omit to wait for full elaboration.
start_lineNoFilter from line
interactiveNoReturns verbose nested TaggedText with embedded widgets. Only use when plain text is insufficient. For 'Try This' suggestions, prefer lean_code_actions.
declaration_nameNoFilter to declaration (slow)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The annotations declare readOnlyHint=true and idempotentHint=true, which align with the read-only nature of fetching diagnostics. The description adds minimal extra behavior (listing error/warning/info types) but does not mention timeout/partial result behavior, which is described in the schema.

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?

One concise sentence, no redundant information. Front-loaded with the core purpose.

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?

While the schema fully documents parameters and output schema exists, the tool has 7 parameters and several behavioral nuances (timeout partial results, interactive widgets). The description is limited to a one-line summary and doesn't mention these capabilities or direct users to lean_code_actions for 'Try This' suggestions, so it's adequate but not comprehensive.

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?

The schema has 100% description coverage for all 7 parameters, so the baseline is 3. The description itself does not add any parameter semantics beyond the schema, such as the filtering options (severity, line range, declaration_name).

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 'Get compiler diagnostics (errors, warnings, infos) for a Lean file' — a clear verb+resource. It does not explicitly distinguish from sibling tools like lean_build or lean_verify, so it scores 4 rather than 5.

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 provided about when to use this tool versus alternatives. There is no mention of filtering by severity or line, or that 'Try This' suggestions should use lean_code_actions, which appears both in the schema and sibling list.

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/oOo0oOo/lean-lsp-mcp'

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