Skip to main content
Glama

Extract

lean_extract
Read-onlyIdempotent

Extracts declarations and dependency edges from a Lean project via Lean itself to reveal project structure and dependencies.

Instructions

GET /extract: list declarations and dependency edges of a project, read by Lean itself.

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": {
      "project_dir": "<project_dir>"
    },
    "name": "lean_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
buildNo
project_dirYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

The annotations already state readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint, so the safety profile is covered elsewhere. The description adds "read by Lean itself," which is genuinely useful because it tells the agent that a real Lean process runs behind the call, which can be slow or fail. It does not say what happens when Lean fails or whether the "build" flag is expensive.

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

Conciseness4/5

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

It is one short sentence with no padding, but the "GET /extract" prefix is a transport detail that takes the front-loaded position without adding comprehension. It is terse to the point of being cryptic rather than cleanly structured.

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

Completeness2/5

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

An output schema exists, so return values need no explanation. Still, a required project_dir with zero schema description and an undocumented build toggle are real gaps for a tool the agent must invoke correctly on the first attempt. A sentence on path expectations and on what build=true does would close them.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must explain both parameters, and it explains neither. "of a project" vaguely hints at project_dir but gives no path format or constraint. The build boolean (default true) is not mentioned at all, so the agent cannot judge the cost of leaving it on.

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

Purpose4/5

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

The description names a concrete verb and resource: it lists "declarations and dependency edges of a project." That is far more specific than the tool name or title ("Extract"), which on their own say nothing. It does not, however, distinguish the tool from its sibling lean_check or indicate how the two differ.

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?

The phrase "GET /extract" implies a read-only retrieval operation, which is the only usage signal. The description never says when to call this instead of lean_check, or what precondition the caller needs (for example, that the project must already be built).

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

Deploy Server

Other Tools