Skip to main content
Glama

create_htlc

Record the on-chain HTLC lock transaction hash to advance atomic settlement for delivery vs payment, ensuring both parties receive assets or get refunded.

Instructions

Trustless atomic settlement — delivery vs payment (DVP) guarantee. Both sides receive their asset OR both get refunded; zero counterparty risk, zero slippage, no custodian. Records the on-chain HTLC lock tx hash to advance the settlement state machine.

USE WHEN: a trade is accepted and the user has just broadcast the lock transaction on-chain (EVM, Bitcoin, or Sui). DO NOT USE WHEN: the trade is not yet accepted, or the lock tx has not been broadcast yet — submit the on-chain tx first, then call this tool.

PARAM NOTES: role must be INITIATOR (you locked first) or COUNTERPARTY (you locked in response). txHash must be 0x-prefixed. chainType defaults to evm — set "bitcoin" or "sui" for non-EVM legs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tradeIdYesTrade ID from an accepted trade
txHashYesOn-chain transaction hash of the HTLC lock (0x-prefixed)
roleYesYour role in the trade
timelockNoHTLC expiry as Unix timestamp
hashlockNoSHA-256 hashlock (0x-prefixed hex)
chainTypeNoChain type: evm, bitcoin, or sui
preimageNoSecret preimage (only for initiator)
client_request_idNoIdempotency key. Retrying the SAME write with the SAME id within this MCP session returns the first result instead of triggering a second on-chain/backend side effect. Best-effort: not durable across MCP restarts.
Behavior3/5

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

No annotations provided. Description mentions idempotency via client_request_id but does not detail side effects, error states, or what happens on failure. The tool's impact on state machine is implied but not fully explained.

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?

Concise and well-structured: main purpose, usage guidance, then parameter notes. No redundant information, each sentence adds value.

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?

No output schema. Description explains purpose and param notes but lacks details on return value, error handling, or how this tool fits into the overall trade lifecycle. Could be more complete for a complex settlement tool.

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

Parameters4/5

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

Schema coverage is 100%, baseline 3. Description adds value with notes on role requirements, txHash format, and chainType defaults, clarifying usage beyond schema definitions.

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?

Description clearly states the tool's purpose: recording the on-chain HTLC lock tx hash to advance settlement, with DVP guarantee. Differentiates from siblings like refund_htlc and withdraw_htlc by focusing on the lock step.

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?

Explicit USE WHEN and DO NOT USE WHEN conditions, specifying the prerequisite (trade accepted, lock tx broadcast). Provides clear context for correct invocation.

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/Hashlock-Tech/hashlock-mcp'

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