Skip to main content
Glama

BRAINIAC Contract Security

Compare contract bytecode

contract-security_contract-bytecode-compare

Compare two caller-supplied EVM bytecodes. mode exact compares every byte. An omitted mode is exact. mode normalized masks only the supplied immutable ranges and a trailing Solidity CBOR metadata suffix when bytecodeKind is not creation and that suffix is present on both bytecodes. comparison_status is identical, different, partially_comparable, or invalid. Hashes are keccak256 of the supplied bytes. Similarity is the share of equal compared bytes, truncated to 4 decimal places. A difference is not a judgment that either bytecode is malicious, and similar bytecode is not equivalent behavior. No source code is verified and no chain is queried. Price $0.05 USDC. POST /api/v1/contract-security/contract-bytecode-compare. 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": {
      "reference": "<reference>",
      "candidate": "<candidate>"
    },
    "name": "contract-security_contract-bytecode-compare"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo
candidateYes
referenceYes
bytecodeKindNo
immutableRangesNo
compilerMetadataNo
expectedDifferencesNo
constructorArgumentsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
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 does much of it: it discloses masking rules, the exact set of comparison_status values, the hashing function, the similarity rounding, the 'difference is not a judgment' caveat, the fact that no chain is queried, the $0.05 USDC price, the endpoint, and the 402 unpaid response. The main gap is behavioral meaning for expectedDifferences, constructorArguments, and compilerMetadata.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and dense with facts; sentences mostly earn their place. The telegraphic style ('An omitted mode is exact', 'Price $0.05 USDC.') is efficient, though the run-on normalized-mode sentence takes effort to parse.

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?

This is a complex 8-parameter tool with no output schema and no annotations, and the description still supplies return vocabulary (comparison_status values, similarity rounding), trust caveats, pricing, and failure behavior. It is complete enough to call correctly, with only the three advisory parameters under-explained.

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% across 8 parameters, so the description must compensate. It explains mode, bytecodeKind's effect on metadata masking, and immutableRanges' masking role, but leaves expectedDifferences, constructorArguments, and compilerMetadata entirely unexplained, so half the surface remains undocumented.

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?

Opens with a specific verb and resource: 'Compare two caller-supplied EVM bytecodes.' The 'caller-supplied' framing and the note that no source is verified and no chain is queried make it distinguishable from structure-oriented siblings, though it never names or contrasts the sibling explicitly.

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?

It gives conditional behavior ('An omitted mode is exact', the normalized-suffix condition) but no explicit when-to-use or when-not-to-use guidance and no routing to contract-security_bytecode-structure-diff. The mode conditions imply usage rather than state it.

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