Skip to main content
Glama

Get Logs

get_logs
Read-onlyIdempotent

Search event logs by contract address and/or topics over a block range. Topics are 32-byte hex values; topic0 is usually the keccak256 event-signature hash. Adjacent-topic operators (and/or) combine multiple topic filters. Provide 'address' and/or at least one topic.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage number (1-based). Default 1. page x offset must be at most 10000; narrow the block range to see more.
offsetNoRecords per page (max 1000). Default 100.
topic0NoTopic 0 — usually the keccak256 event-signature hash.
topic1NoTopic 1 (first indexed argument).
topic2NoTopic 2 (second indexed argument).
topic3NoTopic 3 (third indexed argument).
addressNoContract address to filter by (optional if filtering by topics).
chainidNoNumeric chain id (e.g. 1=Ethereum, 56=BNB, 137=Polygon). If omitted, defaults to Ethereum Mainnet (1).
toblockNoEnd block number, or "latest". Default latest.
fromblockNoStart block number, or "latest". Default 0.
topic0_1_oprNoCombine topic0 and topic1: and | or.
topic1_2_oprNoCombine topic1 and topic2: and | or.
topic2_3_oprNoCombine topic2 and topic3: and | or.

Output Schema

NameRequiredDescriptionDefault
dataYesThe JSON result returned by the Etherscan data tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed22 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / chainid / description
      Previous value: -"Numeric chain id (e.g. 1=Ethereum, 56=BNB, 137=Polygon). Defaults to server config."New value: +"Numeric chain id (e.g. 1=Ethereum, 56=BNB, 137=Polygon). If omitted, defaults to Ethereum Mainnet (1)."
    • changedInput schema / properties / offset / description
      Previous value: -"Records per page (max 1000)."New value: +"Records per page (max 1000). Default 100."
    • changedInput schema / properties / page / description
      Previous value: -"Page number (1-based)."New value: +"Page number (1-based). Default 1. page x offset must be at most 10000; narrow the block range to see more."
    • removedInput schema / properties / toblock / $ref
      Removed value: -"#/properties/fromblock"
    • addedInput schema / properties / toblock / anyOf
      Added value: +[
      +  {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  {
      +    "const": "latest",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / topic1 / $ref
      Removed value: -"#/properties/topic0"
    • addedInput schema / properties / topic1 / pattern
      Added value: +"^0x[a-fA-F0-9]{64}$"
    • addedInput schema / properties / topic1 / type
      Added value: +"string"
    • removedInput schema / properties / topic1_2_opr / $ref
      Removed value: -"#/properties/topic0_1_opr"
    • addedInput schema / properties / topic1_2_opr / enum
      Added value: +[
      +  "and",
      +  "or"
      +]
    • addedInput schema / properties / topic1_2_opr / type
      Added value: +"string"
    • removedInput schema / properties / topic2 / $ref
      Removed value: -"#/properties/topic0"
    • addedInput schema / properties / topic2 / pattern
      Added value: +"^0x[a-fA-F0-9]{64}$"
    • addedInput schema / properties / topic2 / type
      Added value: +"string"
    • removedInput schema / properties / topic2_3_opr / $ref
      Removed value: -"#/properties/topic0_1_opr"
    • addedInput schema / properties / topic2_3_opr / enum
      Added value: +[
      +  "and",
      +  "or"
      +]
    • addedInput schema / properties / topic2_3_opr / type
      Added value: +"string"
    • removedInput schema / properties / topic3 / $ref
      Removed value: -"#/properties/topic0"
    • addedInput schema / properties / topic3 / pattern
      Added value: +"^0x[a-fA-F0-9]{64}$"
    • addedInput schema / properties / topic3 / type
      Added value: +"string"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "type": "object"
      +        },
      +        {
      +          "items": {},
      +          "type": "array"
      +        },
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The JSON result returned by the Etherscan data tool."
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds genuinely useful semantics about how topic filtering works (keccak256 signature hash for topic0, adjacent-topic and/or operators), which an agent cannot infer from the annotations alone. It does not mention rate limits or result-size behavior, keeping it short of a 5.

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?

Three tight sentences, front-loaded with the core action and ending on the invocation constraint. Minor redundancy: 'Topics are 32-byte hex values' duplicates the regex pattern and format note already in the schema.

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?

With 13 parameters, rich annotations, and an output schema handling return values, the description covers exactly what is missing from structured fields: the filtering model and the operator semantics. Pagination limits, chain defaults, and block defaults are all handled in the schema, so nothing an agent needs to call this correctly is absent.

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%, so every one of the 13 parameters is already documented, including topic0's keccak256 meaning — which the description largely restates. The only added meaning is the explanation of how the adjacent-topic operators combine filters, which is marginal beyond the schema's per-field descriptions.

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?

States a specific verb ('Search') and resource ('event logs') plus the three scoping dimensions: address, topics, and block range. It is clearly a log-query tool rather than a transaction or receipt fetch, though it never names the closest siblings (e.g. get_transaction_receipt) to sharpen the distinction.

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?

The final sentence gives a hard requirement ('Provide address and/or at least one topic'), which is useful invocation guidance. However, there is no when-to-use/when-not-to-use framing against alternatives, and no advice on narrowing block ranges versus paging when results are large.

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