Skip to main content
Glama

lean_verify

Read-onlyIdempotent

Verify a Lean theorem's axioms and optionally scan its source file for suspicious patterns. Checks only the given file, not imports.

Instructions

Check theorem axioms + optional source scan. Only scans the given file, not imports.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to Lean file
scan_sourceNoScan source file for suspicious patterns
theorem_nameYesFully qualified name (e.g. `Namespace.theorem`)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
trustNoWorst case in `axioms`. 'standard' is the ordinary Mathlib basis; 'incomplete' means sorryAx, so it is not a proof; 'native' means native_decide, trusting the compiler rather than the kernel; 'custom' means other axioms are in play.standard
axiomsNoAxioms used. Standard 3: propext, Classical.choice, Quot.sound
warningsNoSuspicious source patterns (if enabled)
non_standard_axiomsNoAxioms outside the standard 3 — the reason for `trust`

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.31.0
    • addedOutput schema / $defs / AxiomTrust
      Added value: +{
      +  "enum": [
      +    "standard",
      +    "incomplete",
      +    "native",
      +    "custom"
      +  ],
      +  "title": "AxiomTrust",
      +  "type": "string"
      +}
    • addedOutput schema / properties / non_standard_axioms
      Added value: +{
      +  "description": "Axioms outside the standard 3 — the reason for `trust`",
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Non Standard Axioms",
      +  "type": "array"
      +}
    • addedOutput schema / properties / trust
      Added value: +{
      +  "$ref": "#/$defs/AxiomTrust",
      +  "default": "standard",
      +  "description": "Worst case in `axioms`. 'standard' is the ordinary Mathlib basis; 'incomplete' means sorryAx, so it is not a proof; 'native' means native_decide, trusting the compiler rather than the kernel; 'custom' means other axioms are in play."
      +}
  2. Addedv0.10.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is covered. The description adds a meaningful behavioral limitation beyond that: it only scans the given file and not imports, which materially affects how an agent should interpret results.

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?

Two short sentences with zero filler, and the core action is front-loaded ahead of the scoping caveat. Efficient and well-structured, though terse enough that it leaves value on the table.

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 needn't be explained. For a 3-parameter verification tool with full schema coverage, the description covers what it does and its scan scope, though it could say more about what 'axioms' checking entails.

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 file_path, theorem_name, and scan_source. The description alludes to 'optional source scan' and 'given file' but adds no syntax or format detail beyond the schema, so baseline 3 applies.

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: 'Check theorem axioms' with an optional source scan. This is clearly a verification tool, distinguishable from sibling tools like lean_build or lean_run_code. It stops short of naming a sibling it complements or contrasts with, so it's clear but not maximally differentiated.

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 scope note ('Only scans the given file, not imports') gives a boundary but is not explicit when-to-use/when-not guidance, and no alternatives are named. Usage is implied rather than stated, leaving the agent to infer when verification is warranted.

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