Skip to main content
Glama

BRAINIAC Contract Security

Diff bytecode structure

contract-security_bytecode-structure-diff

Decode two caller-supplied EVM bytecodes, or two instruction lists, into opcodes and compare the instruction sequence. Similarity ignores PUSH immediates. The risk delta counts CALL, SSTORE, CREATE, DELEGATECALL, CALLCODE, and SELFDESTRUCT. A high similarity is not proof that the contracts behave the same. No chain is queried. Price $0.04 USDC. POST /api/v1/contract-security/bytecode-structure-diff. Unpaid calls return 402 and do not run.

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": {
      "left": "<left>",
      "right": "<right>"
    },
    "name": "contract-security_bytecode-structure-diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
leftYes
rightYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does well on metric semantics (PUSH immediates ignored, risk delta counts CALL/SSTORE/CREATE/DELEGATECALL/CALLCODE/SELFDESTRUCT) and on caveats ('high similarity is not proof'), plus auth/pricing behavior (402 on unpaid calls). However, it never states what the response contains beyond the similarity notion, nor whether the operation is read-only, deterministic, or bounded in time - gaps that annotations would normally cover.

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 purpose is front-loaded in the first sentence, and each following sentence carries distinct operational information: matching rules, risk-delta opcode set, the false-confidence caveat, the no-chain-query property, and the price/endpoint/402 behavior. No sentence is redundant.

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 no output schema, no annotations, and a fairly complex anyOf input schema, the description covers input forms, comparison semantics, caveats, cost, and transport. The remaining gap is the shape of the returned result beyond the abstract notion of similarity and risk delta, which leaves an agent guessing what fields to consume.

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 0% and both parameters are required anyOf unions, so the description must carry the load. It does clarify the two accepted input forms (hex bytecode string or an ops list), which is meaningful beyond the schema, but it does not explain left/right roles, ordering, or the 200000-char / 1500-op limits encoded in the schema.

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?

The description opens with a specific verb and resources: 'Decode two caller-supplied EVM bytecodes, or two instruction lists, into opcodes and compare the instruction sequence.' An agent can immediately tell this is a structural diff, not a semantic or runtime comparison. It never names or contrasts the sibling contract-bytecode-compare, so differentiation is left to the reader.

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

Usage Guidelines3/5

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

Usage is only implied: the accepted inputs (raw bytecode or pre-decoded instruction lists) and the 'No chain is queried' note suggest when this is appropriate versus an on-chain lookup. There is no explicit statement of when to prefer this over the sibling compare tool, nor of restrictions such as max bytecode or op-list sizes.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources