Skip to main content
Glama

midnight_compile_contract

Compile Compact smart contracts into TypeScript bindings, circuit metadata, and ZK proving keys for deployment and SDK integration. Requires local compactc compiler.

Instructions

Compile a Compact smart contract to TypeScript bindings and ZK artifacts.

Generates:

  • TypeScript type definitions

  • Contract interaction code

  • Circuit metadata

  • ZK proving/verifying keys (references)

Use this tool to:

  • Compile Compact source code

  • Generate TypeScript bindings for SDK

  • Prepare contracts for deployment

Note: Full compilation requires the compactc compiler installed locally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoCompact contract source code or file path
output_dirNo
contract_nameNo
Behavior4/5

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

With no annotations, the description carries full burden. It discloses generated output types and a prerequisite ('Requires the compactc compiler installed locally'). It does not mention side effects, but for a compilation tool, destructive actions are unlikely. The description adds useful context beyond what annotations would provide.

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

Conciseness3/5

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

The description is adequately sized but has some redundancy (e.g., repeating generated items in the bullet list). It front-loads the main action but could be more streamlined. Overall, it is functional with minimal fluff.

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

Completeness3/5

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

Given the compilation complexity, the description covers key outputs and a prerequisite but omits details like error handling, overwrite behavior, and output file naming. For a tool with no output schema and minimal parameter descriptions, it is moderately complete but has gaps.

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?

Schema coverage is only 33% (only source has a description). The description does not explain output_dir or contract_name beyond the implicit context of compilation. It adds some value by stating the overall process, but does not sufficiently detail parameter usage or constraints.

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's purpose: 'Compile a Compact smart contract to TypeScript bindings and ZK artifacts.' It lists specific generated outputs and distinguishes from sibling tools like midnight_deploy_contract and midnight_analyze_contract by focusing on compilation and binding generation.

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 lists use cases: 'Use this tool to: - Compile Compact source code - Generate TypeScript bindings for SDK - Prepare contracts for deployment.' It provides clear context but does not explicitly exclude cases or mention alternative tools for similar tasks.

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/DaJo-Code/midnight-nextjs-mcp'

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