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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.29.0
    • removedInput schema / properties / severity / anyOf
      Removed value: -[
      -  {
      -    "enum": [
      -      "error",
      -      "warning",
      -      "info",
      -      "hint"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / severity / enum
      Added value: +[
      +  "error",
      +  "warning",
      +  "info",
      +  "hint"
      +]
  2. Changed8 schema fields changedv0.28.0
    • removedInput schema / $defs
      Removed value: -{
      -  "DiagnosticSeverity": {
      -    "enum": [
      -      "error",
      -      "warning",
      -      "info",
      -      "hint"
      -    ],
      -    "title": "DiagnosticSeverity",
      -    "type": "string"
      -  }
      -}
    • changedInput schema / properties / severity / anyOf
      Previous value: -[
      -  {
      -    "$ref": "#/$defs/DiagnosticSeverity"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "error",
      +      "warning",
      +      "info",
      +      "hint"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / severity / title
      Added value: +"Severity"
    • addedInput schema / properties / severity / type
      Added value: +"string"
    • addedInput schema / properties / timeout_s
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 1,
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Max seconds to wait for elaboration. On timeout returns partial=true with still_elaborating_lines - poll again. Omit to wait for full elaboration.",
      +  "title": "Timeout S"
      +}
    • addedOutput schema / $defs / DiagnosticMessage / properties / lean_tags
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Lean-specific tags: 'unsolvedGoals' (proof incomplete here) or 'goalsAccomplished' (proof finished). Machine-readable proof status - prefer over string-matching the message.",
      +  "title": "Lean Tags"
      +}
    • addedOutput schema / $defs / DiagnosticsResult / properties / partial
      Added value: +{
      +  "default": false,
      +  "description": "True when elaboration was still running at timeout: items may be incomplete and still_elaborating_lines shows the pending region. Poll again instead of treating this as failure.",
      +  "title": "Partial",
      +  "type": "boolean"
      +}
    • addedOutput schema / $defs / DiagnosticsResult / properties / still_elaborating_lines
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "items": {
      +          "type": "integer"
      +        },
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Line ranges [start, end] (1-indexed) still being elaborated",
      +  "title": "Still Elaborating Lines"
      +}
  3. Addedv0.10.0
  4. Removedv0.23.1
  5. First observed

TDQS

B3.3/5.0
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.