Skip to main content
Glama
oce-math-mcp

oce-math-mcp

by oce-projects

lean_check

Checks Lean 4 proofs with Mathlib for compilation errors, unsolved sorry, and nonstandard axioms, rejecting executable code, new axioms, and native_decide within 60 seconds.

Instructions

Check a formal proof in Lean 4 with Mathlib. Returns whether it compiles without errors, without sorry and with only the standard axioms, with Lean messages. Code that runs programs (#eval, run_cmd, elab, macro), new axioms and native_decide are rejected. 60 s limit.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "lean_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesLean 4 source, max 20000 characters. 'import Mathlib' is added if no import is present.
allow_sorryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does well on the return contract (compile status, sorry check, axiom check, Lean messages) and discloses the 60 s limit and hard rejections. It does not address whether the tool is expensive or rate-limited, nor how the sorry policy interacts with the allow_sorry parameter.

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?

Three tight sentences, front-loaded with purpose and success criteria, then restrictions, then the time limit. No filler or redundant restatement of the tool name.

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?

With no output schema and no annotations, the description does the heavy lifting: it explains the return values, the validation rules, and the runtime cap. The only meaningful gap is the undocumented allow_sorry toggle and its effect on the stated sorry check.

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 50%: 'code' is documented in the schema, 'allow_sorry' is not documented anywhere. The description's phrase 'without sorry' hints at the sorry policy but never explains what allow_sorry=true actually relaxes, leaving one required behavior-bearing flag unexplained.

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

Purpose4/5

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

States a specific verb and resource: 'Check a formal proof in Lean 4 with Mathlib', and even names the success criteria (compiles, no sorry, standard axioms). The resource is narrow enough that an agent can separate it from math_eval or python_sandbox, though no sibling is named explicitly.

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

Usage Guidelines3/5

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

There is no explicit when-to-use versus alternatives guidance, and no mention of math_verify or python_sandbox as fallbacks. However, the rejection list (program-running code, new axioms, native_decide) effectively tells the agent which inputs this tool will not accept, which is partial usage guidance.

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