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

mcp-server-hyperledger-fabric

by rene-dekart

Query chaincode (evaluate, read-only)

query_chaincode
Read-onlyIdempotent

Evaluate a chaincode read function on Hyperledger Fabric and return its result. Use it for reads, never for state changes.

Instructions

Evaluate a chaincode read function on Hyperledger Fabric and return its result. Use for reads, never for state changes.

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": "query_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
resultYesRaw chaincode result, decoded as UTF-8

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and openWorldHint=true, so the safety profile is fully covered by structured data. The description's "never for state changes" simply restates readOnlyHint and adds no new behavioral context such as peer/target selection, endorsement behavior, or error semantics. Consistent with annotations, but redundant rather than additive.

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?

Two short sentences, front-loaded with the action and closed with the guardrail. No filler, no restatement of the title.

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?

With a fully described schema and an output schema, the description need not explain parameters or return values, and the read-only constraint is stated. The only gap is operational context an agent might want, such as whether a peer/target must be reachable or what failure looks like, but that is minor for a read tool.

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 the notable hint that objects in args must be JSON-encoded and that transientData is not written to the ledger. The description contributes nothing about any of the six parameters, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Evaluate a chaincode read function on Hyperledger Fabric and return its result" gives a specific verb (evaluate/read) and resource (chaincode function), and the closing clause distinguishes it from write paths. It stops short of naming invoke_chaincode as the sibling to use for state changes, so the differentiation is implied rather than explicit.

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?

"Use for reads, never for state changes" is an explicit when-to-use plus an explicit exclusion, which is more than most definitions offer. It does not name the alternative tool for mutations, leaving the agent to infer that invoke_chaincode is the counterpart.

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