Skip to main content
Glama

lean_state_search

Find theorems applicable to the current Lean proof goal using premise-search.com, given a file path, line, and column.

Instructions

Limit: 3req/30s. Search for theorems based on proof state using premise-search.com.

Only uses first goal if multiple.

Args:
    file_path (str): Abs path to Lean file
    line (int): Line number (1-indexed)
    column (int): Column number (1-indexed)
    num_results (int, optional): Max results. Defaults to 5.

Returns:
    List | str: Search results or error msg

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYes
columnYes
file_pathYes
num_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses a rate limit ('Limit: 3req/30s'), a behavioral nuance ('Only uses first goal if multiple'), and the return type ('List | str: Search results or error msg'). This provides useful transparency beyond the bare schema.

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 compact and well-organized. It leads with the rate limit, states the core purpose, notes a behavioral caveat, then lists parameters and return type. Every sentence adds value, and the structure follows a logical docstring format.

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?

The description covers purpose, parameters, return type, and a key limitation. It is adequate for the tool's complexity, but it could provide more context about how line/column map to a proof state or what the search results contain. The output schema is not shown, but the return type is described.

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?

Schema description coverage is 0%, so the description fully compensates. Each parameter is explicitly defined: file_path ('Abs path to Lean file'), line and column ('1-indexed'), and num_results ('Max results. Defaults to 5.'). This leaves no ambiguity about parameter meaning.

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 function: 'Search for theorems based on proof state using premise-search.com.' The verb 'search' and resource 'theorems based on proof state' are specific, and the mention of the external service distinguishes it from sibling tools like lean_local_search or lean_loogle.

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 gives clear context: given a file path, line, and column, it searches for theorems. It also notes a limitation ('Only uses first goal if multiple'), which is implicit usage guidance. However, it does not explicitly compare against alternatives or state when not to use it, so it falls short of a 5.

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