Skip to main content
Glama

lean_leandex

Search Lean codebases semantically for theorems and definitions using natural language or Lean terms, helping you check if a result already exists before proving it.

Instructions

Search for theorems and definitions using leandex.

Leandex is a semantic search engine for Lean codebases.
It uses a combination of natural language processing and machine learning to search for theorems and definitions.
It's recommended to use leandex to search whether there exist relevant results before you start to prove a somewhat classic goal.
It's a good practice to query for more general / specific results and then use the results to refine the query if you failed to find the desired results.
You can also use leandex to check the definition of a term or a concept.

Query patterns:
  - Natural language: "If there exist injective maps of sets from A to B and from B to A, then there exists a bijective map between A and B."
  - Mixed natural/Lean: "natural numbers. from: n < m, to: n + 1 < m + 1", "n + 1 <= m if n < m"
  - Concept names: "Cauchy Schwarz"
  - Lean identifiers: "List.sum", "Finset induction"
  - Lean term: "{f : A → B} {g : B → A} (hf : Injective f) (hg : Injective g) : ∃ h, Bijective h"

Args:
    query (str): Search query
    num_results (int, optional): Max results. Defaults to 5.

Returns:
    List[Dict] | str: Search results or error msg

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
num_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains leandex is a 'semantic search engine' and that it returns 'Search results or error msg.' It also hints at possible failure by advising query refinement. However, it does not disclose limitations like potential approximate matches or response structure details, so it is adequate but not rich.

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 front-loaded with a clear opening sentence and organized into sections. It includes extensive query pattern examples, which are valuable but make it longer than necessary. Each example earns its place, so the verbosity is justified, but it could be tightened.

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?

For a tool with 2 parameters and no annotations, the description is comprehensive. It covers purpose, usage context, query patterns, arguments, and return type. The presence of an output schema (though not shown) means return values need not be detailed, and the description provides sufficient guidance for an agent to select and invoke the tool correctly.

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?

The schema has no property descriptions, so coverage is 0%. The description compensates with an Args section: 'query (str): Search query' and 'num_results (int, optional): Max results. Defaults to 5.' This adds meaningful semantics beyond the schema, though it could be more detailed about query formatting.

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?

The description clearly states the tool's function: 'Search for theorems and definitions using leandex.' It identifies the resource (theorems/definitions) and the action (search). However, it does not distinguish this search tool from siblings like lean_loogle or lean_local_search, so it loses a point for missing explicit differentiation.

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: 'It's recommended to use leandex to search whether there exist relevant results before you start to prove a somewhat classic goal.' It also advises refining queries. However, it does not explicitly state when *not* to use leandex or mention alternatives, 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