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
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | The filter to apply |
Implementation Reference
- src/handlers/wallet.ts:621-640 (handler)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}`); } };
- src/tools.ts:470-489 (schema)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,