Skip to main content
Glama

Search formal math (Loogle/LeanSearch)

search_formal_math

Retrieve formal Lean names and types of math theorems by searching mathlib via pattern or natural language queries.

Instructions

Find mathlib DECLARATIONS (name + type) via the public Loogle (pattern/type queries like '?a * ?b = ?b * ?a') and LeanSearch (natural-language queries) services — the ONE tool that itself calls the web; honest 'service unavailable' if down. Use when you need the formal Lean name/type of a result, e.g. before writing a verify_formal snippet. Args: query, k (default 10), backend ('auto'|'loogle'|'leansearch').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesnatural language (leansearch) or a Loogle pattern/type query
kNomax merged hits (default 10)
backendNo'loogle' = pattern/type, 'leansearch' = natural language, 'auto' = both (default)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
backendNo
backendsNoper-service block {available, hits, error}
hitsYes
noteNo
Behavior4/5

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

With no annotations, the description carries the full disclosure burden. It reveals the tool calls external web services and honestly reports unavailability. It explains it finds name and type, but does not detail merging behavior or potential timeouts. This is sufficient for basic understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, each earning its place: purpose+method, usage guidance, parameter summary. No fluff, front-loaded with the core action. Ideal conciseness for an agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (web calls, two backends, merged results) and the presence of an output schema, the description covers main points: what it finds, how to use, when to use. It could mention default backend behavior or error handling beyond 'unavailable', but overall it is sufficient for correct tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds minor context (e.g., example Loogle query, default value for k), but does not significantly deepen parameter understanding beyond what the schema already provides. The addition of web-dependency context is helpful but not param-specific.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool finds 'mathlib DECLARATIONS (name + type)' using Loogle and LeanSearch services, with explicit examples. It distinguishes itself from siblings by being 'the ONE tool that itself calls the web' and handles unavailability honestly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use when you need the formal Lean name/type of a result, e.g. before writing a verify_formal snippet.' It also distinguishes between query types (pattern/type vs natural language) via the backend parameter. However, it does not explicitly state when not to use or differentiate from siblings beyond the web-calling claim.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Archerkattri/mathlas'

If you have feedback or need assistance with the MCP directory API, please join our Discord server