Skip to main content
Glama

lean_goal

Read-onlyIdempotent

Inspect proof goals at a line position in Lean files. Shows the state before and after a tactic, indicating proof completeness or ongoing elaboration.

Instructions

Get proof goals at a position. MOST IMPORTANT tool - use often!

Omit column to see goals_before (line start) and goals_after (line end),
showing how the tactic transforms the state. status='complete' means the
proof is finished at this point; status='no_goal_at_position' means the
position carries no proof state (e.g. outside a proof).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYesLine number (1-indexed)
columnNoColumn (1-indexed). Omit for before/after
formatNoOutput format: 'text' (default) or 'structured'text
file_pathYesAbsolute or project-root-relative path to Lean file
timeout_sNoMax seconds to wait for elaboration. On timeout returns status='still_elaborating' - poll again.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalsNoGoal list at specified column position
statusNoGoal status: 'goals' (open goals), 'complete' (no goals left - proof finished here), 'no_goal_at_position' (position carries no proof state), or 'still_elaborating' (timeout_s hit - poll again)
goals_afterNoGoals at line end (when column omitted)
goals_beforeNoGoals at line start (when column omitted)
line_contextYesSource line where goals were queried
Behavior5/5

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

Annotations declare readOnlyHint and idempotentHint, and the description adds crucial behavior: column omission reveals before/after states, timeout handling with 'still_elaborating' status, and possible statuses. No contradictions with annotations.

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?

The description is two sentences plus a status explanation. Front-loaded with 'MOST IMPORTANT tool - use often!' which is slightly verbose but adds emphasis. No extraneous information; each sentence serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a proof goal tool with 5 parameters and an output schema (not shown), the description adequately covers behavior, status outcomes, and column handling. No missing critical information for using the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters with descriptions. The description adds value by explaining the effect of omitting column (goals_before/goals_after) and the meaning of format enum options, which go beyond the schema's parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get proof goals at a position' with a specific verb and resource. It also labels itself as the 'MOST IMPORTANT tool', distinguishing it from siblings like lean_term_goal, lean_state_search, etc., which query different aspects.

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

Usage Guidelines4/5

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

The description explains when to omit column for before/after views, and defines status values like 'complete' and 'no_goal_at_position'. It does not explicitly list when to use this vs. other tools, but the context of proof goals and the 'most important' emphasis provides implicit guidance.

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