Skip to main content
Glama

provider_get_logs

Extract blockchain logs using a customizable filter for specific addresses, topics, and block ranges, enhancing transaction and event monitoring on EVM-compatible networks.

Instructions

Get logs that match a filter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterYesThe filter to apply

Implementation Reference

  • The main handler function that implements the logic for the 'provider_get_logs' tool by calling provider.getLogs with the provided filter.
    export const getLogsHandler = async (input: any): Promise<ToolResultSchema> => {
      try {
        if (!input.filter) {
          return createErrorResponse("Filter is required");
        }
    
        const provider = getProvider();
        if (!provider) {
          return createErrorResponse("Provider is required to get logs, please set the provider URL");
        }
        const logs = await provider.getLogs(input.filter);
    
        return createSuccessResponse(
        `Logs retrieved successfully
          Logs: ${logs}
        `);
      } catch (error) {
        return createErrorResponse(`Failed to get logs: ${(error as Error).message}`);
      }
    };
  • The input schema definition for the 'provider_get_logs' tool, specifying the required filter object.
    {
      name: "provider_get_logs",
      description: "Get logs that match a filter",
      inputSchema: {
        type: "object",
        properties: {
          filter: { 
            type: "object", 
            description: "The filter to apply",
            properties: {
              address: { type: "string" },
              topics: { type: "array", items: { type: "string" } },
              fromBlock: { type: "string" },
              toBlock: { type: "string" }
            }
          }
        },
        required: ["filter"]
      }
    },
  • src/tools.ts:596-596 (registration)
    Maps the tool name 'provider_get_logs' to its handler function getLogsHandler in the handlers dictionary.
    "provider_get_logs": getLogsHandler,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'match a filter' but doesn't disclose behavioral traits such as read-only vs. destructive nature, authentication needs, rate limits, or what happens if no logs match. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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 a single, efficient sentence with no wasted words, making it front-loaded and easy to parse. However, it's overly concise to the point of under-specification, slightly reducing its effectiveness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that likely retrieves blockchain event logs (inferred from sibling tools), the description is incomplete. It doesn't explain the return format, error handling, or domain context, leaving the agent with insufficient information for proper use.

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 the schema fully documents the 'filter' parameter and its nested properties (address, fromBlock, toBlock, topics). The description adds no additional meaning beyond implying filtering, which is already covered. Baseline 3 is appropriate as the schema handles parameter documentation.

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

Purpose3/5

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

The description 'Get logs that match a filter' states a clear verb ('Get') and resource ('logs'), but it's vague about what type of logs (e.g., blockchain event logs) and lacks differentiation from sibling tools like provider_get_transaction or provider_get_block. It doesn't specify the domain or context, making it somewhat generic.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With siblings like provider_get_transaction and provider_get_block, there's no indication of scenarios where logs are preferred over other data retrieval methods, leaving the agent without usage context.

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

Install Server

Other Tools

Related Tools

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/dcSpark/mcp-cryptowallet-evm'

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