Skip to main content
Glama

midnight-extract-contract-structure

Read-onlyIdempotent

Extract and analyze Compact contract structure to detect syntax errors, deprecated patterns, and structural issues before generation.

Instructions

Extract and analyze Compact contract structure (circuits, witnesses, ledger). CRITICAL CHECKS: deprecated 'ledger { }' block syntax, 'Void' return type (should be []), old pragma format, unexported enums, deprecated Cell wrapper. Also detects: module-level const, stdlib name collisions, division operator, Counter.value access, missing disclose() calls, potential overflow. Use BEFORE generating contracts to catch syntax errors. Note: Static analysis only - catches common patterns but not semantic errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoThe Compact contract source code to analyze (provide this OR filePath)
filePathNoPath to a .compact file to analyze (alternative to providing code directly)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNo
filenameNo
languageVersionNo
importsNo
structureNo
exportsNoNames of all exported items
statsNoCounts of each type of definition
potentialIssuesNoCommon issues detected by static analysis
summaryNo
messageNo
Behavior4/5

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: it performs static analysis only, catches common patterns but not semantic errors, and lists specific checks and limitations. 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.

Conciseness4/5

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

The description is well-structured, starting with the main purpose, then critical checks, additional checks, usage guidance, and a note. It is front-loaded and every sentence adds value, though it could be slightly more concise.

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 output schema exists, the description does not need to explain return values. It covers the tool's purpose, checks, limitations, and usage context. Error behavior is not addressed, but overall it is comprehensive for a static analysis tool.

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% with both parameters described. The description does not add new meaning beyond the schema; it repeats the OR relationship. With high schema coverage, baseline 3 is appropriate.

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 clearly states the tool extracts and analyzes Compact contract structure with specific checks listed. It uses a specific verb and resource, but there is a sibling 'midnight-analyze-contract' that could overlap, and the description does not explicitly differentiate from it.

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 description advises using the tool before generating contracts to catch syntax errors, providing when-to-use guidance. However, it does not mention when not to use or explicitly compare to alternative tools, such as 'midnight-analyze-contract' or compile tools.

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/Olanetsoft/midnight-mcp'

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