Skip to main content
Glama

batch_create_contracts

Create up to 50 Mode B escrow contracts in one wallet transaction, locking payments for multiple workers and reducing network fees.

Instructions

Create up to 50 Mode B escrow contracts in ONE wallet transaction.

This is swarm payroll: an orchestrator agent that has split work across many worker agents locks payment for all of them at once, privately. One transaction, one network fee, every child contract created Open. Each worker then commits collateral to their own contract and the normal Mode B lifecycle (deliver, review, approve or dispute, claim) runs per contract from there.

All contracts in the batch are created by this wallet as the requester. The wallet must hold the SUM of all payments plus one network fee. Batch creation is Mode B only, and specs cannot carry required_collateral or spec_hash; create those contracts individually with create_contract_b.

Each spec is an object with these fields: job_id (int, required): unique ID you choose, unused on chain, and not repeated inside the batch. worker_pubkey (str, required): that worker's pubkey for this contract (from their get_key). payment (int, required): payment in groth (1 BEAM = 100,000,000). asset_id (int, required): 0 for BEAM, 47 for NPH. expiry_block (int, required): future block height. After it the requester can refund and an undelivered worker forfeits collateral to the treasury. current + 10000 is roughly 7 days. dispute_fee (int, required): locked if the requester disputes; it pays the voting arbitrators win or lose. review_window_blocks (int, optional, default 0): approval window after delivery. 0 uses the contract default. subnet_id (int, optional, default 1). epoch (int, optional, default 1).

Args: specs: List of 1 to 50 spec objects as described above.

Returns a summary of the created contracts, or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden and discloses key behaviors: one transaction, one network fee, wallet must hold the sum plus fee, contracts are created Open, and the normal Mode B lifecycle follows. Field semantics like expiry_block and dispute_fee are also explained. However, it does not state whether batch creation is atomic or how partial failures are handled, which is a notable omission.

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?

The description is front-loaded with the core purpose, followed by context, constraints, and a structured field list. Every sentence adds necessary information, and the bullet-like layout improves readability. There is no filler or redundancy, making the length appropriate for the tool's complexity.

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

Completeness5/5

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

For a tool with a bare-bones schema and no annotations, this description covers the essential context: purpose, usage scenarios, constraints (Mode B only, field restrictions), detailed parameter semantics, and even return value. It provides sufficient information for an agent to invoke the tool correctly despite the complexity of batch creation.

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

Parameters5/5

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

The input schema is minimal (only 'specs' as an empty array type, 0% description coverage), so the description must compensate. It does so thoroughly by detailing each spec field: type, required/optional status, defaults, and meaning (e.g., 'expiry_block... current + 10000 is roughly 7 days'). This fully clarifies the parameter semantics.

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 begins with a clear, specific action: 'Create up to 50 Mode B escrow contracts in ONE wallet transaction.' This distinctively identifies the tool's scope and batch nature. It further differentiates from siblings by stating 'Batch creation is Mode B only' and directing users to 'create_contract_b' for specs with required_collateral or spec_hash.

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

Usage Guidelines5/5

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

The description explicitly explains when to use the tool: 'This is swarm payroll... locks payment for all of them at once, privately.' It also provides a clear exclusion and alternative: 'specs cannot carry required_collateral or spec_hash; create those contracts individually with create_contract_b.' This gives direct actionable guidance.

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/honeytones/idios'

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