Skip to main content
Glama

midnight_deploy_contract

Deploy compiled Compact smart contracts to the Midnight Network, handling private state initialization, proof generation, and transaction submission.

Instructions

Deploy a compiled Compact smart contract to the Midnight Network.

Prerequisites:

  1. Contract must be compiled first using midnight_compile_contract

  2. Wallet with sufficient tDUST balance for deployment

  3. Network connectivity to target environment

Deployment Process:

  1. Load compiled contract artifacts

  2. Initialize contract private state (if any)

  3. Create deployment transaction

  4. Generate ZK proof for deployment

  5. Submit transaction to the network

  6. Wait for confirmation

Returns:

  • Contract address

  • Transaction hash

  • Block height

  • Deployment cost

Security: Use MIDNIGHT_WALLET_SEED environment variable for wallet credentials.

Testnet Faucet: Get free tDUST at https://faucet.testnet.midnight.network

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contract_nameNoName of the contract to deploy
compiled_pathNo
initial_stateNo
networkNoTarget network for deployment
wallet_seedNo
gas_limitNo
dry_runNoSimulate deployment without submitting transaction
Behavior4/5

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

The description details the deployment steps (load, initialize, create tx, generate proof, submit, wait), mentions security via environment variable, and lists return fields. It also hints at a dry-run capability through the parameter, but doesn't disclose potential costs or side effects.

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 with clear sections (Prerequisites, Deployment Process, Returns, Security). It is informative without excessive verbosity, though the inclusion of the testnet faucet link is slightly tangential.

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 seven parameters and no output schema, the description provides a solid overview including prerequisites, steps, and return fields. However, it lacks details on error handling, parameter validation, and return value types or examples, which would enhance completeness.

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?

With only 43% schema description coverage, the description adds context by explaining the deployment process and mentions parameters like compiled_path and initial_state indirectly. However, it does not explicitly describe all seven parameters or clarify their formats, leaving gaps for parameters like gas_limit and wallet_seed.

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 'Deploy a compiled Compact smart contract to the Midnight Network', providing a specific verb and resource. It effectively distinguishes from sibling tools like midnight_compile_contract (compilation) and midnight_call_contract (contract interaction).

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 lists prerequisites, including prior compilation via midnight_compile_contract, and outlines the deployment process. However, it doesn't explicitly state scenarios where this tool should not be used or suggest alternatives for other operations like contract interaction.

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