@secondlayer/mcp 11.3.0 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin-http.js +160 -138
- package/dist/bin-http.js.map +4 -4
- package/dist/bin.js +160 -138
- package/dist/bin.js.map +4 -4
- package/dist/index.js +160 -138
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ bunx -p @secondlayer/mcp secondlayer-mcp-http
|
|
|
85
85
|
| **Instance** (1) | `instance_status` |
|
|
86
86
|
| **Archive** (5) | `archive_verify`, `archive_bootstrap`, `archive_repair`, `archive_latest`, `archive_quote` |
|
|
87
87
|
| **Credits** (1) | `credits_balance` (needs `SECONDLAYER_API_KEY`) |
|
|
88
|
-
| **Account** (
|
|
88
|
+
| **Account** (4) | `account_whoami`, `account_create_key`, `account_list_keys`, `account_rotate_key` (only when pointed at `https://api.secondlayer.tools`) |
|
|
89
89
|
|
|
90
90
|
Verify after mutating: `subgraphs_operations` for deploy/reindex/backfill/stop,
|
|
91
91
|
`webhooks_deliveries` for create/test/replay. Empty index:
|
package/dist/bin-http.js
CHANGED
|
@@ -24,6 +24,7 @@ function isHostedArchiveUrl(url) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// src/lib/tool.ts
|
|
27
|
+
import { z } from "zod";
|
|
27
28
|
var registeredToolNames = new Set;
|
|
28
29
|
var serverToolNames = new WeakMap;
|
|
29
30
|
var serverToolFilters = new WeakMap;
|
|
@@ -77,7 +78,10 @@ function defineTool(server, name, description, schema, handler) {
|
|
|
77
78
|
const names = serverToolNames.get(server) ?? new Set;
|
|
78
79
|
names.add(name);
|
|
79
80
|
serverToolNames.set(server, names);
|
|
80
|
-
server.tool(name, description, schema, wrappedHandler);
|
|
81
|
+
const registered = server.tool(name, description, schema, wrappedHandler);
|
|
82
|
+
if (registered) {
|
|
83
|
+
registered.inputSchema = z.strictObject(schema);
|
|
84
|
+
}
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
// src/resources.ts
|
|
@@ -457,19 +461,37 @@ async function buildSamplesResource(contractId, clientProvider = getClient) {
|
|
|
457
461
|
}
|
|
458
462
|
|
|
459
463
|
// src/tools/account.ts
|
|
460
|
-
import { z } from "zod";
|
|
461
|
-
function registerAccountTools(server, request = apiRequest) {
|
|
464
|
+
import { z as z2 } from "zod";
|
|
465
|
+
function registerAccountTools(server, request = apiRequest, currentKey = readApiKey) {
|
|
462
466
|
defineTool(server, "account_whoami", "Show the archive account email at api.secondlayer.tools, not the self-host instance.", {}, async () => {
|
|
463
467
|
const result = await request("GET", "/api/accounts/me");
|
|
464
468
|
return jsonResponse(result);
|
|
465
469
|
});
|
|
466
470
|
defineTool(server, "account_create_key", "Mint an account key (sk-sl_*) for archive credits, quote, and fetch at api.secondlayer.tools. The returned `key` is shown ONCE.", {
|
|
467
|
-
name:
|
|
471
|
+
name: z2.string().optional().describe("Optional label for the key")
|
|
468
472
|
}, async ({ name }) => jsonResponse(await request("POST", "/api/keys", { name })));
|
|
473
|
+
defineTool(server, "account_list_keys", "List this account's active account keys at api.secondlayer.tools: id, prefix, name, last read. Never returns a secret. Use an id with account_rotate_key.", {}, async () => {
|
|
474
|
+
const keys = await activeAccountKeys(request);
|
|
475
|
+
return jsonResponse({ keys });
|
|
476
|
+
});
|
|
477
|
+
defineTool(server, "account_rotate_key", "Replace an account key's secret at api.secondlayer.tools, keeping its name. The old secret gets 401 at once, with no grace period, so everything using it breaks until updated: get human confirmation first. The returned key is shown ONCE. Refuses the key this server runs on.", {
|
|
478
|
+
id: z2.string().uuid().describe("Key id from account_list_keys")
|
|
479
|
+
}, async ({ id }) => {
|
|
480
|
+
const { keys } = await request("GET", "/api/keys");
|
|
481
|
+
const row = keys.find((k) => k.id === id);
|
|
482
|
+
if (row && currentKey()?.startsWith(row.prefix)) {
|
|
483
|
+
throw new Error("This server runs on that key and can't update its own env. Rotate it with the secondlayer CLI or on /account/keys, then restart the server.");
|
|
484
|
+
}
|
|
485
|
+
return jsonResponse(await request("POST", `/api/keys/${id}/rotate`, {}));
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
async function activeAccountKeys(request) {
|
|
489
|
+
const { keys } = await request("GET", "/api/keys");
|
|
490
|
+
return keys.filter((k) => k.status === "active" && k.product === "account").map(({ rowsDaily: _rowsDaily, ...rest }) => rest);
|
|
469
491
|
}
|
|
470
492
|
|
|
471
493
|
// src/tools/archive-cli.ts
|
|
472
|
-
import { z as
|
|
494
|
+
import { z as z3 } from "zod";
|
|
473
495
|
|
|
474
496
|
// src/lib/exec-cli.ts
|
|
475
497
|
import {
|
|
@@ -613,9 +635,9 @@ function cliResponse(result) {
|
|
|
613
635
|
}
|
|
614
636
|
function registerArchiveCliTools(server, exec = execSecondlayer) {
|
|
615
637
|
defineTool(server, "archive_bootstrap", "Restore verified history into this instance (secondlayer bootstrap --against … --yes --json). Metered against the official archive; quote happens inside the CLI. After bootstrap, poll instance_status until decoders ok, then archive_verify, then codegen_index_schema. Do not download parquet.", {
|
|
616
|
-
against:
|
|
617
|
-
fromBlock:
|
|
618
|
-
toBlock:
|
|
638
|
+
against: z3.string().describe("Archive manifest URL"),
|
|
639
|
+
fromBlock: z3.number().int().nonnegative().optional().describe("Restore from this height instead of genesis"),
|
|
640
|
+
toBlock: z3.number().int().nonnegative().optional().describe("Stop at this height instead of the archive tip")
|
|
619
641
|
}, async ({ against, fromBlock, toBlock }) => {
|
|
620
642
|
const args = ["--against", against, "--yes", "--json"];
|
|
621
643
|
if (fromBlock !== undefined)
|
|
@@ -625,10 +647,10 @@ function registerArchiveCliTools(server, exec = execSecondlayer) {
|
|
|
625
647
|
return cliResponse(await exec("bootstrap", args));
|
|
626
648
|
});
|
|
627
649
|
defineTool(server, "archive_repair", "Plan (default) or apply a repair of local chain data against a signed archive. Metered when apply fetches from the official archive. After apply, poll instance_status until decoders ok, then archive_verify. Do not download parquet.", {
|
|
628
|
-
against:
|
|
629
|
-
apply:
|
|
630
|
-
fromBlock:
|
|
631
|
-
toBlock:
|
|
650
|
+
against: z3.string().describe("Archive manifest URL"),
|
|
651
|
+
apply: z3.boolean().optional().describe("Write the repair (default plan-only)"),
|
|
652
|
+
fromBlock: z3.number().int().nonnegative().optional().describe("First height to consider"),
|
|
653
|
+
toBlock: z3.number().int().nonnegative().optional().describe("Last height to consider")
|
|
632
654
|
}, async ({ against, apply, fromBlock, toBlock }) => {
|
|
633
655
|
const args = ["--against", against, "--json"];
|
|
634
656
|
if (apply)
|
|
@@ -642,14 +664,14 @@ function registerArchiveCliTools(server, exec = execSecondlayer) {
|
|
|
642
664
|
}
|
|
643
665
|
|
|
644
666
|
// src/tools/archive.ts
|
|
645
|
-
import { z as
|
|
667
|
+
import { z as z4 } from "zod";
|
|
646
668
|
var FLOW = ["bootstrap", "repair"];
|
|
647
669
|
function registerArchiveTools(server, clientProvider = getClient, archiveOpsClientProvider = getArchiveOpsClient) {
|
|
648
670
|
defineTool(server, "archive_verify", "Read-only, free compare of this instance against a signed archive (POST /v1/archive/verify). unanchored means pin a key or check the URL — not that the instance is fine. After bootstrap, poll instance_status until decoders ok, then this, then codegen_index_schema. Do not download parquet.", {
|
|
649
|
-
against:
|
|
650
|
-
fromBlock:
|
|
651
|
-
toBlock:
|
|
652
|
-
target:
|
|
671
|
+
against: z4.string().describe("Archive manifest URL"),
|
|
672
|
+
fromBlock: z4.number().int().nonnegative().optional().describe("First height (inclusive)"),
|
|
673
|
+
toBlock: z4.number().int().nonnegative().optional().describe("Last height (inclusive)"),
|
|
674
|
+
target: z4.string().optional().describe("Verify target (default raw)")
|
|
653
675
|
}, async ({ against, fromBlock, toBlock, target }) => jsonResponse(await clientProvider().archive.verify({
|
|
654
676
|
against,
|
|
655
677
|
fromBlock,
|
|
@@ -657,11 +679,11 @@ function registerArchiveTools(server, clientProvider = getClient, archiveOpsClie
|
|
|
657
679
|
target
|
|
658
680
|
})));
|
|
659
681
|
defineTool(server, "archive_latest", "Signed pointer to the official archive tree (hosted). Needs SECONDLAYER_API_KEY (sk-sl_*), not INSTANCE_TOKEN. Use the returned origin as --against for archive_bootstrap. Do not download parquet.", {
|
|
660
|
-
against:
|
|
682
|
+
against: z4.string().optional().describe("Override latest.json URL (default official tree)")
|
|
661
683
|
}, async ({ against }) => jsonResponse(await archiveOpsClientProvider().archive.latest(against)));
|
|
662
684
|
defineTool(server, "archive_quote", "Price a hosted archive fetch (metered). Needs SECONDLAYER_API_KEY (sk-sl_*), not INSTANCE_TOKEN. Quote happens here; bootstrap/repair also quote inside the CLI. Do not download parquet.", {
|
|
663
|
-
paths:
|
|
664
|
-
flow:
|
|
685
|
+
paths: z4.array(z4.string()).describe("Partition paths to price"),
|
|
686
|
+
flow: z4.enum(FLOW).describe("bootstrap or repair")
|
|
665
687
|
}, async ({ paths, flow }) => jsonResponse(await archiveOpsClientProvider().archive.quote({ paths, flow })));
|
|
666
688
|
defineTool(server, "credits_balance", "Archive credits balance at api.secondlayer.tools. Needs SECONDLAYER_API_KEY (sk-sl_*); INSTANCE_TOKEN is the instance.", {}, async () => jsonResponse(await archiveOpsClientProvider().archive.credits.balance()));
|
|
667
689
|
}
|
|
@@ -670,14 +692,14 @@ function registerArchiveTools(server, clientProvider = getClient, archiveOpsClie
|
|
|
670
692
|
import {
|
|
671
693
|
generateIndexSchema
|
|
672
694
|
} from "@secondlayer/subgraphs";
|
|
673
|
-
import { z as
|
|
695
|
+
import { z as z5 } from "zod";
|
|
674
696
|
var TARGETS = ["prisma", "kysely", "drizzle", "json-schema"];
|
|
675
697
|
function registerCodegenTools(server) {
|
|
676
698
|
defineTool(server, "codegen_index_schema", "Generate an ORM schema for the Index tables (blocks, transactions, decoded_events, …) — the same output as `sl codegen index`. Returns the file contents as text; write it wherever your project keeps its schema. Use `tables` to emit only what you read.", {
|
|
677
|
-
target:
|
|
678
|
-
tables:
|
|
679
|
-
schemaName:
|
|
680
|
-
datasourceEnv:
|
|
699
|
+
target: z5.enum(TARGETS).optional().describe("Output flavor (default kysely)"),
|
|
700
|
+
tables: z5.array(z5.string()).optional().describe("Restrict to these Index tables (default: all)"),
|
|
701
|
+
schemaName: z5.string().optional().describe("Postgres schema to qualify table names with"),
|
|
702
|
+
datasourceEnv: z5.string().optional().describe("Prisma only: datasource url env var (default DATABASE_URL)")
|
|
681
703
|
}, ({ target, tables, schemaName, datasourceEnv }) => textResponse(generateIndexSchema(target ?? "kysely", {
|
|
682
704
|
tables,
|
|
683
705
|
schemaName,
|
|
@@ -686,17 +708,17 @@ function registerCodegenTools(server) {
|
|
|
686
708
|
}
|
|
687
709
|
|
|
688
710
|
// src/tools/contracts.ts
|
|
689
|
-
import { z as
|
|
711
|
+
import { z as z6 } from "zod";
|
|
690
712
|
function registerContractTools(server, clientProvider = getClient) {
|
|
691
713
|
defineTool(server, "contracts_find", 'Discover deployed Stacks contracts conforming to a trait (e.g. "sip-010", "sip-009", "sip-013"). The discovery endpoint for "which contracts implement X". Reads are public.', {
|
|
692
|
-
trait:
|
|
693
|
-
conformance:
|
|
694
|
-
include:
|
|
695
|
-
limit:
|
|
696
|
-
cursor:
|
|
714
|
+
trait: z6.string().describe('Required. Trait to match (e.g. "sip-010").'),
|
|
715
|
+
conformance: z6.enum(["declared", "inferred", "any"]).optional().describe("declared = parsed from source, inferred = ABI shape-match, any = either (default)"),
|
|
716
|
+
include: z6.literal("abi").optional().describe(`Set to "abi" to include each contract's full ABI`),
|
|
717
|
+
limit: z6.number().optional().describe("Page size, 1–500 (default 100)"),
|
|
718
|
+
cursor: z6.string().optional().describe("Opaque cursor from a prior response's next_cursor")
|
|
697
719
|
}, async (params) => jsonResponse(await clientProvider().contracts.list(params)));
|
|
698
720
|
defineTool(server, "contracts_get_abi", "Fetch a single deployed contract's ABI from the registry (prod-safe). Returns the contract's metadata + full ABI (functions, maps, variables, fungible/non-fungible tokens). Returns not_found if the contract isn't in the registry. Use it to inspect a contract before subgraphs_scaffold.", {
|
|
699
|
-
contractId:
|
|
721
|
+
contractId: z6.string().describe("Fully qualified contract id (e.g. SP….amm-pool-v2-01)")
|
|
700
722
|
}, async ({ contractId }) => {
|
|
701
723
|
const contract = await clientProvider().contracts.get(contractId, {
|
|
702
724
|
includeAbi: true
|
|
@@ -713,17 +735,17 @@ function registerContractTools(server, clientProvider = getClient) {
|
|
|
713
735
|
|
|
714
736
|
// src/tools/index.ts
|
|
715
737
|
import { DECODED_EVENT_TYPES } from "@secondlayer/shared";
|
|
716
|
-
import { z as
|
|
738
|
+
import { z as z7 } from "zod";
|
|
717
739
|
var INDEX_EVENT_TYPES = DECODED_EVENT_TYPES;
|
|
718
740
|
var rangeFilters = {
|
|
719
|
-
contractId:
|
|
720
|
-
fromHeight:
|
|
721
|
-
toHeight:
|
|
722
|
-
cursor:
|
|
723
|
-
limit:
|
|
741
|
+
contractId: z7.string().optional().describe("Filter by contract id"),
|
|
742
|
+
fromHeight: z7.number().optional().describe("Start block height (inclusive)"),
|
|
743
|
+
toHeight: z7.number().optional().describe("End block height (inclusive)"),
|
|
744
|
+
cursor: z7.string().optional().describe("Opaque cursor from a prior response's next_cursor"),
|
|
745
|
+
limit: z7.number().optional().describe("Max rows for this page")
|
|
724
746
|
};
|
|
725
747
|
var orderFilter = {
|
|
726
|
-
order:
|
|
748
|
+
order: z7.enum(["asc", "desc"]).optional().describe("asc (default) reads oldest first; desc reads newest first. A cursor only resumes under the order that issued it.")
|
|
727
749
|
};
|
|
728
750
|
var heightFilters = {
|
|
729
751
|
fromHeight: rangeFilters.fromHeight,
|
|
@@ -735,47 +757,47 @@ function registerIndexTools(server, clientProvider = getClient) {
|
|
|
735
757
|
defineTool(server, "index_ft_transfers", "List decoded SIP-010 fungible-token transfers from Index. Reads are keyless.", {
|
|
736
758
|
...rangeFilters,
|
|
737
759
|
...orderFilter,
|
|
738
|
-
sender:
|
|
739
|
-
recipient:
|
|
740
|
-
assetIdentifier:
|
|
760
|
+
sender: z7.string().optional().describe("Filter by sender principal"),
|
|
761
|
+
recipient: z7.string().optional().describe("Filter by recipient principal"),
|
|
762
|
+
assetIdentifier: z7.string().optional().describe("Filter by asset identifier (contract::asset), e.g. SP…sbtc-token::sbtc-token")
|
|
741
763
|
}, async (params) => jsonResponse(await clientProvider().index.ftTransfers.list(params)));
|
|
742
764
|
defineTool(server, "index_nft_transfers", "List decoded SIP-009 non-fungible-token transfers from Index. Reads are keyless.", {
|
|
743
765
|
...rangeFilters,
|
|
744
766
|
...orderFilter,
|
|
745
|
-
sender:
|
|
746
|
-
recipient:
|
|
747
|
-
assetIdentifier:
|
|
767
|
+
sender: z7.string().optional().describe("Filter by sender principal"),
|
|
768
|
+
recipient: z7.string().optional().describe("Filter by recipient principal"),
|
|
769
|
+
assetIdentifier: z7.string().optional().describe("Filter by asset identifier (contract::asset)")
|
|
748
770
|
}, async (params) => jsonResponse(await clientProvider().index.nftTransfers.list(params)));
|
|
749
771
|
defineTool(server, "index_events", "List decoded chain events from the Index by event type. Use this for event types without a dedicated tool (stx_*, ft_mint/burn, nft_mint/burn, print), and for trait-scoped queries: set `trait` (e.g. sip-010) to match all contracts conforming to a standard — pair with contracts_find to discover traits. For ft/nft transfers without a trait prefer index_ft_transfers / index_nft_transfers.", {
|
|
750
|
-
eventType:
|
|
772
|
+
eventType: z7.enum(INDEX_EVENT_TYPES).describe("Required. Decoded event type to list."),
|
|
751
773
|
...rangeFilters,
|
|
752
774
|
...orderFilter,
|
|
753
|
-
sender:
|
|
754
|
-
recipient:
|
|
755
|
-
assetIdentifier:
|
|
756
|
-
trait:
|
|
757
|
-
txContext:
|
|
775
|
+
sender: z7.string().optional().describe("Filter by sender principal"),
|
|
776
|
+
recipient: z7.string().optional().describe("Filter by recipient principal"),
|
|
777
|
+
assetIdentifier: z7.string().optional().describe("Filter by asset identifier where applicable"),
|
|
778
|
+
trait: z7.string().optional().describe("Match contracts conforming to a trait/standard (e.g. sip-010). Mutually exclusive with contractId; contract-keyed event types only."),
|
|
779
|
+
txContext: z7.boolean().optional().describe("Join the submitting transaction into each event (tx_sender, tx_type, tx_status, tx_contract_id, tx_function_name). For print events it's the only source of the submitting sender.")
|
|
758
780
|
}, async (params) => jsonResponse(await clientProvider().index.events.list(params)));
|
|
759
781
|
defineTool(server, "index_contract_calls", "List decoded contract calls from the Index (function name, args, result). Set `trait` (e.g. sip-010) to match calls to all contracts conforming to a standard. Note: contract-call cursors are a SEPARATE keyspace from event cursors — they are not interchangeable.", {
|
|
760
782
|
...rangeFilters,
|
|
761
|
-
functionName:
|
|
762
|
-
sender:
|
|
763
|
-
trait:
|
|
783
|
+
functionName: z7.string().optional().describe("Filter by called function name"),
|
|
784
|
+
sender: z7.string().optional().describe("Filter by caller principal"),
|
|
785
|
+
trait: z7.string().optional().describe("Match contracts conforming to a trait/standard (e.g. sip-010). Mutually exclusive with contractId.")
|
|
764
786
|
}, async (params) => jsonResponse(await clientProvider().index.contractCalls.list(params)));
|
|
765
787
|
defineTool(server, "index_blocks", "List decoded blocks from Index. Reads are keyless.", { ...heightFilters }, async (params) => jsonResponse(await clientProvider().index.blocks.list(params)));
|
|
766
788
|
defineTool(server, "index_transactions", "List decoded transactions from Index. Filter by type, sender, or contract. Reads are keyless.", {
|
|
767
789
|
...rangeFilters,
|
|
768
|
-
type:
|
|
769
|
-
sender:
|
|
790
|
+
type: z7.string().optional().describe("Filter by transaction type"),
|
|
791
|
+
sender: z7.string().optional().describe("Filter by sender principal")
|
|
770
792
|
}, async (params) => jsonResponse(await clientProvider().index.transactions.list(params)));
|
|
771
793
|
defineTool(server, "index_print_schema", "Empirical per-topic print payload schemas for a contract, inferred from sampled on-chain events: each topic's fields with observed Clarity types, decoded TS types, subgraph column types, and presence rates. Use before writing print_event subgraph handlers to learn what's on e.data. Anonymous read.", {
|
|
772
|
-
contractId:
|
|
794
|
+
contractId: z7.string().describe("Contract id (SP….name) whose print events to profile")
|
|
773
795
|
}, async (params) => jsonResponse(await clientProvider().index.printSchema(params.contractId)));
|
|
774
796
|
defineTool(server, "index_discover", "Discover the Index vocabulary: every event type and its columns, allowed/equality filters, and required-non-null fields (and which types accept `trait`). Read this before building Index queries instead of guessing filters. Anonymous read.", {}, async () => jsonResponse(await clientProvider().index.discover()));
|
|
775
797
|
defineTool(server, "batch_query", "Run up to 10 public /v1 reads in one round trip (POST /v1/batch). Each item keeps its own auth/quota/pay-per-call semantics; results return in order with per-item status. Paths must start with /v1/index, /v1/subgraphs, /v1/streams, or /v1/contracts.", {
|
|
776
|
-
requests:
|
|
777
|
-
path:
|
|
778
|
-
params:
|
|
798
|
+
requests: z7.array(z7.object({
|
|
799
|
+
path: z7.string().describe("Public /v1 read path"),
|
|
800
|
+
params: z7.record(z7.string(), z7.string()).optional()
|
|
779
801
|
})).min(1).max(10).describe("Read descriptors, executed concurrently")
|
|
780
802
|
}, async (params) => jsonResponse(await clientProvider().batch(params.requests)));
|
|
781
803
|
}
|
|
@@ -796,7 +818,7 @@ import {
|
|
|
796
818
|
generateSubgraphCode,
|
|
797
819
|
generateTokenSubgraphFromAbi
|
|
798
820
|
} from "@secondlayer/scaffold";
|
|
799
|
-
import { z as
|
|
821
|
+
import { z as z8 } from "zod";
|
|
800
822
|
async function fetchAbi(clientProvider, contractId) {
|
|
801
823
|
const contract = await clientProvider().contracts.get(contractId, {
|
|
802
824
|
includeAbi: true
|
|
@@ -811,8 +833,8 @@ async function fetchAbi(clientProvider, contractId) {
|
|
|
811
833
|
}
|
|
812
834
|
function registerScaffoldTools(server, clientProvider = getClient) {
|
|
813
835
|
defineTool(server, "subgraphs_scaffold", "Generate a subgraph from observed print events when available; ABI token transfers or public functions only when the contract has never printed. Review the TypeScript, run subgraphs_test until ok: true with written >= 1, read skipped, then subgraphs_deploy. dryRun is DDL only.", {
|
|
814
|
-
contractId:
|
|
815
|
-
subgraphName:
|
|
836
|
+
contractId: z8.string().describe("Fully qualified contract ID (e.g. SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-pool-v2-01)"),
|
|
837
|
+
subgraphName: z8.string().optional().describe("Override the subgraph name (defaults to contract name)")
|
|
816
838
|
}, async ({ contractId, subgraphName }) => {
|
|
817
839
|
const printSchema = await clientProvider().index.printSchema(contractId);
|
|
818
840
|
if (printSchema && printSchema.topics.length > 0) {
|
|
@@ -854,7 +876,7 @@ import { DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2 } from "@secondlayer/shared
|
|
|
854
876
|
import {
|
|
855
877
|
runSubgraphTest
|
|
856
878
|
} from "@secondlayer/subgraphs/testing";
|
|
857
|
-
import { z as
|
|
879
|
+
import { z as z9 } from "zod";
|
|
858
880
|
function eventTypeFor(filter) {
|
|
859
881
|
if (filter.type === "contract_deploy")
|
|
860
882
|
return null;
|
|
@@ -880,13 +902,13 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
880
902
|
const { data } = await clientProvider().subgraphs.list();
|
|
881
903
|
return jsonResponse(data.map(formatSubgraphSummary));
|
|
882
904
|
});
|
|
883
|
-
defineTool(server, "subgraphs_status", "Get full details of a subgraph including schema, health (incl. health.emptyMapping when processed events wrote 0 rows), and table columns.", { name:
|
|
905
|
+
defineTool(server, "subgraphs_status", "Get full details of a subgraph including schema, health (incl. health.emptyMapping when processed events wrote 0 rows), and table columns.", { name: z9.string().describe("Subgraph name") }, async ({ name }) => {
|
|
884
906
|
const detail = await clientProvider().subgraphs.status(name);
|
|
885
907
|
return jsonResponse(detail);
|
|
886
908
|
});
|
|
887
909
|
defineTool(server, "subgraphs_spec", "Fetch a subgraph's self-describing spec — the tables, columns, filters, and read URLs a consumer needs, without guessing. `agent` (default) returns the compact JSON schema built for tool use, `openapi` the OpenAPI document for the subgraph's read routes, `markdown` human-readable docs. Read it before writing queries against an unfamiliar subgraph.", {
|
|
888
|
-
name:
|
|
889
|
-
format:
|
|
910
|
+
name: z9.string().describe("Subgraph name"),
|
|
911
|
+
format: z9.enum(["agent", "openapi", "markdown"]).optional().describe("agent = JSON schema for tool use (default), openapi = OpenAPI JSON, markdown = docs.md")
|
|
890
912
|
}, async ({ name, format }) => {
|
|
891
913
|
const client = clientProvider();
|
|
892
914
|
if (format === "openapi")
|
|
@@ -896,15 +918,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
896
918
|
return jsonResponse(await client.subgraphs.schema(name));
|
|
897
919
|
});
|
|
898
920
|
defineTool(server, "subgraphs_query", 'Query rows from a subgraph table (max 200 rows), reading the open /v1 surface — { rows, next_cursor, tip } envelope, cursor-paginated (no offset). Filters support operators: "amount.gte": "1000", "sender.neq": "SP...", "name.like": "%token%". Available operators: eq, neq, gt, gte, lt, lte, like. Every page with rows returns next_cursor (null only when empty): pass it back as `cursor` to read the next page. To TAIL new rows (no streaming over MCP), poll with cursor = next_cursor ?? the cursor you sent. Fetch one row by id with {"_id": "<id>"}. The same rows are readable over HTTP at GET /v1/subgraphs/<name>/<table>; hand that URL to third parties.', {
|
|
899
|
-
name:
|
|
900
|
-
table:
|
|
901
|
-
filters:
|
|
902
|
-
sort:
|
|
903
|
-
order:
|
|
904
|
-
limit:
|
|
905
|
-
cursor:
|
|
906
|
-
fields:
|
|
907
|
-
count:
|
|
921
|
+
name: z9.string().describe("Subgraph name"),
|
|
922
|
+
table: z9.string().describe("Table name"),
|
|
923
|
+
filters: z9.record(z9.string(), z9.string()).optional().describe('Column filters — plain values or with operators (e.g. {"amount.gte": "1000", "sender": "SP..."})'),
|
|
924
|
+
sort: z9.string().optional().describe("Column to sort by"),
|
|
925
|
+
order: z9.enum(["asc", "desc"]).optional().describe("Sort order"),
|
|
926
|
+
limit: z9.number().max(200).optional().describe("Max rows (default 50, max 200)"),
|
|
927
|
+
cursor: z9.string().optional().describe("Resume from a previous response's nextCursor"),
|
|
928
|
+
fields: z9.string().optional().describe('Comma-separated column list to return (e.g. "sender,amount")'),
|
|
929
|
+
count: z9.boolean().optional().describe("If true, return row count instead of rows")
|
|
908
930
|
}, async ({
|
|
909
931
|
name,
|
|
910
932
|
table,
|
|
@@ -934,15 +956,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
934
956
|
return jsonResponse({ ...capped, nextCursor: next_cursor, tip });
|
|
935
957
|
});
|
|
936
958
|
defineTool(server, "subgraphs_reindex", "Reindex a subgraph: drops and rebuilds the whole subgraph from its start block to chain tip. Takes no block range — use subgraphs_backfill to process a specific range. Returns an operationId — check subgraphs_status (health) or the REST operations endpoint to track progress to completion.", {
|
|
937
|
-
name:
|
|
959
|
+
name: z9.string().describe("Subgraph name")
|
|
938
960
|
}, async ({ name }) => {
|
|
939
961
|
const result = await clientProvider().subgraphs.reindex(name);
|
|
940
962
|
return jsonResponse(result);
|
|
941
963
|
});
|
|
942
964
|
defineTool(server, "subgraphs_backfill", "Backfill a subgraph over a block range. Non-destructive forward fill (does not drop existing data) — unlike subgraphs_reindex, and the only data-fill path for BYO subgraphs (reindex is blocked there). Both blocks required. Returns an operationId — check subgraphs_status (health) or the REST operations endpoint to track progress.", {
|
|
943
|
-
name:
|
|
944
|
-
fromBlock:
|
|
945
|
-
toBlock:
|
|
965
|
+
name: z9.string().describe("Subgraph name"),
|
|
966
|
+
fromBlock: z9.number().int().nonnegative().describe("Start block (inclusive)"),
|
|
967
|
+
toBlock: z9.number().int().nonnegative().describe("End block (inclusive)")
|
|
946
968
|
}, async ({ name, fromBlock, toBlock }) => {
|
|
947
969
|
const result = await clientProvider().subgraphs.backfill(name, {
|
|
948
970
|
fromBlock,
|
|
@@ -950,15 +972,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
950
972
|
});
|
|
951
973
|
return jsonResponse(result);
|
|
952
974
|
});
|
|
953
|
-
defineTool(server, "subgraphs_stop", "Cancel an in-flight reindex or backfill operation for a subgraph. Returns the stop request status; check subgraphs_status (health) or the REST operations endpoint to confirm it reaches a terminal state.", { name:
|
|
975
|
+
defineTool(server, "subgraphs_stop", "Cancel an in-flight reindex or backfill operation for a subgraph. Returns the stop request status; check subgraphs_status (health) or the REST operations endpoint to confirm it reaches a terminal state.", { name: z9.string().describe("Subgraph name") }, async ({ name }) => {
|
|
954
976
|
const result = await clientProvider().subgraphs.stop(name);
|
|
955
977
|
return jsonResponse(result);
|
|
956
978
|
});
|
|
957
979
|
defineTool(server, "subgraphs_gaps", "List indexing gaps (missing block ranges) for a subgraph. Each gap reports start/end/size, reason, and detected/resolved timestamps. Feed an unresolved gap's range into subgraphs_backfill to fill it. Defaults to unresolved gaps.", {
|
|
958
|
-
name:
|
|
959
|
-
limit:
|
|
960
|
-
offset:
|
|
961
|
-
resolved:
|
|
980
|
+
name: z9.string().describe("Subgraph name"),
|
|
981
|
+
limit: z9.number().int().positive().optional().describe("Max gaps to return"),
|
|
982
|
+
offset: z9.number().int().nonnegative().optional().describe("Pagination offset"),
|
|
983
|
+
resolved: z9.boolean().optional().describe("Filter by resolved state (omit for unresolved only)")
|
|
962
984
|
}, async ({ name, limit, offset, resolved }) => {
|
|
963
985
|
const result = await clientProvider().subgraphs.gaps(name, {
|
|
964
986
|
limit,
|
|
@@ -968,20 +990,20 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
968
990
|
return jsonResponse(result);
|
|
969
991
|
});
|
|
970
992
|
defineTool(server, "subgraphs_operations", "Operation history for a subgraph (deploy/reindex/backfill/stop), newest first — status, block range, progress, and error. THIS IS THE VERIFY CALL: after subgraphs_deploy, subgraphs_reindex, subgraphs_backfill, or subgraphs_stop, poll it with the returned operationId until `status` is terminal (completed/failed/cancelled) before reporting success. Omit operationId for the recent history.", {
|
|
971
|
-
name:
|
|
972
|
-
operationId:
|
|
993
|
+
name: z9.string().describe("Subgraph name"),
|
|
994
|
+
operationId: z9.string().optional().describe("Fetch one operation by id (the operationId returned by reindex/backfill/stop); omit for recent history")
|
|
973
995
|
}, async ({ name, operationId }) => {
|
|
974
996
|
const client = clientProvider();
|
|
975
997
|
return jsonResponse(operationId ? await client.subgraphs.getOperation(name, operationId) : await client.subgraphs.operations(name));
|
|
976
998
|
});
|
|
977
|
-
defineTool(server, "subgraphs_delete", "Delete a subgraph permanently.", { name:
|
|
999
|
+
defineTool(server, "subgraphs_delete", "Delete a subgraph permanently.", { name: z9.string().describe("Subgraph name") }, async ({ name }) => {
|
|
978
1000
|
const result = await clientProvider().subgraphs.delete(name);
|
|
979
1001
|
return textResponse(result.message);
|
|
980
1002
|
});
|
|
981
1003
|
defineTool(server, "subgraphs_deploy", "Deploy a subgraph from TypeScript code. Pass the full defineSubgraph() source — it will be bundled, validated, and deployed. Optional startBlock overrides the source definition for this deploy. dryRun validates schema/DDL only and does not run handlers — call subgraphs_test first and deploy only when it returns ok: true with written >= 1. Call subgraphs_reindex separately if you need a forced reindex.", {
|
|
982
|
-
code:
|
|
983
|
-
startBlock:
|
|
984
|
-
dryRun:
|
|
1004
|
+
code: z9.string().describe("TypeScript source code containing a defineSubgraph() call"),
|
|
1005
|
+
startBlock: z9.number().int().nonnegative().optional().describe("Override the definition startBlock for this deploy"),
|
|
1006
|
+
dryRun: z9.boolean().optional().describe("Validate schema/DDL only — does not run handlers. Use subgraphs_test to prove a mapping writes rows.")
|
|
985
1007
|
}, async ({ code, startBlock, dryRun }) => {
|
|
986
1008
|
const bundled = await bundleSubgraphCode(code);
|
|
987
1009
|
const result = await clientProvider().subgraphs.deploy({
|
|
@@ -997,10 +1019,10 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
997
1019
|
return jsonResponse(result);
|
|
998
1020
|
});
|
|
999
1021
|
defineTool(server, "subgraphs_test", "Prove a subgraph mapping writes rows against Index data before deploy. Pass full defineSubgraph() source plus a height range. Returns ok/written/tables; EMPTY_MAPPING means events matched but 0 rows were written — read hint for observed event.data keys and do not invent fields. subgraphs_deploy dryRun is DDL only; do not deploy until ok: true with written >= 1.", {
|
|
1000
|
-
code:
|
|
1001
|
-
fromHeight:
|
|
1002
|
-
toHeight:
|
|
1003
|
-
limit:
|
|
1022
|
+
code: z9.string().describe("TypeScript source containing a defineSubgraph() call"),
|
|
1023
|
+
fromHeight: z9.number().int().nonnegative().describe("Start block height (inclusive)"),
|
|
1024
|
+
toHeight: z9.number().int().nonnegative().optional().describe("End block height (inclusive); default fromHeight+100"),
|
|
1025
|
+
limit: z9.number().int().positive().max(200).optional().describe("Max Index rows per source (default 50, max 200)")
|
|
1004
1026
|
}, async ({ code, fromHeight, toHeight, limit }) => {
|
|
1005
1027
|
const bundled = await bundleSubgraphCode(code);
|
|
1006
1028
|
const def = await loadBundledDefinition(bundled.handlerCode);
|
|
@@ -1081,36 +1103,36 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
1081
1103
|
|
|
1082
1104
|
// src/tools/webhooks.ts
|
|
1083
1105
|
import { CHAIN_TRIGGER_TYPES } from "@secondlayer/shared";
|
|
1084
|
-
import { z as
|
|
1106
|
+
import { z as z10 } from "zod";
|
|
1085
1107
|
function registerWebhookTools(server, clientProvider = getClient) {
|
|
1086
1108
|
defineTool(server, "webhooks_list", "List all webhooks for the current account. Returns summary fields (no secrets).", {}, async () => {
|
|
1087
1109
|
const { data } = await clientProvider().webhooks.list();
|
|
1088
1110
|
return jsonResponse(data);
|
|
1089
1111
|
});
|
|
1090
|
-
defineTool(server, "webhooks_get", "Get full detail for a webhook (triggers, auth, retry config, circuit state).", { id:
|
|
1112
|
+
defineTool(server, "webhooks_get", "Get full detail for a webhook (triggers, auth, retry config, circuit state).", { id: z10.string().describe("Webhook id") }, async ({ id }) => {
|
|
1091
1113
|
const detail = await clientProvider().webhooks.get(id);
|
|
1092
1114
|
return jsonResponse(detail);
|
|
1093
1115
|
});
|
|
1094
1116
|
defineTool(server, "webhooks_create", "Create a webhook that fires on raw chain events (set triggers). Returns `signingSecret` ONCE — forward it to the user so they can wire it into their receiver.", {
|
|
1095
|
-
name:
|
|
1096
|
-
triggers:
|
|
1097
|
-
type:
|
|
1098
|
-
contractId:
|
|
1099
|
-
functionName:
|
|
1100
|
-
caller:
|
|
1101
|
-
sender:
|
|
1102
|
-
recipient:
|
|
1103
|
-
assetIdentifier:
|
|
1104
|
-
deployer:
|
|
1105
|
-
contractName:
|
|
1106
|
-
topic:
|
|
1107
|
-
lockedAddress:
|
|
1108
|
-
trait:
|
|
1109
|
-
minAmount:
|
|
1110
|
-
maxAmount:
|
|
1117
|
+
name: z10.string().describe("Human-readable name, unique per account"),
|
|
1118
|
+
triggers: z10.array(z10.object({
|
|
1119
|
+
type: z10.enum(CHAIN_TRIGGER_TYPES),
|
|
1120
|
+
contractId: z10.string().optional(),
|
|
1121
|
+
functionName: z10.string().optional(),
|
|
1122
|
+
caller: z10.string().optional(),
|
|
1123
|
+
sender: z10.string().optional(),
|
|
1124
|
+
recipient: z10.string().optional(),
|
|
1125
|
+
assetIdentifier: z10.string().optional(),
|
|
1126
|
+
deployer: z10.string().optional(),
|
|
1127
|
+
contractName: z10.string().optional(),
|
|
1128
|
+
topic: z10.string().optional(),
|
|
1129
|
+
lockedAddress: z10.string().optional(),
|
|
1130
|
+
trait: z10.string().optional(),
|
|
1131
|
+
minAmount: z10.union([z10.string(), z10.number()]).optional(),
|
|
1132
|
+
maxAmount: z10.union([z10.string(), z10.number()]).optional()
|
|
1111
1133
|
})).describe("Chain triggers. Each targets a raw chain event/tx; string fields accept `*` wildcards, `trait` scopes to a SIP/trait. Per-type accepted fields: see the secondlayer://chain-triggers resource. Forward-looking: starts at chain tip, no backfill."),
|
|
1112
|
-
url:
|
|
1113
|
-
format:
|
|
1134
|
+
url: z10.string().describe("Webhook URL"),
|
|
1135
|
+
format: z10.enum([
|
|
1114
1136
|
"standard-webhooks",
|
|
1115
1137
|
"inngest",
|
|
1116
1138
|
"trigger",
|
|
@@ -1118,17 +1140,17 @@ function registerWebhookTools(server, clientProvider = getClient) {
|
|
|
1118
1140
|
"cloudevents",
|
|
1119
1141
|
"raw"
|
|
1120
1142
|
]).optional().describe("Wire format (default standard-webhooks)"),
|
|
1121
|
-
authConfig:
|
|
1143
|
+
authConfig: z10.record(z10.string(), z10.unknown()).optional().describe('Receiver auth sent with each delivery, e.g. {"type": "bearer", "token": "..."}')
|
|
1122
1144
|
}, async (input) => {
|
|
1123
1145
|
const res = await clientProvider().webhooks.create(input);
|
|
1124
1146
|
return jsonResponse(res);
|
|
1125
1147
|
});
|
|
1126
1148
|
defineTool(server, "webhooks_update", "Patch a webhook (name, url, authConfig, format, retry, timeout, concurrency).", {
|
|
1127
|
-
id:
|
|
1128
|
-
name:
|
|
1129
|
-
url:
|
|
1130
|
-
authConfig:
|
|
1131
|
-
format:
|
|
1149
|
+
id: z10.string(),
|
|
1150
|
+
name: z10.string().optional().describe("Rename the webhook"),
|
|
1151
|
+
url: z10.string().optional(),
|
|
1152
|
+
authConfig: z10.record(z10.string(), z10.unknown()).optional().describe("Receiver auth sent with each delivery (bearer/etc.)"),
|
|
1153
|
+
format: z10.enum([
|
|
1132
1154
|
"standard-webhooks",
|
|
1133
1155
|
"inngest",
|
|
1134
1156
|
"trigger",
|
|
@@ -1136,35 +1158,35 @@ function registerWebhookTools(server, clientProvider = getClient) {
|
|
|
1136
1158
|
"cloudevents",
|
|
1137
1159
|
"raw"
|
|
1138
1160
|
]).optional(),
|
|
1139
|
-
maxRetries:
|
|
1140
|
-
timeoutMs:
|
|
1141
|
-
concurrency:
|
|
1161
|
+
maxRetries: z10.number().int().min(0).optional(),
|
|
1162
|
+
timeoutMs: z10.number().int().min(100).optional(),
|
|
1163
|
+
concurrency: z10.number().int().min(1).optional()
|
|
1142
1164
|
}, async ({ id, ...patch }) => {
|
|
1143
1165
|
const res = await clientProvider().webhooks.update(id, patch);
|
|
1144
1166
|
return jsonResponse(res);
|
|
1145
1167
|
});
|
|
1146
|
-
defineTool(server, "webhooks_delete", "Delete a webhook. Pending outbox rows are cascade-deleted.", { id:
|
|
1168
|
+
defineTool(server, "webhooks_delete", "Delete a webhook. Pending outbox rows are cascade-deleted.", { id: z10.string() }, async ({ id }) => {
|
|
1147
1169
|
const res = await clientProvider().webhooks.delete(id);
|
|
1148
1170
|
return jsonResponse(res);
|
|
1149
1171
|
});
|
|
1150
|
-
defineTool(server, "webhooks_test", "Send a one-off test webhook to a webhook's URL (built for its format, SSRF-guarded). Logged as a delivery row. Returns {ok, statusCode, error, durationMs, deliveryId}.", { id:
|
|
1172
|
+
defineTool(server, "webhooks_test", "Send a one-off test webhook to a webhook's URL (built for its format, SSRF-guarded). Logged as a delivery row. Returns {ok, statusCode, error, durationMs, deliveryId}.", { id: z10.string().describe("Webhook id") }, async ({ id }) => {
|
|
1151
1173
|
const res = await clientProvider().webhooks.test(id);
|
|
1152
1174
|
return jsonResponse(res);
|
|
1153
1175
|
});
|
|
1154
|
-
defineTool(server, "webhooks_pause", "Pause a webhook: stops delivery attempts and stops queueing new ones. Nothing is deleted — resume picks the webhook back up from the tip. Verify with webhooks_get (status).", { id:
|
|
1155
|
-
defineTool(server, "webhooks_resume", "Resume a paused webhook (also clears a tripped circuit breaker). Deliveries restart from the current tip — use webhooks_replay for the blocks missed while paused. Verify with webhooks_get (status).", { id:
|
|
1156
|
-
defineTool(server, "webhooks_rotate_secret", "Rotate a webhook's signing secret. Returns the NEW `signingSecret` ONCE — forward it to the user; deliveries signed with the old secret stop verifying as soon as this returns, so the receiver must be updated.", { id:
|
|
1157
|
-
defineTool(server, "webhooks_deliveries", "List recent delivery attempts for a webhook — status code, attempt count, error, duration, timestamps. THIS IS THE VERIFY CALL: after webhooks_create, webhooks_test, or webhooks_replay, read it to confirm the webhook actually landed (and to see the receiver's response when it didn't) instead of trusting the enqueue result.", { id:
|
|
1158
|
-
defineTool(server, "webhooks_dead", "List a webhook's dead-letter queue — deliveries that exhausted their retries, with the outbox id, payload, and last error. Diagnose the receiver first (webhooks_get for the URL/auth, webhooks_test for a live probe), then requeue rows with webhooks_requeue.", { id:
|
|
1176
|
+
defineTool(server, "webhooks_pause", "Pause a webhook: stops delivery attempts and stops queueing new ones. Nothing is deleted — resume picks the webhook back up from the tip. Verify with webhooks_get (status).", { id: z10.string().describe("Webhook id") }, async ({ id }) => jsonResponse(await clientProvider().webhooks.pause(id)));
|
|
1177
|
+
defineTool(server, "webhooks_resume", "Resume a paused webhook (also clears a tripped circuit breaker). Deliveries restart from the current tip — use webhooks_replay for the blocks missed while paused. Verify with webhooks_get (status).", { id: z10.string().describe("Webhook id") }, async ({ id }) => jsonResponse(await clientProvider().webhooks.resume(id)));
|
|
1178
|
+
defineTool(server, "webhooks_rotate_secret", "Rotate a webhook's signing secret. Returns the NEW `signingSecret` ONCE — forward it to the user; deliveries signed with the old secret stop verifying as soon as this returns, so the receiver must be updated.", { id: z10.string().describe("Webhook id") }, async ({ id }) => jsonResponse(await clientProvider().webhooks.rotateSecret(id)));
|
|
1179
|
+
defineTool(server, "webhooks_deliveries", "List recent delivery attempts for a webhook — status code, attempt count, error, duration, timestamps. THIS IS THE VERIFY CALL: after webhooks_create, webhooks_test, or webhooks_replay, read it to confirm the webhook actually landed (and to see the receiver's response when it didn't) instead of trusting the enqueue result.", { id: z10.string().describe("Webhook id") }, async ({ id }) => jsonResponse(await clientProvider().webhooks.deliveries(id)));
|
|
1180
|
+
defineTool(server, "webhooks_dead", "List a webhook's dead-letter queue — deliveries that exhausted their retries, with the outbox id, payload, and last error. Diagnose the receiver first (webhooks_get for the URL/auth, webhooks_test for a live probe), then requeue rows with webhooks_requeue.", { id: z10.string().describe("Webhook id") }, async ({ id }) => jsonResponse(await clientProvider().webhooks.dead(id)));
|
|
1159
1181
|
defineTool(server, "webhooks_requeue", "Requeue ONE dead-lettered delivery for another attempt, by its outbox id from webhooks_dead. Fix the receiver first — a requeue against a still-broken endpoint just dies again. Verify with webhooks_deliveries.", {
|
|
1160
|
-
id:
|
|
1161
|
-
outboxId:
|
|
1182
|
+
id: z10.string().describe("Webhook id"),
|
|
1183
|
+
outboxId: z10.string().describe("Outbox id of the dead delivery (from webhooks_dead)")
|
|
1162
1184
|
}, async ({ id, outboxId }) => jsonResponse(await clientProvider().webhooks.requeue(id, outboxId)));
|
|
1163
1185
|
defineTool(server, "webhooks_replay", "Replay a block range for a webhook. Replays run at 10% of batch capacity — use sparingly. Pass `force` (a short idempotency suffix) to re-run a range that was already replayed.", {
|
|
1164
|
-
id:
|
|
1165
|
-
fromBlock:
|
|
1166
|
-
toBlock:
|
|
1167
|
-
force:
|
|
1186
|
+
id: z10.string(),
|
|
1187
|
+
fromBlock: z10.number().int().nonnegative(),
|
|
1188
|
+
toBlock: z10.number().int().nonnegative(),
|
|
1189
|
+
force: z10.string().optional().describe("Idempotency suffix to force a duplicate replay of the range")
|
|
1168
1190
|
}, async ({ id, fromBlock, toBlock, force }) => {
|
|
1169
1191
|
const res = await clientProvider().webhooks.replay(id, {
|
|
1170
1192
|
fromBlock,
|
|
@@ -1362,5 +1384,5 @@ httpServer.listen(port, () => {
|
|
|
1362
1384
|
console.error("Warning: SECONDLAYER_MCP_SECRET not set, authentication disabled");
|
|
1363
1385
|
});
|
|
1364
1386
|
|
|
1365
|
-
//# debugId=
|
|
1387
|
+
//# debugId=2D47CECF2113416564756E2164756E21
|
|
1366
1388
|
//# sourceMappingURL=bin-http.js.map
|