Skip to main content
Glama

lean_completions

Read-onlyIdempotent

Retrieve IDE autocompletions for incomplete Lean code at a specified line and column, including after a dot or partial name, to complete identifiers and expressions.

Instructions

Get IDE autocompletions. Use on INCOMPLETE code (after . or partial name).

Input Schema

NameRequiredDescriptionDefault
lineYesLine number (1-indexed)
columnYesColumn number (1-indexed characters)
file_pathYesAbsolute or project-root-relative path to Lean file
max_completionsNoMax completions
resolve_detailsNoFetch type signatures for the top N results

Output Schema

NameRequiredDescriptionDefault
itemsNoList of completion items
prefixYesSource prefix completed at the requested position

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.33.0
    • addedOutput schema / properties / prefix
      Added value: +{
      +  "description": "Source prefix completed at the requested position",
      +  "title": "Prefix",
      +  "type": "string"
      +}
    • addedOutput schema / required
      Added value: +[
      +  "prefix"
      +]
  2. Changed2 schema fields changedv0.28.0
    • changedInput schema / properties / column / description
      Previous value: -"Column number (1-indexed)"New value: +"Column number (1-indexed characters)"
    • addedInput schema / properties / resolve_details
      Added value: +{
      +  "default": 8,
      +  "description": "Fetch type signatures for the top N results",
      +  "minimum": 0,
      +  "title": "Resolve Details",
      +  "type": "integer"
      +}
  3. Addedv0.10.0
  4. Removedv0.23.1
  5. First observed

TDQS

A3.8/5.0
Behavior3/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 structurally. The description adds nothing beyond that – it does not say what happens on an empty result, whether the file must be part of the open project, or how resolve_details affects cost. Useful but thin given annotations carry most of the burden.

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?

Two short sentences with zero filler, and the core action is front-loaded before the usage caveat. Nothing could be removed without losing meaning.

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 need not be explained, and the input schema is fully documented; the description covers purpose and trigger condition adequately for a simple LSP-backed lookup. Minor gaps remain around preconditions (file must be opened/known to the project) and empty-result behavior.

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 line/column indexing, path form, max_completions and resolve_details are all fully documented in the schema. The description adds no positional or formatting guidance beyond it, which matches the baseline for a high-coverage schema.

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?

"Get IDE autocompletions" names a concrete verb and resource, so an agent immediately knows this returns candidate completions rather than diagnostics or goals. It does not explicitly name the sibling it is contrasted with (e.g. lean_hover_info for complete identifiers or lean_local_search for name search), so it stops short of a 5.

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 second sentence gives a real usage condition – call it on incomplete code, specifically after `.` or a partial name – which is the key discriminator versus hover/goal tools. There are no explicit exclusions or named alternatives, so it is clear context without routing.

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