Skip to main content
Glama

Find smart contract events

portal_evm_query_logs
Read-only

Retrieve EVM event logs filtered by contract address, topic signature, or common event name, with optional inline decoding and earliest/latest scanning for targeted lookups.

Instructions

Query raw EVM logs with address/topic filters, common event aliases, earliest/latest scanning, and optional inline decoding.

COMMON USER ASKS:

  • Recent USDC Transfer logs

  • First recent USDC Transfer log

  • Latest ERC721/pass mint ID and tx hash

FIRST CHOICE FOR:

  • NFT or ERC721 mint lookups such as latest pass minted, token ID, and mint transaction hash

  • contract event questions where the user needs exact event evidence rather than wallet or transaction summaries

WHEN TO USE:

  • You need event logs filtered by contract or topic signature.

  • You want decoded log hints while still keeping the raw log shape available.

  • You want the first or last matching event in a bounded block/time window.

  • You want common event names such as transfer, approval, swap, mint, or burn instead of remembering topic0 hashes.

  • You need the latest ERC721/pass mint in a bounded deployment/recent window: filter Transfer events with topic1 as the zero address, use scan_order=latest, limit=1, and decode=true to expose decoded_log.decoded.token_id plus transaction_hash.

DON'T USE:

  • You only want token transfers, which are easier with the token-transfer tool.

EXAMPLES:

  • Recent USDC Transfer logs: {"network":"base-mainnet","timeframe":"1h","token_symbols":["USDC"],"event":"transfer","limit":20}

  • First recent USDC Transfer log: {"network":"base-mainnet","timeframe":"1h","token_symbols":["USDC"],"event":"transfer","scan_order":"earliest","limit":1}

  • Latest ERC721/pass mint ID and tx hash: {"network":"base-mainnet","from_block":46020000,"to_block":46100000,"addresses":["0xE4E70FdF2Fc1147a7f35c4c5de88E6BeA63eeAfA"],"event":"transfer","topic1":["0x0000000000000000000000000000000000000000000000000000000000000000"],"scan_order":"latest","decode":true,"include_transaction":true,"limit":1}

  • Decode logs inline: {"network":"ethereum-mainnet","timeframe":"1h","topic0":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],"decode":true,"limit":10}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventNoCommon event alias or topic0 hash. Examples: "transfer", "approval", "swap", "sync", "deposit", "withdrawal". Merges with topic0.
