Lean LSP MCP
This server enables AI agents to interact with Lean theorem prover projects through Language Server Protocol (LSP) tools and external search services.
Core Capabilities:
File Analysis & Navigation: Get file outlines with imports and declarations, retrieve diagnostic messages (errors, warnings, info) with optional filtering, find declaration source files, and access hover information with type signatures and documentation
Proof Development: View proof goals at specific positions (the most important tool), get expected types at positions, attempt multiple tactics without modifying files to compare results, and profile theorems to identify slow tactics with per-line timing data
Code Assistance: Get IDE-style autocompletions for identifiers and imports, and run independent Lean code snippets with diagnostic feedback
Search Capabilities:
Local Search: Fast verification of declarations in local project and stdlib using ripgrep (prevents hallucination)
External Search (rate limited): Natural language search (LeanSearch), type signature/pattern search (Loogle), semantic search by mathematical meaning (Lean Finder), goal-based lemma search (State Search), and premise suggestions for automation tactics (Hammer)
Project Management: Build projects with
lake buildand restart the LSP server
Key Features: REPL-based execution for ~5x faster multi-attempt, local Loogle option to avoid rate limits, multiple transport methods (stdio, streamable-http, SSE), and bearer token authentication for public servers.
Enables searching for theorems in Mathlib using natural language queries through leansearch.net, which is documented in an arXiv paper.
Provides integration with the Lean theorem prover and related tools including leanclient, LeanSearch, Loogle, Lean Finder, Lean Hammer, and Lean State Search hosted on GitHub repositories.
Distributes the lean-lsp-mcp package through PyPI for installation and management of the Lean theorem prover MCP server.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Lean LSP MCPsearch for theorems about natural number addition"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP server that allows agentic interaction with the Lean theorem prover via the Language Server Protocol using leanclient. This server provides a range of tools for LLM agents to understand, analyze and interact with Lean projects.
Key Features
Rich Lean Interaction: Access diagnostics, goal states, term information, hover documentation and more.
External Search Tools: Use
LeanSearch,Loogle,Lean Finder,Lean HammerandLean State Searchto find relevant theorems and definitions.Easy Setup: Simple configuration for various clients, including VSCode, Cursor and Claude Code.
Related MCP server: TypeScript LSP MCP
Setup
Overview
Install uv, a Python package manager.
Make sure your Lean project builds quickly by running
lake buildmanually.Configure your IDE/Setup
(Optional, highly recommended) Install ripgrep (
rg) for local search and source scanning (lean_verifywarnings).
1. Install uv
Install uv for your system. On Linux/MacOS: curl -LsSf https://astral.sh/uv/install.sh | sh
1b. Alternative: Install with Nix
If you use Nix, you can install the package directly from GitHub:
nix profile install github:oOo0oOo/lean-lsp-mcpOr run it without installing: nix run github:oOo0oOo/lean-lsp-mcp.
This provides the MCP server only. You still need a Lean toolchain (elan/lake) for your project, same as the uv setup below.
2. Run lake build
lean-lsp-mcp will run lake serve in the project root to use the language server (for most tools). Some clients (e.g. Cursor) might timeout during this process. Therefore, it is recommended to run lake build manually before starting the MCP. This ensures a faster build time and avoids timeouts.
3. Configure your IDE/Setup
OR using the setup wizard:
Ctrl+Shift+P > "MCP: Add Server..." > "Command (stdio)" > "uvx lean-lsp-mcp" > "lean-lsp" (or any name you like) > Global or Workspace
OR manually adding config by opening mcp.json with:
Ctrl+Shift+P > "MCP: Open User Configuration"
and adding the following
{
"servers": {
"lean-lsp": {
"type": "stdio",
"command": "uvx",
"args": [
"lean-lsp-mcp"
]
}
}
}If you installed VSCode on Windows and are using WSL2 as your development environment, you may need to use this config instead:
{
"servers": {
"lean-lsp": {
"type": "stdio",
"command": "wsl.exe",
"args": [
"uvx",
"lean-lsp-mcp"
]
}
}
}If that doesn't work, you can try cloning this repository and replace "lean-lsp-mcp" with "/path/to/cloned/lean-lsp-mcp".
"+ Add a new global MCP Server" > ("Create File")
Paste the server config into
mcp.jsonfile:
{
"mcpServers": {
"lean-lsp": {
"command": "uvx",
"args": ["lean-lsp-mcp"]
}
}
}# Local-scoped MCP server
claude mcp add lean-lsp uvx lean-lsp-mcp
# OR project-scoped MCP server
# (creates or updates a .mcp.json file in the current directory)
claude mcp add lean-lsp -s project uvx lean-lsp-mcpYou can find more details about MCP server configuration for Claude Code here.
Edit
~/.vibe/config.toml.Paste the following into the file (e.g. at the end):
[[mcp_servers]]
name = "lean-lsp"
transport = "stdio"
command = "uvx"
args = ["lean-lsp-mcp"]
tool_timeout_sec = 600If there are no existing MCP servers, you may have to remove mcp_servers = [].
4. Install ripgrep (optional but recommended)
For the local search tool lean_local_search, install ripgrep (rg) and make sure it is available in your PATH.
5. Install the Lean 4 skill (optional but recommended)
With any agentic coding platform such as Claude Code or Codex, you can install the Agentic Coding Skill: Lean 4 Theorem Proving. This skill provides additional prompts and templates for interacting with Lean 4 projects, including guidance on using lean-lsp-mcp.
MCP Tools
List of available tools
See Tools documentation for the full list of available tools.
Disabling Tools
Many clients allow the user to disable specific tools manually (e.g. lean_build).
VSCode: Click on the Wrench/Screwdriver icon in the chat.
Cursor: In "Cursor Settings" > "MCP" click on the name of a tool to disable it (strikethrough).
You can also disable tools at server startup:
LEAN_MCP_DISABLED_TOOLS: Comma-separated tool names (for examplelean_run_code,lean_build).LEAN_MCP_INSTRUCTIONS: Replacement server instructions string.LEAN_MCP_TOOL_DESCRIPTIONS: JSON object to override tool descriptions.
Example:
export LEAN_MCP_DISABLED_TOOLS="lean_run_code,lean_build"
export LEAN_MCP_INSTRUCTIONS="Prefer lean_local_search before remote search tools."
export LEAN_MCP_TOOL_DESCRIPTIONS='{"lean_goal":"Primary proof-state inspection tool."}'MCP Configuration
This MCP server works out-of-the-box without any configuration. However, a few optional settings are available.
Environment Variables
LEAN_LOG_LEVEL: Log level for the server. Options are "INFO", "WARNING", "ERROR", "NONE". Defaults to "INFO".LEAN_LOG_FILE_CONFIG: Config file path for logging, with priority overLEAN_LOG_LEVEL. If not set, logs are printed to stdout.LEAN_PROJECT_PATH: Path to your Lean project root. A valid Lean project root must containlean-toolchainand eitherlakefile.leanorlakefile.toml. Relativefile_patharguments resolve against this root. This variable is required forstreamable-httpandsse.LEAN_MCP_DISABLED_TOOLS: Comma-separated list of tool names to remove from MCP tool listing.LEAN_MCP_INSTRUCTIONS: Replacement server instructions string.LEAN_MCP_TOOL_DESCRIPTIONS: JSON object mapping tool names to replacement descriptions.LEAN_MCP_SCRATCH_SLOTS: Number of parallel scratch documents used for snippet trials. Defaults to1; increase it only when parallel attempts are worth the additional Lean process memory.LEAN_REPL: Set totrue,1, oryesto enable fast REPL-basedlean_run_codeand line-basedlean_multi_attempt(see REPL Setup).LEAN_REPL_PATH: Path to thereplbinary. Auto-detected from.lake/packages/repl/or.lake/packages/REPL/if not set.LEAN_REPL_TIMEOUT: Per-command timeout in seconds (default: 60).LEAN_REPL_MEM_MB: Max memory per REPL in MB (default: 16384). Only enforced on Linux/macOS.LEAN_LSP_MCP_TOKEN: Secret token for bearer authentication when usingstreamable-httporssetransport. If set, bearer auth is required for every request.LEAN_BUILD_CONCURRENCY: Build concurrency mode forlean_build. Options:allow(default),cancel,share.LEAN_STATE_SEARCH_URL: URL for a self-hosted premise-search.com instance. Rate limits are skipped when set to a custom backend.LEAN_HAMMER_URL: URL for a self-hosted Lean Hammer Premise Search instance. Rate limits are skipped when set to a custom backend.LEAN_LOOGLE_LOCAL: Set totrue,1, oryesto enable local loogle (see Local Loogle section).LEAN_LOOGLE_CACHE_DIR: Override the cache directory for local loogle (default:~/.cache/lean-lsp-mcp/loogle).LOOGLE_URL: URL for a self-hosted Loogle instance (default:https://loogle.lean-lang.org). Rate limits are skipped when set to a custom backend.LOOGLE_HEADERS: JSON object of extra HTTP headers for Loogle requests (e.g.'{"X-API-Key": "..."}').
You can also often set these environment variables in your MCP client configuration:
{
"servers": {
"lean-lsp": {
"type": "stdio",
"command": "uvx",
"args": [
"lean-lsp-mcp"
],
"env": {
"LEAN_PROJECT_PATH": "/path/to/your/lean/project",
"LEAN_LOG_LEVEL": "NONE"
}
}
}
}Transport Methods
The Lean LSP MCP server supports the following transport methods:
stdio: Standard input/output (default)streamable-http: HTTP streamingsse: Server-sent events (MCP legacy, usestreamable-httpif possible)
stdio supports project inference and switching as you move between Lean projects. streamable-http and sse are single-project deployments: they require LEAN_PROJECT_PATH at startup and reject tool-driven project switching.
You can specify the transport method using the --transport argument when running the server. For sse and streamable-http you can also optionally specify the host and port:
uvx lean-lsp-mcp --transport stdio # Default transport
uvx lean-lsp-mcp --transport streamable-http # Available at http://127.0.0.1:8000/mcp
uvx lean-lsp-mcp --transport sse --host localhost --port 12345 # Available at http://localhost:12345/sse
uvx lean-lsp-mcp --version # Print the installed versionOpenAI Secure MCP Tunnel
For ChatGPT, Codex, Responses API, or other OpenAI surfaces, use OpenAI Secure MCP Tunnel instead of exposing lean-lsp-mcp to the public internet. Create a tunnel in Platform tunnel settings, then run tunnel-client on a host that can reach your Lean project:
export CONTROL_PLANE_API_KEY="sk-..."
tunnel-client init \
--sample sample_mcp_stdio_local \
--profile lean-lsp-local \
--tunnel-id tunnel_0123456789abcdef0123456789abcdef \
--mcp-command "uvx lean-lsp-mcp --transport stdio --lean-project-path /path/to/lean/project"
tunnel-client doctor --profile lean-lsp-local --explain
tunnel-client run --profile lean-lsp-localUse --lean-project-path so relative file_path arguments resolve inside the intended Lean project. For HTTP, bind lean-lsp-mcp to loopback and use --mcp-server-url http://127.0.0.1:8000/mcp in the tunnel profile:
export LEAN_PROJECT_PATH="/path/to/lean/project"
uvx lean-lsp-mcp --transport streamable-http --host 127.0.0.1 --port 8000Keep tunnel-client run healthy while testing connector discovery or tool calls. In ChatGPT connector settings, choose Tunnel as the connection type.
Bearer Token Authentication
Transport via streamable-http and sse supports bearer token authentication. For private OpenAI access, prefer OpenAI Secure MCP Tunnel; bearer auth remains available for HTTP/SSE deployments that clients reach directly.
Set the LEAN_LSP_MCP_TOKEN environment variable (or see section 3 for setting env variables in MCP config) to a secret token before starting the server. If this variable is set, requests without a matching Authorization: Bearer ... header are rejected before tool dispatch.
Example Linux/MacOS setup:
export LEAN_LSP_MCP_TOKEN="your_secret_token"
uvx lean-lsp-mcp --transport streamable-httpClients should then include the token in the Authorization header.
REPL Setup
Enable fast REPL-based lean_run_code and line-based lean_multi_attempt. Uses leanprover-community/repl tactic mode. Exact column-based attempts still use the LSP path.
1. Add REPL to your Lean project's lakefile.toml:
[[require]]
name = "repl"
git = "https://github.com/leanprover-community/repl"
rev = "v4.25.0" # Match your Lean version2. Build it:
lake build repl3. Enable via CLI or environment variable:
uvx lean-lsp-mcp --repl
# Or via environment variable
export LEAN_REPL=trueThe REPL binary is auto-detected from .lake/packages/repl/ or
.lake/packages/REPL/. Falls back to LSP if not found.
Path Policy
File-based tools only operate on files inside the active Lean project, resolved .lake/packages/* dependencies, and the Lean stdlib source tree. Returned file paths are sanitized to avoid leaking host absolute paths:
Project files are returned relative to the project root, for example
src/MyFile.lean.Dependency files are returned under
.lake/packages/<package>/....Stdlib files are returned under
.lean-stdlib/....
Symlink escapes outside those roots are rejected.
Local Loogle
Run Loogle locally to avoid the remote API's rate limit (3 req/30s). The binary is built once for the project's Lean toolchain. The first Mathlib index takes a few minutes; subsequent starts load it in seconds.
# Enable via CLI
uvx lean-lsp-mcp --loogle-local
# Or via environment variable
export LEAN_LOOGLE_LOCAL=trueRequirements: git, lake (elan), a built Mathlib project, and substantial memory for indexing. In measurements on current Mathlib, the initial index used ~13 GiB peak RSS and a warm load used ~7 GiB.
Note: Local loogle is currently only supported on Unix systems (Linux/macOS). Windows users should use WSL or the remote API.
Mathlib comes from your project: --lean-project-path must point at a built project that depends on Mathlib. The local binary is compiled for that project's Lean toolchain and runs through lake env, so Lake supplies the project's own dependency environment. Loogle's native dependency hash detects changed .olean files and rebuilds a stale index automatically.
Falls back to remote API if local loogle fails.
Notes on MCP Security
There are many valid security concerns with the Model Context Protocol (MCP) in general!
This MCP server is meant as a research tool and is currently in beta. While it does not handle any sensitive data such as passwords or API keys, it still includes various security risks:
Access to your local file system.
Powerful local build and analysis capabilities.
External network access for remote search tools unless disabled by the operator.
Please be aware of these risks. Feel free to audit the code and report security issues!
Containerized setup (recommended for stricter isolation)
Build image:
docker build -t lean-lsp-mcp:containerized .Run with a mounted project root (read-only source + writable Lake cache):
docker run --rm -i \
-v "$PWD":/workspace:ro \
-v lean-lsp-mcp-lake-cache:/workspace/.lake \
lean-lsp-mcp:containerizedThe included Docker image defaults to:
LEAN_PROJECT_PATH=/workspaceLEAN_MCP_DISABLED_TOOLS=lean_run_code
Notes:
LEAN_MCP_DISABLED_TOOLSis a startup default and can be overridden bydocker run -e.Using
--network nonecan break tools that require network access (leansearch,loogle,leanfinder,state_search,hammer_premise) and dependency downloads.The entrypoint exits immediately if
LEAN_PROJECT_PATHdoes not exist.
For more information, you can use Awesome MCP Security as a starting point.
Development
See Adding a new tool for a step-by-step guide to implementing a new MCP tool (return models, helper modules, registration, tests, and docs).
MCP Inspector
npx @modelcontextprotocol/inspector uvx --with-editable path/to/lean-lsp-mcp python -m lean_lsp_mcp.serverRun Tests
uv sync --all-extras
uv run pytest testsPublications and Formalization Projects using lean-lsp-mcp
Ax-Prover: A Deep Reasoning Agentic Framework for Theorem Proving in Mathematics and Quantum Physics arxiv
Numina-Lean-Agent: An Open and General Agentic Reasoning System for Formal Mathematics arxiv github
MerLean: An Agentic Framework for Autoformalization in Quantum Computation arxiv
M2F: Automated Formalization of Mathematical Literature at Scale arxiv
A Group-Theoretic Approach to Shannon Capacity of Graphs and a Limit Theorem from Lattice Packings github
Talks
lean-lsp-mcp: Tools for agentic interaction with Lean (Lean Together 2026) youtube
Related Projects
License & Citation
MIT licensed. See LICENSE for more information.
Citing this repository is highly appreciated but not required by the license.
@software{lean-lsp-mcp,
author = {Oliver Dressler},
title = {{Lean LSP MCP: Tools for agentic interaction with the Lean theorem prover}},
url = {https://github.com/oOo0oOo/lean-lsp-mcp},
month = {3},
year = {2025}
}Available Tools
23 toolslean_buildADestructiveIdempotent
Build the Lean project and restart LSP. Use only if needed (e.g. new imports).
| Name | Required | Description | Default |
|---|---|---|---|
| clean | No | Run lake clean first (slow) | |
| fetch_cache | No | Run lake exe cache get before building (slow) | |
| output_lines | No | Return last N lines of build log (0=none) | |
| lean_project_path | No | Path to Lean project |
Output Schema
| Name | Required | Description |
|---|---|---|
| errors | No | Build errors if any |
| output | Yes | Build output |
| success | Yes | Whether build succeeded |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide destructiveHint=true and idempotentHint=true. The description adds 'restart LSP' as a behavioral detail. There is no contradiction, and the description adds moderate context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise: two sentences that front-load the purpose and usage guidance. No wasted words, every part adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (implied) and annotations cover key traits, the description adequately covers the tool's role. It lacks details about failure modes or logs but is sufficient for a tool meant for occasional use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents each parameter. The description does not add additional semantics beyond what is in the schema, earning a baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: building the Lean project and restarting LSP. This distinguishes it from sibling tools which are inspection or analysis tools (e.g., lean_hover_info, lean_goal), as building is a distinct action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes 'Use only if needed (e.g. new imports)', providing context for when to use. However, it does not explicitly mention when not to use or suggest alternatives, which is acceptable given the specialized nature.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_code_actionsARead-onlyIdempotent
Get LSP code actions for a line. Returns resolved edits for TryThis suggestions (simp?, exact?, apply?) and other quick fixes.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| file_path | Yes | Absolute path to Lean file |
Output Schema
| Name | Required | Description |
|---|---|---|
| actions | No | List of available code actions |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true and idempotentHint=true, matching the read-only nature. Description adds specifics about returning resolved edits for TryThis suggestions, which goes beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences that front-load the purpose. Every word earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given output schema exists, description sufficiently covers what the tool returns. Mentions specific types of suggestions. Could elaborate on return format but still adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers both parameters with descriptions (100% coverage). Description does not add any extra detail beyond what schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'Get', resource 'LSP code actions for a line', and specifies it returns resolved edits for TryThis suggestions and other quick fixes. Distinct from siblings like lean_build, lean_completions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage context is implicit: it returns code actions for a line. No explicit when-to-use/when-not-to-use or alternative tools mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_completionsARead-onlyIdempotent
Get IDE autocompletions. Use on INCOMPLETE code (after . or partial name).
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | Yes | Column number (1-indexed characters) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| max_completions | No | Max completions | |
| resolve_details | No | Fetch type signatures for the top N results |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of completion items |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, indicating safe, idempotent behavior. The description adds the usage constraint (incomplete code), which is a behavioral nuance beyond the annotations. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loading the purpose and then providing a usage hint. Every word earns its place; no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the existence of an output schema and annotations, the description adequately covers the core functionality. It could optionally mention that completions are context-dependent on the file state, but it is otherwise sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% with clear parameter descriptions. The tool description does not add additional meaning beyond what the schema already provides. Baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves IDE autocompletions, specifying it should be used on incomplete code after a dot or partial name. This verb+resource+scope is 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.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use the tool ('on INCOMPLETE code (after `.` or partial name)'), providing clear context. It does not explicitly mention when not to use or list alternatives, but the sibling tool set makes differentiation implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_declaration_fileARead-onlyIdempotent
Get the source of a symbol's declaration (declaration slice + context).
Set full_file=True for the whole file (can be very large).| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Symbol (case sensitive, must be in file) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| full_file | No | Return the entire declaration file (large!) | |
| context_lines | No | Lines of context around the declaration |
Output Schema
| Name | Required | Description |
|---|---|---|
| content | Yes | Declaration source (sliced unless full_file=True) |
| end_line | No | Last line of the returned slice (1-indexed) |
| file_path | Yes | Path to declaration file |
| start_line | No | First line of the returned slice (1-indexed) |
| total_lines | No | Total lines in the declaration file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint. The description adds that full_file returns the entire file and can be very large, which is useful behavioral context. However, it does not mention error cases (e.g., symbol not found) or performance implications beyond size.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the core purpose, and the second sentence addresses a key option. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given an output schema exists, the description does not need to detail return values. It adequately covers the main functionality and the key parameter option. Could mention the output format briefly, but not necessary.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all 4 parameters. The description adds minimal extra meaning beyond the schema, only reinforcing the size warning for full_file. Baseline 3 is appropriate as schema handles most semantic load.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves the source of a symbol's declaration, specifying 'declaration slice + context'. This distinctively separates it from sibling tools like lean_hover_info or lean_goal, which serve different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly suggests using full_file for whole file context but does not explicitly guide when to prefer this tool over siblings like lean_file_outline or lean_hover_info. No when-not-to-use or alternative references are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_diagnostic_messagesBRead-onlyIdempotent
Get compiler diagnostics (errors, warnings, infos) for a Lean file.
| Name | Required | Description | Default |
|---|---|---|---|
| end_line | No | Filter to line | |
| severity | No | Filter by severity level. Returns all levels when omitted. | |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| timeout_s | No | Max seconds to wait for elaboration. On timeout returns partial=true with still_elaborating_lines - poll again. Omit to wait for full elaboration. | |
| start_line | No | Filter from line | |
| interactive | No | Returns verbose nested TaggedText with embedded widgets. Only use when plain text is insufficient. For 'Try This' suggestions, prefer lean_code_actions. | |
| declaration_name | No | Filter to declaration (slow) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations declare readOnlyHint=true and idempotentHint=true, which align with the read-only nature of fetching diagnostics. The description adds minimal extra behavior (listing error/warning/info types) but does not mention timeout/partial result behavior, which is described in the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One concise sentence, no redundant information. Front-loaded with the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While the schema fully documents parameters and output schema exists, the tool has 7 parameters and several behavioral nuances (timeout partial results, interactive widgets). The description is limited to a one-line summary and doesn't mention these capabilities or direct users to lean_code_actions for 'Try This' suggestions, so it's adequate but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 100% description coverage for all 7 parameters, so the baseline is 3. The description itself does not add any parameter semantics beyond the schema, such as the filtering options (severity, line range, declaration_name).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Get compiler diagnostics (errors, warnings, infos) for a Lean file' — a clear verb+resource. It does not explicitly distinguish from sibling tools like lean_build or lean_verify, so it scores 4 rather than 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided about when to use this tool versus alternatives. There is no mention of filtering by severity or line, or that 'Try This' suggestions should use lean_code_actions, which appears both in the schema and sibling list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_file_outlineARead-onlyIdempotent
Get imports and declarations with type signatures. Token-efficient.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| max_declarations | No | Max declarations to return |
Output Schema
| Name | Required | Description |
|---|---|---|
| imports | No | Import statements |
| declarations | No | Top-level declarations |
| total_declarations | No | Total count (set when truncated) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, which cover key behavioral traits. The description adds 'token-efficient', which provides additional context about the output format, but does not disclose any other behaviors like required permissions or side effects. Given the annotations, this is adequate but not exceptional.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of two terse sentences (7 words total) that front-load the key action and a performance hint. Every word serves a purpose, with no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, full parameter descriptions in the schema, comprehensive annotations, and the presence of an output schema, the description provides sufficient context for invocation. It could be slightly more explicit about the output structure, but that is handled by the output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the input schema already documents both parameters thoroughly. The description adds no new parameter-specific information beyond the schema's descriptions, earning the baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns imports and declarations with type signatures, which directly matches the name 'file_outline'. It distinguishes from siblings like 'lean_declaration_file' which focuses on a single declaration, and 'lean_hover_info' which provides information on specific locations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, limitations, or when not to use it, leaving the agent to infer usage from the name and purpose alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_get_widgetsARead-onlyIdempotent
Get panel widgets at a position (proof visualizations, #html, custom widgets). Returns raw widget data - may be large.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | Yes | Column number (1-indexed) | |
| file_path | Yes | Absolute path to Lean file |
Output Schema
| Name | Required | Description |
|---|---|---|
| widgets | No | Widget instances (id, name, range, props) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint, making the tool's safety profile clear. The description adds extra value by warning that 'data may be large', which is important behavioral context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the main purpose, and a second sentence providing a critical warning. No unnecessary words or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (handling return format), 100% parameter coverage, and the description providing examples and a size warning, the description is complete for a simple retrieval tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema itself documents all three parameters. The description adds no additional meaning to the parameters, thus baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves panel widgets at a position, listing examples (proof visualizations, #html, custom widgets). It distinguishes from sibling lean_get_widget_source by noting it returns raw widget data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use (need panel widgets at a position) but does not explicitly mention when not to use or list alternatives. With many sibling tools, explicit exclusions would be helpful, but the context is still clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_get_widget_sourceARead-onlyIdempotent
Get JavaScript source of a widget by hash. Useful for understanding custom widget rendering logic. Returns full JS module - may be large.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to Lean file | |
| javascript_hash | Yes | javascriptHash from a widget instance |
Output Schema
| Name | Required | Description |
|---|---|---|
| source | Yes | Widget source data including JavaScript module |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, so safe read. Description adds that 'Returns full JS module - may be large', warning about size, going beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded key action, no redundant words. Each sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers purpose, usage, and size warning. Output schema exists so return values not needed. Could mention dependency on lean_get_widgets for hash, but not required.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% description coverage with clear parameter descriptions. The tool description adds no extra meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states verb 'Get', resource 'JavaScript source of a widget', and method 'by hash'. Distinguishes from siblings like lean_get_widgets which likely returns widget instances.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly mentions 'Useful for understanding custom widget rendering logic', providing when to use. No explicit when-not or alternatives, but context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_goalARead-onlyIdempotent
Get proof goals at a position. MOST IMPORTANT tool - use often!
Omit column to see goals_before (line start) and goals_after (line end),
showing how the tactic transforms the state. status='complete' means the
proof is finished at this point; status='no_goal_at_position' means the
position carries no proof state (e.g. outside a proof).
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | No | Column (1-indexed). Omit for before/after | |
| format | No | Output format: 'text' (default) or 'structured' | text |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| timeout_s | No | Max seconds to wait for elaboration. On timeout returns status='still_elaborating' - poll again. |
Output Schema
| Name | Required | Description |
|---|---|---|
| goals | No | Goal list at specified column position |
| status | No | Goal status: 'goals' (open goals), 'complete' (no goals left - proof finished here), 'no_goal_at_position' (position carries no proof state), or 'still_elaborating' (timeout_s hit - poll again) |
| goals_after | No | Goals at line end (when column omitted) |
| goals_before | No | Goals at line start (when column omitted) |
| line_context | Yes | Source line where goals were queried |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint and idempotentHint, and the description adds crucial behavior: column omission reveals before/after states, timeout handling with 'still_elaborating' status, and possible statuses. No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences plus a status explanation. Front-loaded with 'MOST IMPORTANT tool - use often!' which is slightly verbose but adds emphasis. No extraneous information; each sentence serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a proof goal tool with 5 parameters and an output schema (not shown), the description adequately covers behavior, status outcomes, and column handling. No missing critical information for using the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions. The description adds value by explaining the effect of omitting column (goals_before/goals_after) and the meaning of format enum options, which go beyond the schema's parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Get proof goals at a position' with a specific verb and resource. It also labels itself as the 'MOST IMPORTANT tool', distinguishing it from siblings like lean_term_goal, lean_state_search, etc., which query different aspects.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to omit column for before/after views, and defines status values like 'complete' and 'no_goal_at_position'. It does not explicitly list when to use this vs. other tools, but the context of proof goals and the 'most important' emphasis provides implicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_hammer_premiseARead-onlyIdempotent
Limit: 6req/30s. Get premise suggestions for automation tactics at a goal position.
Returns lemma names to try with `simp only [...]`, `aesop`, or as hints.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | Yes | Column number (1-indexed) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| num_results | No | Max results |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of premise results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint, openWorldHint, and idempotentHint. The description adds a rate limit (6req/30s) and specifies the return format (lemma names). No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences plus a rate limit. The purpose is front-loaded, every word adds value, and there is no verbosity. Ideal conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the 4 parameters, full annotation coverage, and presence of an output schema (implied), the description covers purpose, return type, and rate limit. It lacks examples but is adequate for a straightforward suggestion tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all 4 parameters. The description adds minimal value beyond the schema, only linking line/column to 'goal position'. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it provides premise suggestions for automation tactics at a goal position, listing specific uses like `simp only [...]`, `aesop`, or hints. This distinguishes it from sibling tools like lean_leansearch or lean_loogle, which are general search tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for getting premise suggestions during automated proof attempts, but does not explicitly state when to use this tool versus alternatives like lean_leansearch or lean_loogle. The rate limit is mentioned but not a usage guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_hover_infoARead-onlyIdempotent
Get type signature and docs for a symbol. Essential for understanding APIs.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | Yes | Column at START of identifier (1-indexed characters) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file |
Output Schema
| Name | Required | Description |
|---|---|---|
| info | Yes | Type signature and documentation |
| symbol | Yes | The symbol being hovered |
| diagnostics | No | Diagnostics at this position |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and openWorldHint. The description adds no further behavioral context (e.g., fails gracefully, requires valid file path). It does not contradict annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence followed by a supporting statement. Every word earns its place, providing clear value without extraneous detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that the tool has an output schema (not needing output description), and the annotations and parameter descriptions are rich, the description is complete enough. It could mention that the symbol must be resolvable at that position, but not strictly necessary.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for all 3 parameters, so baseline is 3. The description does not add additional meaning or usage tips beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Get type signature and docs for a symbol', identifying a specific verb and resource. It distinguishes from numerous sibling tools by focusing on a hover action for symbol information, not code actions or goals.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes 'Essential for understanding APIs', hinting at when to use, but lacks explicit guidance on when not to use or how it compares to alternatives like lean_goal or lean_term_goal.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_leanfinderARead-onlyIdempotent
Limit: 10req/30s. Semantic search by mathematical meaning via Lean Finder.
Examples: "commutativity of addition on natural numbers",
"I have h : n < m and need n + 1 < m + 1", proof state text.
The `version` argument selects which mathlib snapshot to query
(v4.19.0, v4.24.0, or v4.28.0). Default: v4.28.0.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Mathematical concept or proof state | |
| version | No | Mathlib version index to search | v4.28.0 |
| num_results | No | Max results |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of Lean Finder results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond annotations (readOnly, openWorld, idempotent), description adds rate limit, version behavior (default and options), and that it performs semantic search. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: two short paragraphs with rate limit, purpose, examples, and parameter explanation. No wasted sentences, information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, description covers purpose, usage constraints, parameter details, and examples. Output schema exists, so return values are covered. No gaps for an agent to select or invoke this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so minimal extra needed. Description adds example queries for the 'query' parameter and explains version options, but adds no new semantic info for 'num_results'. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'semantic search by mathematical meaning via Lean Finder' with examples. Purpose is specific and distinguishable from siblings, but does not explicitly differentiate from similar tools like lean_leansearch or lean_state_search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides rate limit (10req/30s) and examples of queries, implying usage for semantic search. However, no explicit guidance on when to use this tool versus alternatives among the many sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_leansearchARead-onlyIdempotent
Limit: 90req/30s. Search Mathlib via leansearch.net using natural language.
Examples: "sum of two even numbers is even", "Cauchy-Schwarz inequality",
"{f : A → B} (hf : Injective f) : ∃ g, LeftInverse g f"
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language or Lean term query | |
| num_results | No | Max results |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of LeanSearch results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Adds rate limit information beyond annotations (readOnlyHint, idempotentHint, openWorldHint). No contradictions. However, does not describe response behavior or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Very concise, front-loaded with rate limit, then purpose, then examples. Every sentence adds value with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple search tool with output schema, the description covers purpose, parameters, examples, and rate limit. No gaps given the context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%. Description provides example queries for the 'query' parameter, adding practical meaning. No additional detail for 'num_results' but schema is clear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Explicitly states it searches Mathlib via leansearch.net using natural language. Provides concrete examples distinguishing it from sibling search tools like lean_loogle or lean_local_search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Mentions rate limit (90req/30s) but does not clarify when to use this tool vs alternatives like lean_leanfinder or lean_loogle. No explicit exclusions or selection criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_local_searchARead-onlyIdempotent
Fast local search to verify declarations exist. Use BEFORE trying a lemma name.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max matches | |
| query | Yes | Declaration name or prefix | |
| project_root | No | Project root (inferred if omitted) |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of local search results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true and idempotentHint=true, so the agent knows it's safe. The description adds 'Fast local search,' conveying performance characteristics, and clarifies the tool's purpose (verifying existence), which complements the annotations without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no wasted words. The first sentence conveys purpose and key characteristic (fast). The second provides a usage hint. Every sentence is substantive and earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple nature of the tool (declaration search), the description fully covers what it does and when to use it. Annotations cover safety, and the existence of an output schema means return values need not be described. The description is complete for an agent to decide and invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the schema already documents each parameter adequately. The description adds overall context that the query is a declaration name or prefix, but no parameter-specific details beyond what the schema provides. Thus a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Fast local search to verify declarations exist.' This is a specific verb (search/verify) and resource (declarations). It distinguishes from sibling tools like lean_leansearch (global search) and lean_loogle (broader search) by emphasizing local and verification-focused purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The instruction 'Use BEFORE trying a lemma name' provides explicit context for when to invoke this tool. While it doesn't list alternatives or specify when not to use, the guidance is clear and actionable, differentiating it from other search tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_loogleARead-onlyIdempotent
Search Mathlib by type signature via loogle.lean-lang.org.
Examples: `Real.sin`, `"comm"`, `(?a → ?b) → List ?a → List ?b`,
`_ * (_ ^ _)`, `|- _ < _ → _ + 1 < _ + 1`
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Type pattern, constant, or name substring | |
| num_results | No | Max results |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of Loogle results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=true, which cover the tool's behavioral safety and consistency. The description adds no new behavioral traits beyond stating it searches via an external source (loogle.lean-lang.org), which is consistent with the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: two sentences of purpose and one line of examples. Every part earns its place. The purpose is front-loaded, and the examples are directly helpful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (search by type signature), the presence of an output schema (not shown but confirmed), and comprehensive annotations, the description is complete. It explains the source, provides examples, and does not need to detail return values.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds value by providing concrete examples of valid query strings, which go beyond the schema's generic description ('Type pattern, constant, or name substring'). The num_results parameter is briefly described in the schema but not elaborated in the description, which is fine given its simplicity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Search Mathlib by type signature via loogle.lean-lang.org.' This is a specific verb+resource combination that distinguishes it from sibling tools like lean_leansearch (general search) or lean_leanfinder (name search). Examples further clarify the scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides concrete examples of valid queries (e.g., `Real.sin`, `?a → ?b → List ?a → List ?b`), which strongly imply when to use this tool—namely for type-based or pattern-based searches. However, it does not explicitly state when not to use it or name alternatives among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_minimal_hypothesesARead-onlyIdempotent
For each explicit (h : T) hypothesis of a theorem, drop it and re-elaborate
a scratch copy of the file. Reports which hypotheses are load-bearing and which
are actually unused. Skips implicit {x : α} and instance [inst : C] binders
(those are usually inferable / always load-bearing). Does not rewrite the proof
body — a body that names h will fail to elaborate without the binder, which
is the truthful answer (load-bearing).
Variants are checked in parallel on scratch documents; the file is never edited.| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to Lean file | |
| theorem_name | Yes | Theorem name. Either bare (e.g. `add_comm`) or fully qualified (e.g. `Namespace.add_comm`); only the trailing segment is used for source matching. | |
| inactivity_timeout | No | Per-hypothesis elaboration timeout (seconds) |
Output Schema
| Name | Required | Description |
|---|---|---|
| file | Yes | Relative file path |
| verdicts | No | One verdict per explicit (h : T) binder, in source order |
| theorem_name | Yes | Theorem analyzed |
| skipped_implicit | No | Count of implicit {x : α} / instance [inst] binders not probed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds significant behavioral context: that it creates scratch copies, works in parallel, does not edit the file, and that naming a hypothesis will cause elaboration failure if dropped. This is valuable beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short paragraphs, front-loaded with the core action. Each sentence provides necessary detail (skipping certain binders, behavior of named hypothesis, parallel/scratch nature). No fluff; every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (hypothesis testing, parallel elaboration), the description fully explains the mechanism, scope, and non-destructive nature. The presence of an output schema means output format details are not needed in the description. The tool is well-specified for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Since schema description coverage is 100% (all parameters described in schema), the baseline is 3. The description adds the per-hypothesis timeout context for the inactivity_timeout parameter, slightly increasing clarity. No param info is missing, but the description does not elaborate on file_path or theorem_name beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool drops each explicit hypothesis of a theorem and re-elaborates to determine which are load-bearing. It distinguishes itself by skipping implicit and instance binders, and explicitly says it does not rewrite the proof body. This precise verb+resource description differentiates it from siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains what the tool does and what it skips (implicit/instance binders), but does not explicitly provide when-to-use or when-not-to-use guidance relative to sibling tools. The context is clear enough for an agent to infer usage, but lacks explicit exclusions or alternative suggestions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_multi_attemptARead-onlyIdempotent
Try multiple tactics without modifying file. Returns goal state for each.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | No | Column (1-indexed). Omit to target the tactic line | |
| snippets | Yes | Tactics to try (3+ recommended) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of attempt results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint=true and idempotentHint=true. The description adds that it returns goal state for each tactic, which is beyond the annotations. It also confirms no file modification. This is good transparency, though it could mention that the tool runs tactics without side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, focused sentence: 'Try multiple tactics without modifying file. Returns goal state for each.' It is front-loaded with the core action, no superfluous words. Perfectly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (4 params, output schema, annotations), the description covers the essential purpose and behavior. It might briefly note that results correspond to snippet order. But overall, it is sufficiently complete with minimal gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with adequate descriptions for each parameter. The description mentions 'tactics' and 'goal state', but adds little beyond the schema. The schema already notes '3+ recommended' for snippets, which is not in the description. Baseline 3 is appropriate as schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Try multiple tactics without modifying file. Returns goal state for each.' It specifies the verb ('try'), the resource ('tactics'), and the result ('goal state'). Among siblings, it uniquely offers multi-tactic trial without file modification, distinguishing it from lean_goal (single goal) and lean_run_code (execution).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for trying multiple tactics read-only, but lacks explicit guidance on when to use versus alternatives. It doesn't state when not to use it, e.g., if a single tactic is needed or if file modification is desired. However, the context of siblings provides some differentiation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_profile_proofARead-onlyIdempotent
Run lean --profile on a theorem. Returns per-line timing and categories. SLOW - avoid on theorems that already hit heartbeat limits.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line where theorem starts (1-indexed) | |
| top_n | No | Number of slowest lines to return | |
| timeout | No | Max seconds to wait | |
| file_path | Yes | Absolute or project-root-relative path to Lean file |
Output Schema
| Name | Required | Description |
|---|---|---|
| ms | Yes | Total elaboration time in ms |
| lines | No | Time per source line (>1% of total) |
| categories | No | Cumulative time by category in ms |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true and idempotentHint=true. The description adds value by disclosing performance characteristics ('SLOW') and the specific output (per-line timing and categories). No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no extraneous information. It front-loads the core functionality and adds a critical performance warning, earning its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema and annotations, the description covers the essential aspects: purpose, output, and a usage constraint. It could be more explicit about alternative tools, but overall it is sufficiently complete for an informed agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so each parameter is already documented. The description does not add additional meaning beyond the schema; e.g., it does not explain the relationship between parameters or provide usage examples. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Run `lean --profile` on a theorem') and the output ('Returns per-line timing and categories'). It distinguishes from sibling tools like lean_build or lean_verify by specifying profiling behavior.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly warns against using the tool on theorems that already hit heartbeat limits ('SLOW - avoid...'), providing a clear when-not-to-use condition. However, it does not explicitly mention when to use this tool over alternatives like lean_verify or lean_state_search.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_referencesARead-onlyIdempotent
Find all references to a symbol (including the declaration). Position cursor at the symbol.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | Yes | Column at START of identifier (1-indexed) | |
| file_path | Yes | Absolute path to Lean file | |
| max_results | No | Max locations to return (default 50) |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of reference locations |
| total | No | Total matches (> len(items) when truncated by max_results) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint. The description adds that it includes the declaration, which is a behavioral detail beyond annotations. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, clear, no fluff. Every word is necessary and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, return values are covered. The description explains the core function and a key prerequisite. Could mention that it returns locations including declaration, but overall adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description does not add any additional meaning beyond the schema; it only mentions cursor positioning which relates to line/column but not in detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Find' with a clear resource 'all references to a symbol', explicitly includes 'including the declaration', and distinguishes from siblings like hover or goal tools by mentioning cursor positioning.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives a condition ('Position cursor at the symbol') but does not explicitly state when to use this tool versus alternatives like lean_local_search or lean_loogle, leaving the differentiation implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_run_codeARead-onlyIdempotent
Run a code snippet and return diagnostics. Must include all imports.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Self-contained Lean code with imports |
Output Schema
| Name | Required | Description |
|---|---|---|
| success | Yes | Whether code compiled successfully |
| timed_out | No | True if elaboration timed out (results are partial) |
| diagnostics | No | Compiler diagnostics |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint, idempotentHint, and openWorldHint, which already indicate safe, idempotent behavior. The description adds that the tool returns diagnostics, but does not elaborate on side effects (none expected), error handling, or output format. It adds marginal transparency beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, each purposeful. First sentence states primary action and result; second sentence gives a critical requirement. No wasted words. Information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and an output schema (not shown but exists), the description covers the essential purpose and constraint. It does not explain what 'diagnostics' entails or the environment context, but the output schema likely covers return details. The description is adequate for straightforward use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with one parameter described as 'Self-contained Lean code with imports'. The description reiterates the requirement to include all imports, reinforcing the schema's meaning. This adds clarity but does not introduce new semantic detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool runs code and returns diagnostics. It uses 'Run a code snippet' as verb+resource, which is specific. However, it does not explicitly distinguish from sibling tools like lean_build or lean_verify, but the context of running a snippet rather than building a project is implied.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. It only states a requirement ('Must include all imports'), but does not mention implicit context, prerequisites, or when not to use. Sibling tools like lean_build or lean_verify are not compared.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_state_searchBRead-onlyIdempotent
Limit: 6req/30s. Find lemmas to close the goal at a position. Searches premise-search.com.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | Yes | Column number (1-indexed) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| num_results | No | Max results |
Output Schema
| Name | Required | Description |
|---|---|---|
| items | No | List of state search results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, openWorld, and idempotent. The description adds a rate limit (6req/30s) and the external dependency (premise-search.com), providing some behavioral context. However, no details on error handling or result variability.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two brief sentences, front-loading a critical rate limit. Every word is necessary, and the structure is efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Core functionality and a rate limit are covered, but the description does not explain the output format, how to interpret results, or what happens when no lemmas are found. Given the existence of an output schema, some gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description does not add extra meaning beyond the schema; parameter details are already in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it finds lemmas to close a goal at a given position, which is specific and distinguishes it from many siblings. However, it does not explicitly contrast with other search tools like lean_leansearch 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.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool over alternatives. It implies usage when lemmas are needed to close a goal, but does not specify exclusions or preferred contexts.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_term_goalBRead-onlyIdempotent
Get the expected type at a position.
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number (1-indexed) | |
| column | No | Column (defaults to end of line) | |
| file_path | Yes | Absolute or project-root-relative path to Lean file |
Output Schema
| Name | Required | Description |
|---|---|---|
| line_context | Yes | Source line where term goal was queried |
| expected_type | No | Expected type at this position |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only and idempotent behavior. The description adds minimal context beyond that (e.g., 'expected type' vs full goal). No contradictions, but little extra value.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise single sentence with no wasted words. Information is front-loaded and easily parsed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While annotations and output schema exist, the description is minimal. It does not explain what the returned 'expected type' looks like or how it relates to the position, leaving some ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so parameters are already documented. The description does not add any extra meaning or context about parameters, but given coverage, baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves the expected type at a given position, using a specific verb and resource. However, it does not differentiate itself from the sibling tool 'lean_goal', which likely has a similar purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'lean_goal'. The description lacks context on scenarios or limitations, leaving the agent to guess.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lean_verifyARead-onlyIdempotent
Check theorem axioms + optional source scan. Only scans the given file, not imports.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to Lean file | |
| scan_source | No | Scan source file for suspicious patterns | |
| theorem_name | Yes | Fully qualified name (e.g. `Namespace.theorem`) |
Output Schema
| Name | Required | Description |
|---|---|---|
| axioms | No | Axioms used. Standard 3: propext, Classical.choice, Quot.sound |
| warnings | No | Suspicious source patterns (if enabled) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true and idempotentHint=true, so the description's mention of file scanning scope complements but doesn't significantly exceed what the annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences, the first stating the main purpose and the second adding a key constraint. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema and annotations, the description sufficiently covers the tool's operation. The file scope constraint is a critical detail that is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so parameters are fully documented. The description adds minimal extra semantics about file scope but doesn't elaborate on parameter formats or constraints beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool checks theorem axioms and optionally scans source files. It distinguishes itself by noting it only scans the given file, not imports, which differentiates it from siblings like lean_build.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly suggests when to use (for verification of a specific theorem) and explicitly notes the scope constraint. However, it doesn't mention when not to use or suggest alternatives like lean_build for full projects.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
All 23 tools have clearly distinct purposes with no significant overlap. Search tools (leanfinder, leansearch, loogle, state_search) are differentiated by query type (semantic, natural language, type signature, premise), and tools like lean_goal vs lean_term_goal serve different roles (proof state vs expected type).
All tools follow the 'lean_' prefix with descriptive snake_case names. The pattern is uniformly applied: verb_noun (e.g., run_code, get_widgets) or noun_phrase (e.g., file_outline, goal). Minor naming variations (lean_leanfinder, lean_leansearch) are still consistent with the overall scheme.
23 tools is slightly above the typical range but justified by the complexity of the Lean theorem prover domain. Each tool serves a specific need (building, tactics, searching, diagnostics), and none are redundant. The count feels complete without being overwhelming.
The tool set covers the full lifecycle of Lean development: building, writing (completions, code actions), information (hover, declaration, references, diagnostics), proving (goals, term goals, multi_attempt, hammer), searching (four distinct search tools), verification, profiling, and analysis (minimal hypotheses). No obvious gaps for an LSP interface.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Search, read and create Linear issues, projects, teams and cycles.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables LLMs to prove theorems in Lean and formalize mathematical problems using the Aristotle API, supporting both formal Lean code and natural language problem submissions.61
- AlicenseBqualityDmaintenanceExposes TypeScript Language Server Protocol functionality to AI agents, enabling them to query types at specific positions, find definitions and references, get diagnostics, run type tests, and type-check inline code just like in an IDE.91463MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with language-aware code analysis through the Language Server Protocol, enabling tasks like getting code insights and diagnostics.16191MIT
- AlicenseBqualityDmaintenanceMCP server for agentic interaction with the Lean theorem prover via LSP, providing tools for understanding, analyzing, and interacting with Lean projects.2121MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/oOo0oOo/lean-lsp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server