Skip to main content
Glama

lean_profile_proof

Destructive

Profiles a Lean theorem to return per-line timing and categories, helping identify slow proof lines; avoid use on theorems already reaching heartbeat limits.

Instructions

Run lean --profile on a theorem. Returns per-line timing and categories. SLOW - avoid on theorems that already hit heartbeat limits.

Input Schema

NameRequiredDescriptionDefault
lineYesLine where theorem starts (1-indexed)
top_nNoNumber of slowest lines to return
timeoutNoMax seconds to wait
file_pathYesAbsolute or project-root-relative path to Lean file

Output Schema

NameRequiredDescriptionDefault
msYesTotal elaboration time in ms
linesNoTime per source line (>1% of total)
categoriesNoCumulative time by category in ms

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.10.0
  2. Removedv0.23.1
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, non-idempotent, so the safety burden is partly carried structurally. The description adds real value with the performance warning ('SLOW'), but it never explains why the tool is flagged destructive, how long it may hold resources, or what the timeout actually aborts — all relevant for an annotated-destructive tool.

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?

Three short sentences, front-loaded with the action, then the return value, then the caveat. Nothing is redundant and the warning is placed where an agent will see it before invoking.

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-format detail is not required, and the description still summarizes it in one line. The only shortfall is that a destructive-flagged, long-running tool would benefit from a note on what it mutates or whether it requires a prior build.

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%, with line, top_n, timeout, and file_path each documented in the schema itself. The description adds no parameter-level meaning beyond that, so the baseline of 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?

The description names the concrete mechanism (`lean --profile`) and the resource (a theorem at a given file/line), plus what comes back (per-line timing and categories). It is clearly distinct from sibling tools like lean_verify or lean_diagnostic_messages, though it never names an alternative explicitly.

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?

There is one genuine exclusion: 'avoid on theorems that already hit heartbeat limits.' That tells the agent a negative condition, but there is no positive routing guidance such as 'run lean_verify first' or when to prefer this over a plain build, so usage is only partially implied.

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