limitNoMax logs to return (default: 20, max: 200). Note: Lower default for MCP to reduce context usage.
cursorNoContinuation cursor from a previous response
decodeNoDecode known log signatures inline when topics/data are available
topic0NoEvent signatures (topic0). E.g., Transfer = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
topic1NoTopic1 filter (often: from address in Transfer, indexed parameter 1)
topic2NoTopic2 filter (often: to address in Transfer, indexed parameter 2)
topic3NoTopic3 filter (indexed parameter 3, chain-specific)
networkNoNetwork name or alias. Optional when continuing with cursor.
to_blockNoEnding block number. RECOMMENDED: <10k blocks for fast (<1s) responses. Larger ranges may be slow or timeout.
addressesNoContract addresses to filter (e.g., ['0xUSDC...', '0xDAI...']). IMPORTANT: Always include this or topics for fast queries.
timeframeNoNatural time range such as '5m', '1h', '24h', '7d', or 'past 30 minutes'. Alternative to from_block/to_block.
from_blockNoStarting block number (use this OR timeframe)
scan_orderNoWhich side of the block window to scan first. Use earliest for first-event questions.latest
field_presetNoField preset: 'minimal' (address+topic0+block, ~80% smaller), 'standard' (all topics+timestamp), 'full' (includes raw data hex, largest). Use 'minimal' to reduce context usage.standard
to_timestampNoEnding timestamp. Accepts Unix seconds, Unix milliseconds, ISO datetime, or relative input like "now".
token_symbolsNoToken symbols to resolve via open token-list data and merge into addresses, e.g. ["USDC"].
finalized_onlyNoOnly query finalized blocks
from_timestampNoStarting timestamp. Accepts Unix seconds, Unix milliseconds, ISO datetime, or relative input like "1h ago".
max_scan_blocksNoMaximum blocks to inspect for bounded earliest/latest scans. Sparse latest searches default to 25,000 blocks to stay within MCP request timeouts; raise only when deeper coverage is worth the added latency.
response_formatNoResponse format: defaults to 'compact' for chat-friendly output, or stays 'full' when inline transaction context is requested. Use 'summary' for counting or categorizing.
include_transactionNoInclude parent transaction data
include_transaction_logsNoInclude all logs from parent transactions
max_token_symbol_matchesNoMaximum token-list matches to include per token symbol. Use addresses for deterministic single-contract filters.
include_transaction_tracesNoInclude traces for parent transactions

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
_uiNoOptional chart, table, and follow-up presentation metadata.
_llmNoHints that help an AI client locate the primary evidence.
_metaNoNetwork, block range, timing, and row-count metadata.
errorNoStructured failure details when the tool cannot complete the request.
itemsNoPrimary result rows when the tool returns a list.
valueNoPrimary result when the tool returns a scalar value.
answerNoConcise answer grounded in the returned blockchain data.
_noticeNoImportant limitation or truncation notice.
displayNoPlain-language labels for presenting the result.
_noticesNoImportant limitations or truncation notices.
_summaryNoHuman-readable summary of the result.
_coverageNoCompleteness of the requested window and result set.
_evidenceNoReplayable arguments, exact-data digest, row count, and completeness receipt.
_orderingNoOrdering guarantees for the returned data.
_executionNoBounded execution and scan details.
_freshnessNoFreshness and finality information for the returned data.
next_stepsNoSafe follow-up actions and continuation guidance.
_paginationNoPagination state and an optional continuation cursor.
investigationNoEvidence paths, useful pivots, and result limitations.
pipes_handoffNoOptional SQD Pipes guidance for custom data needs.
_tool_contractNoTool identity, intent, and supported blockchain families.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.8.3
    • addedOutput schema / properties / _evidence
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Replayable arguments, exact-data digest, row count, and completeness receipt.",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  2. Changed9 schema fields changedv0.8.2
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / from_timestamp / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / from_timestamp / type
      Removed value: -[
      -  "number",
      -  "string"
      -]
    • addedInput schema / properties / max_scan_blocks
      Added value: +{
      +  "description": "Maximum blocks to inspect for bounded earliest/latest scans. Sparse latest searches default to 25,000 blocks to stay within MCP request timeouts; raise only when deeper coverage is worth the added latency.",
      +  "maximum": 250000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / timeframe / description
      Previous value: -"Time range (e.g., '24h', '7d'). Alternative to from_block/to_block. Supported: 1h, 6h, 12h, 24h, 3d, 7d, 14d, 30d"New value: +"Natural time range such as '5m', '1h', '24h', '7d', or 'past 30 minutes'. Alternative to from_block/to_block."
    • addedInput schema / properties / to_timestamp / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / to_timestamp / type
      Removed value: -[
      -  "number",
      -  "string"
      -]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "_coverage": {
      +      "description": "Completeness of the requested window and result set."
      +    },
      +    "_execution": {
      +      "additionalProperties": {},
      +      "description": "Bounded execution and scan details.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "_freshness": {
      +      "description": "Freshness and finality information for the returned data."
      +    },
      +    "_llm": {
      +      "description": "Hints that help an AI client locate the primary evidence."
      +    },
      +    "_meta": {
      +      "additionalProperties": {},
      +      "description": "Network, block range, timing, and row-count metadata.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "_notice": {
      +      "description": "Important limitation or truncation notice.",
      +      "type": "string"
      +    },
      +    "_notices": {
      +      "description": "Important limitations or truncation notices.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "_ordering": {
      +      "description": "Ordering guarantees for the returned data."
      +    },
      +    "_pagination": {
      +      "additionalProperties": {},
      +      "description": "Pagination state and an optional continuation cursor.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "_summary": {
      +      "description": "Human-readable summary of the result.",
      +      "type": "string"
      +    },
      +    "_tool_contract": {
      +      "additionalProperties": {},
      +      "description": "Tool identity, intent, and supported blockchain families.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "_ui": {
      +      "description": "Optional chart, table, and follow-up presentation metadata."
      +    },
      +    "answer": {
      +      "description": "Concise answer grounded in the returned blockchain data.",
      +      "type": "string"
      +    },
      +    "display": {
      +      "additionalProperties": {},
      +      "description": "Plain-language labels for presenting the result.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "error": {
      +      "additionalProperties": {},
      +      "description": "Structured failure details when the tool cannot complete the request.",
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "origin": {
      +          "type": "string"
      +        },
      +        "retry_after_ms": {
      +          "type": "number"
      +        },
      +        "retryable": {
      +          "type": "boolean"
      +        },
      +        "suggestions": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "summary": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "code",
      +        "origin",
      +        "summary",
      +        "retryable",
      +        "suggestions"
      +      ],
      +      "type": "object"
      +    },
      +    "investigation": {
      +      "additionalProperties": {},
      +      "description": "Evidence paths, useful pivots, and result limitations.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "items": {
      +      "description": "Primary result rows when the tool returns a list.",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "next_steps": {
      +      "additionalProperties": {},
      +      "description": "Safe follow-up actions and continuation guidance.",
      +      "properties": {
      +        "actions": {
      +          "items": {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "continuation": {
      +          "additionalProperties": {},
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        "custom_data": {
      +          "additionalProperties": {},
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "actions"
      +      ],
      +      "type": "object"
      +    },
      +    "pipes_handoff": {
      +      "description": "Optional SQD Pipes guidance for custom data needs."
      +    },
      +    "value": {
      +      "description": "Primary result when the tool returns a scalar value."
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observedv0.7.9

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true, and destructiveHint=false. The description adds meaningful behavioral context not carried by annotations: performance caveats for ranges >10k blocks, sparse scan defaults of 25,000 blocks to respect MCP timeouts, context-size effects of field_preset='minimal', and response_format defaulting to 'compact'. No contradiction with annotations.

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?

The description is long but well-organized with clear headers (COMMON USER ASKS, FIRST CHOICE FOR, WHEN TO USE, DON'T USE, EXAMPLES) and a front-loaded summary sentence. There is some overlap between FIRST CHOICE FOR and WHEN TO USE, but each section contributes distinct selection or invocation guidance, earning its place.

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?

For a 25-parameter tool with 0 required parameters and an existing output schema, the description covers selection criteria, alternatives, examples, performance caveats, pagination/context usage hints, and decode behavior. The description plus schema and output schema leave no significant gap an agent needs to invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds concrete parameter combinations in EXAMPLES (scan_order='latest', limit=1, decode=true, include_transaction=true) and explains non-obvious behavior for max_scan_blocks, field_preset, and response_format that supplements the schema descriptions. This exceeds the baseline.

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?

The description opens with a specific verb+resource: 'Query raw EVM logs with address/topic filters, common event aliases, earliest/latest scanning, and optional inline decoding.' It clearly differentiates from siblings by explicitly stating token transfers are better handled by the token-transfer tool.

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

Usage Guidelines5/5

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

WHEN TO USE lists five concrete conditions (filtered event logs, decoded log hints, first/last matching event, common event names, latest ERC721/pass mints). DON'T USE names the exact alternative tool (token-transfer) and the condition that should route an agent away, making selection unambiguous.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/subsquid-labs/portal-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server