Skip to main content
Glama
mcp-server-hyperledger-fabric

mcp-server-hyperledger-fabric

by rene-dekart

Invoke chaincode (submit, writes state)

invoke_chaincode
Destructive

Submit a chaincode transaction to change ledger state on a Fabric channel, returning the transaction ID and commit status. Verify with get_transaction before retrying after a commit-status timeout.

Instructions

Submit a chaincode transaction that changes state. Returns transaction ID and commit status. Use only when a state change is intended. A commit-status timeout does NOT mean the transaction failed — it may still commit; check get_transaction before retrying.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "channel": "<channel>",
      "chaincode": "<chaincode>",
      "method": "<method>"
    },
    "name": "invoke_chaincode"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoString args; JSON-encode objects
methodYesChaincode function, e.g. GetAsset
channelYesFabric channel name
contractNoContract name within chaincode (optional)
chaincodeYesChaincode name
transientDataNoPrivate data, not recorded on the ledger

Output Schema

NameRequiredDescriptionDefault
noteNo
statusNoCommit status name, e.g. VALID
successfulNo
blockNumberNo
deduplicatedNo
transactionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructive=true, idempotent=false and openWorldHint, so the safety profile is covered. The description adds the genuinely valuable operational fact that a commit-status timeout does not mean failure and retrying is dangerous — context not derivable from annotations. Return values are only summarized because an output schema exists.

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?

Three short sentences, front-loaded with the purpose, then the failure-mode caveat. No restatement of the name or schema, and every sentence changes how the agent behaves.

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?

For a destructive, non-idempotent, open-world tool with an output schema, the description covers the highest-risk ambiguity (timeout vs. failure) and the intent gate. Minor gaps remain — no mention of authorization needs or how transient/private data behaves — but nothing essential to a correct call is missing.

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 description coverage is 100%, including notes on JSON-encoding args and transient data being off-ledger, so the schema carries parameter meaning. The description adds nothing about individual parameters, which is the expected baseline when coverage is complete.

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?

States a specific verb ('Submit'), resource ('chaincode transaction') and effect ('changes state'), which implicitly separates it from the read-only query sibling. The agent knows this is a write path without opening any schema.

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?

Gives an explicit gate: 'Use only when a state change is intended,' and names get_transaction as the follow-up when commit status times out. It does not name query_chaincode or endorse_chaincode as the read/dry-run alternatives, so routing to those is left to the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.