Skip to main content
Glama

lean_leanfinder

Search Mathlib theorems and definitions semantically by mathematical concept, proof state, or statement fragment to locate relevant Lean statements.

Instructions

Limit: 10req/30s. Search Mathlib theorems/definitions semantically by mathematical concept or proof state using Lean Finder.

Effective query types:
- Natural language mathematical statement: "For any natural numbers n and m, the sum n+m is equal to m+n."
- Natural language questions: "I'm working with algebraic elements over a field extension … Does this imply that the minimal polynomials of x and y are equal?"
- Proof state. For better results, enter a proof state followed by how you want to transform the proof state.
- Statement definition: Fragment or the whole statement definition.

Tips: Multiple targeted queries beat one complex query.

Args:
    query (str): Mathematical concept or proof state
    num_results (int, optional): Max results. Defaults to 5.

Returns:
    List[Dict] | str: List of Lean statement objects (full name, formal statement, informal statement) or error msg

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
num_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Without annotations, the description carries the full burden of disclosure. It mentions a rate limit (10req/30s) and clearly states the return format (List[Dict] | str) with error messages. It does not explicitly state that the tool is read-only, which would be helpful, but the search action implies it. This is reasonably transparent.

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 well-structured but somewhat lengthy due to detailed query types and tips. However, every segment adds value, and the information is front-loaded with purpose and limits. It earns a 4 rather than a 5 because it could be tightened without losing value.

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 tool's complexity (semantic search with multiple query forms) and lack of annotations, the description is remarkably complete. It explains query types, parameters, return values, and rate limits. The output schema is not provided, but the description lists the returned object fields, making it self-sufficient.

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 no descriptions for parameters, and the description fully compensates by defining 'query' as 'Mathematical concept or proof state' and 'num_results' as 'Max results. Defaults to 5.' This adds meaning beyond the schema and covers both parameters.

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 searches Mathlib theorems/definitions semantically by mathematical concept or proof state. It distinguishes itself from sibling search tools by emphasizing semantic search, and the verb 'search' is specific to the resource.

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 provides clear context on how to use the tool, including effective query types and tips like 'Multiple targeted queries beat one complex query.' However, it does not explicitly mention when not to use it or name alternative search tools (e.g., lean_loogle or lean_leandex), so it stops short of a full 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