Skip to main content
Glama

lean_completions

Get Lean code completions at a file location, including dot completions, identifier suggestions, and importable file lists after 'import'. Use on incomplete lines to discover available identifiers and imports.

Instructions

Get code completions at a location in a Lean file.

Only use this on INCOMPLETE lines/statements to check available identifiers and imports:
- Dot Completion: Displays relevant identifiers after a dot (e.g., `Nat.`, `x.`, or `Nat.ad`).
- Identifier Completion: Suggests matching identifiers after part of a name.
- Import Completion: Lists importable files after `import` at the beginning of a file.

Args:
    file_path (str): Abs path to Lean file
    line (int): Line number (1-indexed)
    column (int): Column number (1-indexed)
    max_completions (int, optional): Maximum number of completions to return. Defaults to 32

Returns:
    str: List of possible completions or error msg

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYes
columnYes
file_pathYes
max_completionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the types of completions and the return format ('List of possible completions or error msg'), which adds meaningful behavioral context. However, it does not explicitly state that the operation is read-only or does not modify files, which could be inferred but is not stated.

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?

The description is well-structured with a brief purpose, bullet-pointed completion types, and a clean 'Args' section. Every sentence provides value without redundancy. It is front-loaded with the key usage constraint and efficiently conveys all necessary information.

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?

For a tool with 4 parameters and an output schema, the description covers purpose, usage, parameters, and return type. It could be more explicit about error scenarios or prerequisites, but the given details are sufficient for an agent to use the tool correctly in most cases.

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

Parameters5/5

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

The schema has 0% description coverage, so the description compensates fully. It explains that file_path is an absolute path, line and column are 1-indexed, and max_completions defaults to 32. These details are not present in the schema and are essential for correct invocation.

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 the tool's purpose: 'Get code completions at a location in a Lean file.' It further breaks down into three specific completion types (Dot, Identifier, Import), making it distinct from sibling tools like lean_hover_info or lean_goal.

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

Usage Guidelines5/5

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

The description explicitly instructs to use only on INCOMPLETE lines/statements, providing a clear when-not scenario. It also details three specific use cases (dot completion, identifier completion, import completion), which serves as concrete guidance for when this tool is appropriate.

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

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