diff --git a/.gitignore b/.gitignore index b61ca6c..df976f9 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,3 @@ go.work # End of https://www.toptal.com/developers/gitignore/api/go,direnv,dotenv - -// Custom -go.work.sum diff --git a/.tool-versions b/.tool-versions index 77788de..a47394b 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ -golang 1.24.4 +golang 1.25.4 golangci-lint 2.4.0 pre-commit 4.2.0 python 3.10.4 diff --git a/gen/go.mod b/gen/go.mod deleted file mode 100644 index d3c1277..0000000 --- a/gen/go.mod +++ /dev/null @@ -1,25 +0,0 @@ -module github.com/selesy/ethereum-mcp/gen - -go 1.24.4 - -require ( - github.com/dave/jennifer v1.7.1 - github.com/google/go-github/v74 v74.0.0 - github.com/invopop/yaml v0.3.1 - github.com/lmittmann/tint v1.1.2 - github.com/selesy/jsonschema v0.14.0-rc1 - github.com/stretchr/testify v1.11.0 - github.com/wk8/go-ordered-map/v2 v2.1.8 - gotest.tools/v3 v3.5.2 -) - -require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/google/go-cmp v0.7.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/gen/go.sum b/gen/go.sum deleted file mode 100644 index 037f14c..0000000 --- a/gen/go.sum +++ /dev/null @@ -1,37 +0,0 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/dave/jennifer v1.7.1 h1:B4jJJDHelWcDhlRQxWeo0Npa/pYKBLrirAQoTN45txo= -github.com/dave/jennifer v1.7.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v74 v74.0.0 h1:yZcddTUn8DPbj11GxnMrNiAnXH14gNs559AsUpNpPgM= -github.com/google/go-github/v74 v74.0.0/go.mod h1:ubn/YdyftV80VPSI26nSJvaEsTOnsjrxG3o9kJhcyak= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= -github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/lmittmann/tint v1.1.2 h1:2CQzrL6rslrsyjqLDwD11bZ5OpLBPU+g3G/r5LSfS8w= -github.com/lmittmann/tint v1.1.2/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/selesy/jsonschema v0.14.0-rc1 h1:rGdpQeWFk76uxpmOx0lrA9Lwb+eVTBPZ6io5IC7rVIk= -github.com/selesy/jsonschema v0.14.0-rc1/go.mod h1:QgbdOu2y8GVkNvmK+npB2dvXlbdEL0eQ2LrRcHRTcKU= -github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= -github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= -github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= -gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= diff --git a/gen/internal/openrpc/data/trace.yaml b/gen/internal/openrpc/data/trace.yaml new file mode 100644 index 0000000..6b83ce2 --- /dev/null +++ b/gen/internal/openrpc/data/trace.yaml @@ -0,0 +1,80 @@ +- name: debug_storageRangeAt + summary: Returns the storage range at a given block hash and transaction index + params: + - name: blockHash + schema: + $ref: '../../schemas.yaml#/components/schemas/BLOCK_HASH' + - name: txIndex + schema: + type: integer + - name: address + schema: + $ref: '../../schemas.yaml#/components/schemas/ADDRESS' + - name: startKey + schema: + $ref: '../../schemas.yaml#/components/schemas/HASH' + - name: maxResult + schema: + type: integer + result: + name: storage + schema: + $ref: '../../schemas.yaml#/components/schemas/StorageRange' +- name: debug_traceBlock + summary: The traceBlock method returns the full trace of a block. + params: + - name: blockRlp + schema: + $ref: '../../schemas.yaml#/components/schemas/BYTES' + - name: options + schema: + $ref: '../../schemas.yaml#/components/schemas/TraceOptions' + result: + name: trace + schema: + type: array + items: + $ref: '../../schemas.yaml#/components/schemas/BlockTrace' +- name: debug_traceBlockByHash + summary: The traceBlockByHash method returns the full trace of a block. + params: + - name: blockHash + schema: + $ref: '../../schemas.yaml#/components/schemas/BLOCK_HASH' + - name: options + schema: + $ref: '../../schemas.yaml#/components/schemas/TraceOptions' + result: + name: trace + schema: + type: array + items: + $ref: '../../schemas.yaml#/components/schemas/BlockTrace' +- name: debug_traceBlockByNumber + summary: The traceBlockByNumber method returns the full trace of a block. + params: + - name: blockNumber + schema: + $ref: '../../schemas.yaml#/components/schemas/BLOCK_NUMBER' + - name: options + schema: + $ref: '../../schemas.yaml#/components/schemas/TraceOptions' + result: + name: trace + schema: + type: array + items: + $ref: '../../schemas.yaml#/components/schemas/BlockTrace' +- name: debug_traceTransaction + summary: The traceTransaction method returns the full trace of a transaction. + params: + - name: txHash + schema: + $ref: '../../schemas.yaml#/components/schemas/TX_HASH' + - name: options + schema: + $ref: '../../schemas.yaml#/components/schemas/TraceOptions' + result: + name: trace + schema: + $ref: '../../schemas.yaml#/components/schemas/TransactionTrace' diff --git a/gen/internal/openrpc/data/trace_schemas.yaml b/gen/internal/openrpc/data/trace_schemas.yaml new file mode 100644 index 0000000..8216b91 --- /dev/null +++ b/gen/internal/openrpc/data/trace_schemas.yaml @@ -0,0 +1,23 @@ +components: + schemas: + TraceOptions: + type: object + properties: + disableStorage: + type: boolean + description: 'Setting this to true will disable storage capture (default: false).' + disableStack: + type: boolean + description: 'Setting this to true will disable stack capture (default: false).' + enableMemory: + type: boolean + description: 'Setting this to true will enable memory capture (default: false).' + enableReturnData: + type: boolean + description: 'Setting this to true will enable return data capture (default: false).' + tracer: + type: string + description: 'The name of the tracer to use (e.g. "callTracer").' + timeout: + type: string + description: 'The timeout for the tracer (e.g. "5s").' diff --git a/gen/internal/scraper/scraper.go b/gen/internal/scraper/scraper.go index e801de1..b3ea798 100644 --- a/gen/internal/scraper/scraper.go +++ b/gen/internal/scraper/scraper.go @@ -6,6 +6,7 @@ import ( "context" "log/slog" "os" + "path/filepath" "github.com/google/go-github/v74/github" @@ -46,10 +47,90 @@ func (s *Scraper) Run(ctx context.Context) ([]openrpc.Method, error) { return nil, err } + localMethodSrc, err := s.LocalSource(ctx, "_schemas.yaml") + if err != nil { + return nil, err + } + s.log.InfoContext(ctx, "Local method files retrieved", "methods", len(localMethodSrc)) + methodSrc = append(methodSrc, localMethodSrc...) + schemaSrc, err := s.SchemaSource(ctx) if err != nil { return nil, err } + localSchemaSrc, err := s.LocalSource(ctx, "trace.yaml") + if err != nil { + return nil, err + } + s.log.InfoContext(ctx, "Local schema files retrieved", "schemas", len(localSchemaSrc)) + schemaSrc = append(schemaSrc, localSchemaSrc...) + return s.MergeMethodsAndDefinitions(ctx, methodSrc, schemaSrc) } + +// LocalSource returns the OpenRPC source for all methods defined by the +// local OpenRPC specifications. +func (s *Scraper) LocalSource(ctx context.Context, filter string) ([]string, error) { + root, err := s.findProjectRoot() + if err != nil { + return nil, err + } + + dir := filepath.Join(root, "gen", "internal", "openrpc", "data") + files, err := os.ReadDir(dir) + if err != nil { + return nil, err + } + + var sources []string + for _, file := range files { + if file.IsDir() { + continue + } + + if filepath.Ext(file.Name()) != ".yaml" { + continue + } + + if filter == "trace.yaml" && file.Name() == "trace.yaml" { + continue + } + + if filter == "_schemas.yaml" && file.Name() != "trace.yaml" { + continue + } + + path := filepath.Join(dir, file.Name()) + path = filepath.Clean(path) + s.log.DebugContext(ctx, "Reading local method file", "path", path) + + data, err := os.ReadFile(path) + if err != nil { + return nil, err + } + s.log.DebugContext(ctx, "Read local method file", "path", path) + sources = append(sources, string(data)) + } + + return sources, nil +} + +func (s *Scraper) findProjectRoot() (string, error) { + dir, err := os.Getwd() + if err != nil { + return "", err + } + + for { + if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil { + return dir, nil + } + + if dir == filepath.Dir(dir) { + return "", os.ErrNotExist + } + + dir = filepath.Dir(dir) + } +} diff --git a/go.mod b/go.mod index ba60203..123d02f 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,36 @@ module github.com/selesy/ethereum-mcp -go 1.24.4 +go 1.24 + +toolchain go1.25.4 tool ( github.com/selesy/ethereum-mcp/gen golang.org/x/vuln/cmd/govulncheck ) -require github.com/mark3labs/mcp-go v0.39.0 +require ( + github.com/dave/jennifer v1.7.1 + github.com/google/go-github/v74 v74.0.0 + github.com/invopop/yaml v0.3.1 + github.com/lmittmann/tint v1.1.2 + github.com/mark3labs/mcp-go v0.39.0 + github.com/selesy/jsonschema v0.14.0-rc1 + github.com/stretchr/testify v1.11.0 + github.com/wk8/go-ordered-map/v2 v2.1.8 + gotest.tools/v3 v3.5.2 +) require ( github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/dave/jennifer v1.7.1 // indirect - github.com/google/go-github/v74 v74.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/invopop/jsonschema v0.13.0 // indirect - github.com/invopop/yaml v0.3.1 // indirect - github.com/lmittmann/tint v1.1.2 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/selesy/ethereum-mcp/gen v0.4.0 // indirect - github.com/selesy/jsonschema v0.14.0-rc1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/cast v1.7.1 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/sync v0.10.0 // indirect @@ -32,5 +40,3 @@ require ( golang.org/x/vuln v1.1.4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/selesy/ethereum-mcp/gen => ./gen diff --git a/pkg/doc.go b/pkg/doc.go index 0a3d91a..ad7918d 100644 --- a/pkg/doc.go +++ b/pkg/doc.go @@ -1,3 +1,3 @@ -////go:generate go tool gen +//go:generate go tool gen package pkg diff --git a/pkg/proxy/params.go b/pkg/proxy/params.go new file mode 100644 index 0000000..7e0ed9c --- /dev/null +++ b/pkg/proxy/params.go @@ -0,0 +1,22 @@ +package proxy + +// ParamsSpec contains the "specification" needed to service each JSON-RPC +// method. +type ParamsSpec struct { + order []string + required map[string]struct{} +} + +// Order returns an ordered list of parameter names which can be used to +// convert a JSON-RPC "params" value from named parameters to positional +// parameters. +func (p *ParamsSpec) Order() []string { + return p.order +} + +// Required returns a set of which parameters are required. For positional +// parameters, the parameters in this set should be those that are first +// in the list returned by Order. +func (p *ParamsSpec) Required() map[string]struct{} { + return p.required +} diff --git a/pkg/proxy/params_gen.go b/pkg/proxy/params_gen.go new file mode 100644 index 0000000..72442d8 --- /dev/null +++ b/pkg/proxy/params_gen.go @@ -0,0 +1,342 @@ +// Code generated by /gen. DO NOT EDIT. + +package proxy + +// ParamsSpecs returns a map relating method names to the associated (ordered) list of parameters. +func ParamsSpecs() map[string]ParamsSpec { + return map[string]ParamsSpec{ + "debug_getBadBlocks": { + order: []string{}, + required: map[string]struct{}{}, + }, + "debug_getRawBlock": { + order: []string{"block"}, + required: map[string]struct{}{"block": struct{}{}}, + }, + "debug_getRawHeader": { + order: []string{"block"}, + required: map[string]struct{}{"block": struct{}{}}, + }, + "debug_getRawReceipts": { + order: []string{"block"}, + required: map[string]struct{}{"block": struct{}{}}, + }, + "debug_getRawTransaction": { + order: []string{"transaction_hash"}, + required: map[string]struct{}{"transaction_hash": struct{}{}}, + }, + "debug_storageRangeAt": { + order: []string{"blockhash", "txindex", "address", "startkey", "maxresult"}, + required: map[string]struct{}{}, + }, + "debug_traceBlock": { + order: []string{"blockrlp", "options"}, + required: map[string]struct{}{}, + }, + "debug_traceBlockByHash": { + order: []string{"blockhash", "options"}, + required: map[string]struct{}{}, + }, + "debug_traceBlockByNumber": { + order: []string{"blocknumber", "options"}, + required: map[string]struct{}{}, + }, + "debug_traceTransaction": { + order: []string{"txhash", "options"}, + required: map[string]struct{}{}, + }, + "engine_exchangeCapabilities": { + order: []string{"consensus_client_methods"}, + required: map[string]struct{}{"consensus_client_methods": struct{}{}}, + }, + "engine_exchangeTransitionConfigurationV1": { + order: []string{"consensus_client_configuration"}, + required: map[string]struct{}{"consensus_client_configuration": struct{}{}}, + }, + "engine_forkchoiceUpdatedV1": { + order: []string{"forkchoice_state", "payload_attributes"}, + required: map[string]struct{}{"forkchoice_state": struct{}{}}, + }, + "engine_forkchoiceUpdatedV2": { + order: []string{"forkchoice_state", "payload_attributes"}, + required: map[string]struct{}{"forkchoice_state": struct{}{}}, + }, + "engine_forkchoiceUpdatedV3": { + order: []string{"forkchoice_state", "payload_attributes"}, + required: map[string]struct{}{"forkchoice_state": struct{}{}}, + }, + "engine_getBlobsV1": { + order: []string{"blob_versioned_hashes"}, + required: map[string]struct{}{"blob_versioned_hashes": struct{}{}}, + }, + "engine_getBlobsV2": { + order: []string{"blob_versioned_hashes"}, + required: map[string]struct{}{"blob_versioned_hashes": struct{}{}}, + }, + "engine_getPayloadBodiesByHashV1": { + order: []string{"array_of_block_hashes"}, + required: map[string]struct{}{"array_of_block_hashes": struct{}{}}, + }, + "engine_getPayloadBodiesByRangeV1": { + order: []string{"starting_block_number", "number_of_blocks_to_return"}, + required: map[string]struct{}{ + "number_of_blocks_to_return": struct{}{}, + "starting_block_number": struct{}{}, + }, + }, + "engine_getPayloadV1": { + order: []string{"payload_id"}, + required: map[string]struct{}{"payload_id": struct{}{}}, + }, + "engine_getPayloadV2": { + order: []string{"payload_id"}, + required: map[string]struct{}{"payload_id": struct{}{}}, + }, + "engine_getPayloadV3": { + order: []string{"payload_id"}, + required: map[string]struct{}{"payload_id": struct{}{}}, + }, + "engine_getPayloadV4": { + order: []string{"payload_id"}, + required: map[string]struct{}{"payload_id": struct{}{}}, + }, + "engine_getPayloadV5": { + order: []string{"payload_id"}, + required: map[string]struct{}{"payload_id": struct{}{}}, + }, + "engine_getPayloadV6": { + order: []string{"payload_id"}, + required: map[string]struct{}{"payload_id": struct{}{}}, + }, + "engine_newPayloadV1": { + order: []string{"execution_payload"}, + required: map[string]struct{}{"execution_payload": struct{}{}}, + }, + "engine_newPayloadV2": { + order: []string{"execution_payload"}, + required: map[string]struct{}{"execution_payload": struct{}{}}, + }, + "engine_newPayloadV3": { + order: []string{"execution_payload", "expected_blob_versioned_hashes", "root_of_the_parent_beacon_block"}, + required: map[string]struct{}{ + "execution_payload": struct{}{}, + "expected_blob_versioned_hashes": struct{}{}, + "root_of_the_parent_beacon_block": struct{}{}, + }, + }, + "engine_newPayloadV4": { + order: []string{"execution_payload", "expected_blob_versioned_hashes", "root_of_the_parent_beacon_block", "execution_requests"}, + required: map[string]struct{}{ + "execution_payload": struct{}{}, + "execution_requests": struct{}{}, + "expected_blob_versioned_hashes": struct{}{}, + "root_of_the_parent_beacon_block": struct{}{}, + }, + }, + "engine_newPayloadV5": { + order: []string{"execution_payload", "expected_blob_versioned_hashes", "parent_beacon_block_root", "execution_requests"}, + required: map[string]struct{}{ + "execution_payload": struct{}{}, + "execution_requests": struct{}{}, + "expected_blob_versioned_hashes": struct{}{}, + "parent_beacon_block_root": struct{}{}, + }, + }, + "eth_accounts": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_blobBaseFee": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_blockNumber": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_call": { + order: []string{"transaction", "block"}, + required: map[string]struct{}{"transaction": struct{}{}}, + }, + "eth_chainId": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_coinbase": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_createAccessList": { + order: []string{"transaction", "block"}, + required: map[string]struct{}{"transaction": struct{}{}}, + }, + "eth_estimateGas": { + order: []string{"transaction", "block"}, + required: map[string]struct{}{"transaction": struct{}{}}, + }, + "eth_feeHistory": { + order: []string{"blockcount", "newestblock", "rewardpercentiles"}, + required: map[string]struct{}{ + "blockcount": struct{}{}, + "newestblock": struct{}{}, + "rewardpercentiles": struct{}{}, + }, + }, + "eth_gasPrice": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_getBalance": { + order: []string{"address", "block"}, + required: map[string]struct{}{ + "address": struct{}{}, + "block": struct{}{}, + }, + }, + "eth_getBlockByHash": { + order: []string{"block_hash", "hydrated_transactions"}, + required: map[string]struct{}{ + "block_hash": struct{}{}, + "hydrated_transactions": struct{}{}, + }, + }, + "eth_getBlockByNumber": { + order: []string{"block", "hydrated_transactions"}, + required: map[string]struct{}{ + "block": struct{}{}, + "hydrated_transactions": struct{}{}, + }, + }, + "eth_getBlockReceipts": { + order: []string{"block"}, + required: map[string]struct{}{"block": struct{}{}}, + }, + "eth_getBlockTransactionCountByHash": { + order: []string{"block_hash"}, + required: map[string]struct{}{}, + }, + "eth_getBlockTransactionCountByNumber": { + order: []string{"block"}, + required: map[string]struct{}{}, + }, + "eth_getCode": { + order: []string{"address", "block"}, + required: map[string]struct{}{ + "address": struct{}{}, + "block": struct{}{}, + }, + }, + "eth_getFilterChanges": { + order: []string{"filter_identifier"}, + required: map[string]struct{}{"filter_identifier": struct{}{}}, + }, + "eth_getFilterLogs": { + order: []string{"filter_identifier"}, + required: map[string]struct{}{"filter_identifier": struct{}{}}, + }, + "eth_getLogs": { + order: []string{"filter"}, + required: map[string]struct{}{"filter": struct{}{}}, + }, + "eth_getProof": { + order: []string{"address", "storagekeys", "block"}, + required: map[string]struct{}{ + "address": struct{}{}, + "block": struct{}{}, + "storagekeys": struct{}{}, + }, + }, + "eth_getStorageAt": { + order: []string{"address", "storage_slot", "block"}, + required: map[string]struct{}{ + "address": struct{}{}, + "block": struct{}{}, + "storage_slot": struct{}{}, + }, + }, + "eth_getTransactionByBlockHashAndIndex": { + order: []string{"block_hash", "transaction_index"}, + required: map[string]struct{}{ + "block_hash": struct{}{}, + "transaction_index": struct{}{}, + }, + }, + "eth_getTransactionByBlockNumberAndIndex": { + order: []string{"block", "transaction_index"}, + required: map[string]struct{}{ + "block": struct{}{}, + "transaction_index": struct{}{}, + }, + }, + "eth_getTransactionByHash": { + order: []string{"transaction_hash"}, + required: map[string]struct{}{"transaction_hash": struct{}{}}, + }, + "eth_getTransactionCount": { + order: []string{"address", "block"}, + required: map[string]struct{}{ + "address": struct{}{}, + "block": struct{}{}, + }, + }, + "eth_getTransactionReceipt": { + order: []string{"transaction_hash"}, + required: map[string]struct{}{"transaction_hash": struct{}{}}, + }, + "eth_getUncleCountByBlockHash": { + order: []string{"block_hash"}, + required: map[string]struct{}{}, + }, + "eth_getUncleCountByBlockNumber": { + order: []string{"block"}, + required: map[string]struct{}{}, + }, + "eth_maxPriorityFeePerGas": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_newBlockFilter": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_newFilter": { + order: []string{"filter"}, + required: map[string]struct{}{"filter": struct{}{}}, + }, + "eth_newPendingTransactionFilter": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_sendRawTransaction": { + order: []string{"transaction"}, + required: map[string]struct{}{"transaction": struct{}{}}, + }, + "eth_sendTransaction": { + order: []string{"transaction"}, + required: map[string]struct{}{"transaction": struct{}{}}, + }, + "eth_sign": { + order: []string{"address", "message"}, + required: map[string]struct{}{ + "address": struct{}{}, + "message": struct{}{}, + }, + }, + "eth_signTransaction": { + order: []string{"transaction"}, + required: map[string]struct{}{"transaction": struct{}{}}, + }, + "eth_simulateV1": { + order: []string{"payload", "block_tag"}, + required: map[string]struct{}{"payload": struct{}{}}, + }, + "eth_syncing": { + order: []string{}, + required: map[string]struct{}{}, + }, + "eth_uninstallFilter": { + order: []string{"filter_identifier"}, + required: map[string]struct{}{"filter_identifier": struct{}{}}, + }, + } +} diff --git a/pkg/schema/data/debug_storageRangeAt.json b/pkg/schema/data/debug_storageRangeAt.json new file mode 100644 index 0000000..081f82c --- /dev/null +++ b/pkg/schema/data/debug_storageRangeAt.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/debug_storageRangeAt.json", + "properties": { + "blockhash": { + "$ref": "../../schemas.yaml#/$defs/BLOCK_HASH", + "title": "blockhash", + "description": "blockHash" + }, + "txindex": { + "type": "integer", + "title": "txindex", + "description": "txIndex" + }, + "address": { + "$ref": "../../schemas.yaml#/$defs/ADDRESS", + "title": "address", + "description": "address" + }, + "startkey": { + "$ref": "../../schemas.yaml#/$defs/HASH", + "title": "startkey", + "description": "startKey" + }, + "maxresult": { + "type": "integer", + "title": "maxresult", + "description": "maxResult" + } + }, + "type": "object", + "title": "debug_storageRangeAt", + "description": "Returns the storage range at a given block hash and transaction index" +} diff --git a/pkg/schema/data/debug_traceBlock.json b/pkg/schema/data/debug_traceBlock.json new file mode 100644 index 0000000..f2ae72c --- /dev/null +++ b/pkg/schema/data/debug_traceBlock.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/debug_traceBlock.json", + "properties": { + "blockrlp": { + "$ref": "../../schemas.yaml#/$defs/BYTES", + "title": "blockrlp", + "description": "blockRlp" + }, + "options": { + "$ref": "../../schemas.yaml#/$defs/TraceOptions", + "title": "options", + "description": "options" + } + }, + "type": "object", + "title": "debug_traceBlock", + "description": "The traceBlock method returns the full trace of a block." +} diff --git a/pkg/schema/data/debug_traceBlockByHash.json b/pkg/schema/data/debug_traceBlockByHash.json new file mode 100644 index 0000000..6d9974b --- /dev/null +++ b/pkg/schema/data/debug_traceBlockByHash.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/debug_traceBlockByHash.json", + "properties": { + "blockhash": { + "$ref": "../../schemas.yaml#/$defs/BLOCK_HASH", + "title": "blockhash", + "description": "blockHash" + }, + "options": { + "$ref": "../../schemas.yaml#/$defs/TraceOptions", + "title": "options", + "description": "options" + } + }, + "type": "object", + "title": "debug_traceBlockByHash", + "description": "The traceBlockByHash method returns the full trace of a block." +} diff --git a/pkg/schema/data/debug_traceBlockByNumber.json b/pkg/schema/data/debug_traceBlockByNumber.json new file mode 100644 index 0000000..abdb930 --- /dev/null +++ b/pkg/schema/data/debug_traceBlockByNumber.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/debug_traceBlockByNumber.json", + "properties": { + "blocknumber": { + "$ref": "../../schemas.yaml#/$defs/BLOCK_NUMBER", + "title": "blocknumber", + "description": "blockNumber" + }, + "options": { + "$ref": "../../schemas.yaml#/$defs/TraceOptions", + "title": "options", + "description": "options" + } + }, + "type": "object", + "title": "debug_traceBlockByNumber", + "description": "The traceBlockByNumber method returns the full trace of a block." +} diff --git a/pkg/schema/data/debug_traceTransaction.json b/pkg/schema/data/debug_traceTransaction.json new file mode 100644 index 0000000..18dc291 --- /dev/null +++ b/pkg/schema/data/debug_traceTransaction.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/debug_traceTransaction.json", + "properties": { + "txhash": { + "$ref": "../../schemas.yaml#/$defs/TX_HASH", + "title": "txhash", + "description": "txHash" + }, + "options": { + "$ref": "../../schemas.yaml#/$defs/TraceOptions", + "title": "options", + "description": "options" + } + }, + "type": "object", + "title": "debug_traceTransaction", + "description": "The traceTransaction method returns the full trace of a transaction." +} diff --git a/pkg/schema/data/engine_getPayloadV6.json b/pkg/schema/data/engine_getPayloadV6.json new file mode 100644 index 0000000..e904323 --- /dev/null +++ b/pkg/schema/data/engine_getPayloadV6.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/engine_getPayloadV6.json", + "$defs": { + "bytes8": { + "type": "string", + "pattern": "^0x[0-9a-f]{16}$", + "title": "8 hex encoded bytes" + } + }, + "properties": { + "payload_id": { + "$ref": "#/$defs/bytes8", + "title": "payload_id", + "description": "Payload id" + } + }, + "type": "object", + "required": [ + "payload_id" + ], + "title": "engine_getPayloadV6", + "description": "Obtains execution payload from payload build process" +} diff --git a/pkg/schema/data/engine_newPayloadV5.json b/pkg/schema/data/engine_newPayloadV5.json new file mode 100644 index 0000000..39531fe --- /dev/null +++ b/pkg/schema/data/engine_newPayloadV5.json @@ -0,0 +1,151 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/selesy/ethereum-mcp/engine_newPayloadV5.json", + "$defs": { + "ExecutionPayloadV4": { + "properties": { + "baseFeePerGas": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/baseFeePerGas" + }, + "blobGasUsed": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/blobGasUsed" + }, + "blockAccessList": { + "$ref": "#/$defs/bytes", + "title": "Block access list" + }, + "blockHash": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/blockHash" + }, + "blockNumber": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/blockNumber" + }, + "excessBlobGas": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/excessBlobGas" + }, + "extraData": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/extraData" + }, + "feeRecipient": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/feeRecipient" + }, + "gasLimit": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/gasLimit" + }, + "gasUsed": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/gasUsed" + }, + "logsBloom": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/logsBloom" + }, + "parentHash": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/parentHash" + }, + "prevRandao": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/prevRandao" + }, + "receiptsRoot": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/receiptsRoot" + }, + "stateRoot": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/stateRoot" + }, + "timestamp": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/timestamp" + }, + "transactions": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/transactions" + }, + "withdrawals": { + "$ref": "#/$defs/ExecutionPayloadV3/properties/withdrawals" + } + }, + "type": "object", + "required": [ + "parentHash", + "feeRecipient", + "stateRoot", + "receiptsRoot", + "logsBloom", + "prevRandao", + "blockNumber", + "gasLimit", + "gasUsed", + "timestamp", + "extraData", + "baseFeePerGas", + "blockHash", + "transactions", + "withdrawals", + "blobGasUsed", + "excessBlobGas", + "blockAccessList" + ], + "title": "Execution payload object V4" + }, + "baseFeePerGas": null, + "blobGasUsed": null, + "blockHash": null, + "blockNumber": null, + "bytes": { + "type": "string", + "pattern": "^0x[0-9a-f]*$", + "title": "hex encoded bytes" + }, + "excessBlobGas": null, + "extraData": null, + "feeRecipient": null, + "gasLimit": null, + "gasUsed": null, + "hash32": { + "type": "string", + "pattern": "^0x[0-9a-f]{64}$", + "title": "32 byte hex value" + }, + "logsBloom": null, + "parentHash": null, + "prevRandao": null, + "receiptsRoot": null, + "stateRoot": null, + "timestamp": null, + "transactions": null, + "withdrawals": null + }, + "properties": { + "execution_payload": { + "$ref": "#/$defs/ExecutionPayloadV4", + "title": "execution_payload", + "description": "Execution payload" + }, + "expected_blob_versioned_hashes": { + "items": { + "$ref": "#/$defs/hash32" + }, + "type": "array", + "title": "expected_blob_versioned_hashes", + "description": "Expected blob versioned hashes" + }, + "parent_beacon_block_root": { + "$ref": "#/$defs/hash32", + "title": "parent_beacon_block_root", + "description": "Parent beacon block root" + }, + "execution_requests": { + "items": { + "$ref": "#/$defs/bytes" + }, + "type": "array", + "title": "execution_requests", + "description": "Execution requests" + } + }, + "type": "object", + "required": [ + "execution_payload", + "expected_blob_versioned_hashes", + "parent_beacon_block_root", + "execution_requests" + ], + "title": "engine_newPayloadV5", + "description": "Runs execution payload validation" +} diff --git a/pkg/schema/data/eth_getLogs.json b/pkg/schema/data/eth_getLogs.json index bbf85c8..fd666fc 100644 --- a/pkg/schema/data/eth_getLogs.json +++ b/pkg/schema/data/eth_getLogs.json @@ -3,37 +3,77 @@ "$id": "https://github.com/selesy/ethereum-mcp/eth_getLogs.json", "$defs": { "Filter": { - "properties": { - "address": { - "oneOf": [ - { - "type": "null", - "title": "Any Address" + "oneOf": [ + { + "properties": { + "address": { + "oneOf": [ + { + "type": "null", + "title": "Any Address" + }, + { + "$ref": "#/$defs/address", + "title": "Address" + }, + { + "$ref": "#/$defs/addresses", + "title": "Addresses" + } + ], + "title": "Address(es)" + }, + "fromBlock": { + "$ref": "#/$defs/uint", + "title": "from block" }, - { - "$ref": "#/$defs/address", - "title": "Address" + "toBlock": { + "$ref": "#/$defs/uint", + "title": "to block" }, - { - "$ref": "#/$defs/addresses", - "title": "Addresses" + "topics": { + "$ref": "#/$defs/FilterTopics", + "title": "Topics" } - ], - "title": "Address(es)" - }, - "fromBlock": { - "$ref": "#/$defs/uint", - "title": "from block" - }, - "toBlock": { - "$ref": "#/$defs/uint", - "title": "to block" + }, + "type": "object", + "title": "Filter by block range" }, - "topics": { - "$ref": "#/$defs/FilterTopics", - "title": "Topics" + { + "properties": { + "address": { + "oneOf": [ + { + "type": "null", + "title": "Any Address" + }, + { + "$ref": "#/$defs/address", + "title": "Address" + }, + { + "$ref": "#/$defs/addresses", + "title": "Addresses" + } + ], + "title": "Address(es)" + }, + "blockHash": { + "$ref": "#/$defs/hash32", + "title": "block hash" + }, + "topics": { + "$ref": "#/$defs/FilterTopics", + "title": "Topics" + } + }, + "type": "object", + "required": [ + "blockHash" + ], + "title": "Filter by block hash" } - }, + ], "additionalProperties": false, "type": "object", "title": "filter" @@ -87,6 +127,11 @@ "pattern": "^0x[0-9a-f]{64}$", "title": "32 hex encoded bytes" }, + "hash32": { + "type": "string", + "pattern": "^0x[0-9a-f]{64}$", + "title": "32 byte hex value" + }, "uint": { "type": "string", "pattern": "^0x(0|[1-9a-f][0-9a-f]*)$", diff --git a/pkg/schema/data/eth_newFilter.json b/pkg/schema/data/eth_newFilter.json index 5759e66..fe69090 100644 --- a/pkg/schema/data/eth_newFilter.json +++ b/pkg/schema/data/eth_newFilter.json @@ -3,37 +3,77 @@ "$id": "https://github.com/selesy/ethereum-mcp/eth_newFilter.json", "$defs": { "Filter": { - "properties": { - "address": { - "oneOf": [ - { - "type": "null", - "title": "Any Address" + "oneOf": [ + { + "properties": { + "address": { + "oneOf": [ + { + "type": "null", + "title": "Any Address" + }, + { + "$ref": "#/$defs/address", + "title": "Address" + }, + { + "$ref": "#/$defs/addresses", + "title": "Addresses" + } + ], + "title": "Address(es)" + }, + "fromBlock": { + "$ref": "#/$defs/uint", + "title": "from block" }, - { - "$ref": "#/$defs/address", - "title": "Address" + "toBlock": { + "$ref": "#/$defs/uint", + "title": "to block" }, - { - "$ref": "#/$defs/addresses", - "title": "Addresses" + "topics": { + "$ref": "#/$defs/FilterTopics", + "title": "Topics" } - ], - "title": "Address(es)" - }, - "fromBlock": { - "$ref": "#/$defs/uint", - "title": "from block" - }, - "toBlock": { - "$ref": "#/$defs/uint", - "title": "to block" + }, + "type": "object", + "title": "Filter by block range" }, - "topics": { - "$ref": "#/$defs/FilterTopics", - "title": "Topics" + { + "properties": { + "address": { + "oneOf": [ + { + "type": "null", + "title": "Any Address" + }, + { + "$ref": "#/$defs/address", + "title": "Address" + }, + { + "$ref": "#/$defs/addresses", + "title": "Addresses" + } + ], + "title": "Address(es)" + }, + "blockHash": { + "$ref": "#/$defs/hash32", + "title": "block hash" + }, + "topics": { + "$ref": "#/$defs/FilterTopics", + "title": "Topics" + } + }, + "type": "object", + "required": [ + "blockHash" + ], + "title": "Filter by block hash" } - }, + ], "additionalProperties": false, "type": "object", "title": "filter" @@ -87,6 +127,11 @@ "pattern": "^0x[0-9a-f]{64}$", "title": "32 hex encoded bytes" }, + "hash32": { + "type": "string", + "pattern": "^0x[0-9a-f]{64}$", + "title": "32 byte hex value" + }, "uint": { "type": "string", "pattern": "^0x(0|[1-9a-f][0-9a-f]*)$", diff --git a/pkg/schema/schema_gen.go b/pkg/schema/schema_gen.go index b316106..2214ae7 100644 --- a/pkg/schema/schema_gen.go +++ b/pkg/schema/schema_gen.go @@ -117,6 +117,16 @@ var EngineGetPayloadBodiesByHashV1Schema json.RawMessage //go:embed data/engine_getPayloadBodiesByRangeV1.json var EngineGetPayloadBodiesByRangeV1Schema json.RawMessage +// EngineNewPayloadV5Schema runs execution payload validation +// +//go:embed data/engine_newPayloadV5.json +var EngineNewPayloadV5Schema json.RawMessage + +// EngineGetPayloadV6Schema obtains execution payload from payload build process +// +//go:embed data/engine_getPayloadV6.json +var EngineGetPayloadV6Schema json.RawMessage + // EngineExchangeTransitionConfigurationV1Schema exchanges transition configuration // //go:embed data/engine_exchangeTransitionConfigurationV1.json @@ -322,6 +332,31 @@ var EthGetTransactionByBlockNumberAndIndexSchema json.RawMessage //go:embed data/eth_getTransactionReceipt.json var EthGetTransactionReceiptSchema json.RawMessage +// DebugStorageRangeAtSchema returns the storage range at a given block hash and transaction index +// +//go:embed data/debug_storageRangeAt.json +var DebugStorageRangeAtSchema json.RawMessage + +// DebugTraceBlockSchema the traceBlock method returns the full trace of a block. +// +//go:embed data/debug_traceBlock.json +var DebugTraceBlockSchema json.RawMessage + +// DebugTraceBlockByHashSchema the traceBlockByHash method returns the full trace of a block. +// +//go:embed data/debug_traceBlockByHash.json +var DebugTraceBlockByHashSchema json.RawMessage + +// DebugTraceBlockByNumberSchema the traceBlockByNumber method returns the full trace of a block. +// +//go:embed data/debug_traceBlockByNumber.json +var DebugTraceBlockByNumberSchema json.RawMessage + +// DebugTraceTransactionSchema the traceTransaction method returns the full trace of a transaction. +// +//go:embed data/debug_traceTransaction.json +var DebugTraceTransactionSchema json.RawMessage + // Schemas returns a map relating method names to the associated JSONSchema. func Schemas() map[string]json.RawMessage { return map[string]json.RawMessage{ @@ -330,6 +365,11 @@ func Schemas() map[string]json.RawMessage { "debug_getRawHeader": DebugGetRawHeaderSchema, "debug_getRawReceipts": DebugGetRawReceiptsSchema, "debug_getRawTransaction": DebugGetRawTransactionSchema, + "debug_storageRangeAt": DebugStorageRangeAtSchema, + "debug_traceBlock": DebugTraceBlockSchema, + "debug_traceBlockByHash": DebugTraceBlockByHashSchema, + "debug_traceBlockByNumber": DebugTraceBlockByNumberSchema, + "debug_traceTransaction": DebugTraceTransactionSchema, "engine_exchangeCapabilities": EngineExchangeCapabilitiesSchema, "engine_exchangeTransitionConfigurationV1": EngineExchangeTransitionConfigurationV1Schema, "engine_forkchoiceUpdatedV1": EngineForkchoiceUpdatedV1Schema, @@ -344,10 +384,12 @@ func Schemas() map[string]json.RawMessage { "engine_getPayloadV3": EngineGetPayloadV3Schema, "engine_getPayloadV4": EngineGetPayloadV4Schema, "engine_getPayloadV5": EngineGetPayloadV5Schema, + "engine_getPayloadV6": EngineGetPayloadV6Schema, "engine_newPayloadV1": EngineNewPayloadV1Schema, "engine_newPayloadV2": EngineNewPayloadV2Schema, "engine_newPayloadV3": EngineNewPayloadV3Schema, "engine_newPayloadV4": EngineNewPayloadV4Schema, + "engine_newPayloadV5": EngineNewPayloadV5Schema, "eth_accounts": EthAccountsSchema, "eth_blobBaseFee": EthBlobBaseFeeSchema, "eth_blockNumber": EthBlockNumberSchema, diff --git a/pkg/tool/tool_gen.go b/pkg/tool/tool_gen.go index 7509604..18187e6 100644 --- a/pkg/tool/tool_gen.go +++ b/pkg/tool/tool_gen.go @@ -73,6 +73,12 @@ var EngineGetPayloadBodiesByHashV1Tool = mcp.NewToolWithRawSchema("engine_getPay // EngineGetPayloadBodiesByRangeV1Tool is an mcp.Tool that given a range of block numbers returns bodies of the corresponding execution payloads var EngineGetPayloadBodiesByRangeV1Tool = mcp.NewToolWithRawSchema("engine_getPayloadBodiesByRangeV1", "Given a range of block numbers returns bodies of the corresponding execution payloads", schema.EngineGetPayloadBodiesByRangeV1Schema) +// EngineNewPayloadV5Tool is an mcp.Tool that runs execution payload validation +var EngineNewPayloadV5Tool = mcp.NewToolWithRawSchema("engine_newPayloadV5", "Runs execution payload validation", schema.EngineNewPayloadV5Schema) + +// EngineGetPayloadV6Tool is an mcp.Tool that obtains execution payload from payload build process +var EngineGetPayloadV6Tool = mcp.NewToolWithRawSchema("engine_getPayloadV6", "Obtains execution payload from payload build process", schema.EngineGetPayloadV6Schema) + // EngineExchangeTransitionConfigurationV1Tool is an mcp.Tool that exchanges transition configuration var EngineExchangeTransitionConfigurationV1Tool = mcp.NewToolWithRawSchema("engine_exchangeTransitionConfigurationV1", "Exchanges transition configuration", schema.EngineExchangeTransitionConfigurationV1Schema) @@ -196,6 +202,21 @@ var EthGetTransactionByBlockNumberAndIndexTool = mcp.NewToolWithRawSchema("eth_g // EthGetTransactionReceiptTool is an mcp.Tool that returns the receipt of a transaction by transaction hash. var EthGetTransactionReceiptTool = mcp.NewToolWithRawSchema("eth_getTransactionReceipt", "Returns the receipt of a transaction by transaction hash.", schema.EthGetTransactionReceiptSchema) +// DebugStorageRangeAtTool is an mcp.Tool that returns the storage range at a given block hash and transaction index +var DebugStorageRangeAtTool = mcp.NewToolWithRawSchema("debug_storageRangeAt", "Returns the storage range at a given block hash and transaction index", schema.DebugStorageRangeAtSchema) + +// DebugTraceBlockTool is an mcp.Tool that the traceBlock method returns the full trace of a block. +var DebugTraceBlockTool = mcp.NewToolWithRawSchema("debug_traceBlock", "The traceBlock method returns the full trace of a block.", schema.DebugTraceBlockSchema) + +// DebugTraceBlockByHashTool is an mcp.Tool that the traceBlockByHash method returns the full trace of a block. +var DebugTraceBlockByHashTool = mcp.NewToolWithRawSchema("debug_traceBlockByHash", "The traceBlockByHash method returns the full trace of a block.", schema.DebugTraceBlockByHashSchema) + +// DebugTraceBlockByNumberTool is an mcp.Tool that the traceBlockByNumber method returns the full trace of a block. +var DebugTraceBlockByNumberTool = mcp.NewToolWithRawSchema("debug_traceBlockByNumber", "The traceBlockByNumber method returns the full trace of a block.", schema.DebugTraceBlockByNumberSchema) + +// DebugTraceTransactionTool is an mcp.Tool that the traceTransaction method returns the full trace of a transaction. +var DebugTraceTransactionTool = mcp.NewToolWithRawSchema("debug_traceTransaction", "The traceTransaction method returns the full trace of a transaction.", schema.DebugTraceTransactionSchema) + // Tools returns a map relating method names to the associated tool. func Tools() map[string]mcp.Tool { return map[string]mcp.Tool{ @@ -204,6 +225,11 @@ func Tools() map[string]mcp.Tool { "debug_getRawHeader": DebugGetRawHeaderTool, "debug_getRawReceipts": DebugGetRawReceiptsTool, "debug_getRawTransaction": DebugGetRawTransactionTool, + "debug_storageRangeAt": DebugStorageRangeAtTool, + "debug_traceBlock": DebugTraceBlockTool, + "debug_traceBlockByHash": DebugTraceBlockByHashTool, + "debug_traceBlockByNumber": DebugTraceBlockByNumberTool, + "debug_traceTransaction": DebugTraceTransactionTool, "engine_exchangeCapabilities": EngineExchangeCapabilitiesTool, "engine_exchangeTransitionConfigurationV1": EngineExchangeTransitionConfigurationV1Tool, "engine_forkchoiceUpdatedV1": EngineForkchoiceUpdatedV1Tool, @@ -218,10 +244,12 @@ func Tools() map[string]mcp.Tool { "engine_getPayloadV3": EngineGetPayloadV3Tool, "engine_getPayloadV4": EngineGetPayloadV4Tool, "engine_getPayloadV5": EngineGetPayloadV5Tool, + "engine_getPayloadV6": EngineGetPayloadV6Tool, "engine_newPayloadV1": EngineNewPayloadV1Tool, "engine_newPayloadV2": EngineNewPayloadV2Tool, "engine_newPayloadV3": EngineNewPayloadV3Tool, "engine_newPayloadV4": EngineNewPayloadV4Tool, + "engine_newPayloadV5": EngineNewPayloadV5Tool, "eth_accounts": EthAccountsTool, "eth_blobBaseFee": EthBlobBaseFeeTool, "eth_blockNumber": EthBlockNumberTool, diff --git a/release-please-config.yaml b/release-please-config.yaml new file mode 100644 index 0000000..01ec54a --- /dev/null +++ b/release-please-config.yaml @@ -0,0 +1,30 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "changelog-sections": [ + { + "type": "feat", + "section": "🚀 Features", + "hidden": false + }, + { + "type": "fix", + "section": "🐛 Bug Fixes", + "hidden": false + }, + { + "type": "perf", + "section": "⚡ Performance Improvements", + "hidden": false + }, + { + "type": "docs", + "section": "📝 Documentation", + "hidden": false + }, + { + "type": "chore", + "section": "Other", + "hidden": false + } + ] +}