Skip to main content
Glama

Search formal math (Loogle/LeanSearch)

search_formal_math
Read-onlyIdempotent

Find mathlib theorems and definitions by natural language or pattern/type queries, returning formal Lean names and types for use in verification.

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 (though a <=7-day-old cached response for the same query is then served, clearly labeled 'cached' with its age). 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, cached?, cache_age_seconds?} — cached=true means the live service failed and these hits are the last successful response (clearly labeled)
hitsYes
noteNo
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint. Description adds honest 'service unavailable' behavior and cached response labeling with age, providing rich 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.

Conciseness5/5

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

Compact description with no wasted words. Front-loads purpose, covers caching, usage context, and parameter details efficiently.

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

Completeness5/5

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

For a tool with 3 parameters and an output schema, the description is comprehensive: explains caching, service availability, usage scenario, and all parameters. No gaps.

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

Parameters4/5

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

Schema coverage is 100%, baseline 3. Description adds value by giving example patterns for query, default for k, and explanations for backend options, exceeding schema info.

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 it finds mathlib declarations via Loogle/LeanSearch, specifying query types and services. It distinguishes itself from siblings as the 'ONE tool that itself calls the web', setting it apart clearly.

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?

Explicitly states when to use: 'when you need the formal Lean name/type of a result, e.g. before writing a verify_formal snippet'. Provides backend guidance but does not explicitly state when not to use it.

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