@secondlayer/mcp 11.6.1 → 11.6.2
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/dist/bin-http.js +83 -74
- package/dist/bin-http.js.map +6 -5
- package/dist/bin.js +83 -74
- package/dist/bin.js.map +6 -5
- package/dist/index.js +83 -74
- package/dist/index.js.map +6 -5
- package/package.json +3 -3
package/dist/bin-http.js
CHANGED
|
@@ -919,7 +919,16 @@ import { DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2 } from "@secondlayer/shared
|
|
|
919
919
|
import {
|
|
920
920
|
runSubgraphTest
|
|
921
921
|
} from "@secondlayer/subgraphs/testing";
|
|
922
|
+
import { z as z10 } from "zod";
|
|
923
|
+
|
|
924
|
+
// src/lib/ids.ts
|
|
922
925
|
import { z as z9 } from "zod";
|
|
926
|
+
var uuidSchema = z9.string().uuid();
|
|
927
|
+
var webhookIdSchema = uuidSchema.describe("Webhook id");
|
|
928
|
+
var subgraphNameSchema = z9.string().min(1).max(63).regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").describe("Subgraph name");
|
|
929
|
+
var tableNameSchema = z9.string().min(1).max(63).regex(/^[a-z_][a-z0-9_]*$/i, "letters, digits and underscores only").describe("Table name");
|
|
930
|
+
|
|
931
|
+
// src/tools/subgraphs.ts
|
|
923
932
|
function eventTypeFor(filter) {
|
|
924
933
|
if (filter.type === "contract_deploy")
|
|
925
934
|
return null;
|
|
@@ -945,13 +954,13 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
945
954
|
const { data } = await clientProvider().subgraphs.list();
|
|
946
955
|
return jsonResponse(data.map(formatSubgraphSummary));
|
|
947
956
|
});
|
|
948
|
-
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:
|
|
957
|
+
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: subgraphNameSchema }, async ({ name }) => {
|
|
949
958
|
const detail = await clientProvider().subgraphs.status(name);
|
|
950
959
|
return jsonResponse(detail);
|
|
951
960
|
});
|
|
952
961
|
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.", {
|
|
953
|
-
name:
|
|
954
|
-
format:
|
|
962
|
+
name: subgraphNameSchema,
|
|
963
|
+
format: z10.enum(["agent", "openapi", "markdown"]).optional().describe("agent = JSON schema for tool use (default), openapi = OpenAPI JSON, markdown = docs.md")
|
|
955
964
|
}, async ({ name, format }) => {
|
|
956
965
|
const client = clientProvider();
|
|
957
966
|
if (format === "openapi")
|
|
@@ -961,15 +970,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
961
970
|
return jsonResponse(await client.subgraphs.schema(name));
|
|
962
971
|
});
|
|
963
972
|
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.', {
|
|
964
|
-
name:
|
|
965
|
-
table:
|
|
966
|
-
filters:
|
|
967
|
-
sort:
|
|
968
|
-
order:
|
|
969
|
-
limit:
|
|
970
|
-
cursor:
|
|
971
|
-
fields:
|
|
972
|
-
count:
|
|
973
|
+
name: subgraphNameSchema,
|
|
974
|
+
table: tableNameSchema,
|
|
975
|
+
filters: z10.record(z10.string(), z10.string()).optional().describe('Column filters — plain values or with operators (e.g. {"amount.gte": "1000", "sender": "SP..."})'),
|
|
976
|
+
sort: z10.string().optional().describe("Column to sort by"),
|
|
977
|
+
order: z10.enum(["asc", "desc"]).optional().describe("Sort order"),
|
|
978
|
+
limit: z10.number().max(200).optional().describe("Max rows (default 50, max 200)"),
|
|
979
|
+
cursor: z10.string().optional().describe("Resume from a previous response's nextCursor"),
|
|
980
|
+
fields: z10.string().optional().describe('Comma-separated column list to return (e.g. "sender,amount")'),
|
|
981
|
+
count: z10.boolean().optional().describe("If true, return row count instead of rows")
|
|
973
982
|
}, async ({
|
|
974
983
|
name,
|
|
975
984
|
table,
|
|
@@ -999,15 +1008,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
999
1008
|
return jsonResponse({ ...capped, nextCursor: next_cursor, tip });
|
|
1000
1009
|
});
|
|
1001
1010
|
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.", {
|
|
1002
|
-
name:
|
|
1011
|
+
name: subgraphNameSchema
|
|
1003
1012
|
}, async ({ name }) => {
|
|
1004
1013
|
const result = await clientProvider().subgraphs.reindex(name);
|
|
1005
1014
|
return jsonResponse(result);
|
|
1006
1015
|
});
|
|
1007
1016
|
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.", {
|
|
1008
|
-
name:
|
|
1009
|
-
fromBlock:
|
|
1010
|
-
toBlock:
|
|
1017
|
+
name: subgraphNameSchema,
|
|
1018
|
+
fromBlock: z10.number().int().nonnegative().describe("Start block (inclusive)"),
|
|
1019
|
+
toBlock: z10.number().int().nonnegative().describe("End block (inclusive)")
|
|
1011
1020
|
}, async ({ name, fromBlock, toBlock }) => {
|
|
1012
1021
|
const result = await clientProvider().subgraphs.backfill(name, {
|
|
1013
1022
|
fromBlock,
|
|
@@ -1015,15 +1024,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
1015
1024
|
});
|
|
1016
1025
|
return jsonResponse(result);
|
|
1017
1026
|
});
|
|
1018
|
-
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:
|
|
1027
|
+
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: subgraphNameSchema }, async ({ name }) => {
|
|
1019
1028
|
const result = await clientProvider().subgraphs.stop(name);
|
|
1020
1029
|
return jsonResponse(result);
|
|
1021
1030
|
});
|
|
1022
1031
|
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.", {
|
|
1023
|
-
name:
|
|
1024
|
-
limit:
|
|
1025
|
-
offset:
|
|
1026
|
-
resolved:
|
|
1032
|
+
name: subgraphNameSchema,
|
|
1033
|
+
limit: z10.number().int().positive().optional().describe("Max gaps to return"),
|
|
1034
|
+
offset: z10.number().int().nonnegative().optional().describe("Pagination offset"),
|
|
1035
|
+
resolved: z10.boolean().optional().describe("Filter by resolved state (omit for unresolved only)")
|
|
1027
1036
|
}, async ({ name, limit, offset, resolved }) => {
|
|
1028
1037
|
const result = await clientProvider().subgraphs.gaps(name, {
|
|
1029
1038
|
limit,
|
|
@@ -1033,20 +1042,20 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
1033
1042
|
return jsonResponse(result);
|
|
1034
1043
|
});
|
|
1035
1044
|
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.", {
|
|
1036
|
-
name:
|
|
1037
|
-
operationId:
|
|
1045
|
+
name: subgraphNameSchema,
|
|
1046
|
+
operationId: z10.string().optional().describe("Fetch one operation by id (the operationId returned by reindex/backfill/stop); omit for recent history")
|
|
1038
1047
|
}, async ({ name, operationId }) => {
|
|
1039
1048
|
const client = clientProvider();
|
|
1040
1049
|
return jsonResponse(operationId ? await client.subgraphs.getOperation(name, operationId) : await client.subgraphs.operations(name));
|
|
1041
1050
|
});
|
|
1042
|
-
defineTool(server, "subgraphs_delete", "Delete a subgraph permanently.", { name:
|
|
1051
|
+
defineTool(server, "subgraphs_delete", "Delete a subgraph permanently.", { name: subgraphNameSchema }, async ({ name }) => {
|
|
1043
1052
|
const result = await clientProvider().subgraphs.delete(name);
|
|
1044
1053
|
return textResponse(result.message);
|
|
1045
1054
|
});
|
|
1046
1055
|
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.", {
|
|
1047
|
-
code:
|
|
1048
|
-
startBlock:
|
|
1049
|
-
dryRun:
|
|
1056
|
+
code: z10.string().describe("TypeScript source code containing a defineSubgraph() call"),
|
|
1057
|
+
startBlock: z10.number().int().nonnegative().optional().describe("Override the definition startBlock for this deploy"),
|
|
1058
|
+
dryRun: z10.boolean().optional().describe("Validate schema/DDL only — does not run handlers. Use subgraphs_test to prove a mapping writes rows.")
|
|
1050
1059
|
}, async ({ code, startBlock, dryRun }) => {
|
|
1051
1060
|
const bundled = await bundleSubgraphCode(code);
|
|
1052
1061
|
const result = await clientProvider().subgraphs.deploy({
|
|
@@ -1062,10 +1071,10 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
1062
1071
|
return jsonResponse(result);
|
|
1063
1072
|
});
|
|
1064
1073
|
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.", {
|
|
1065
|
-
code:
|
|
1066
|
-
fromHeight:
|
|
1067
|
-
toHeight:
|
|
1068
|
-
limit:
|
|
1074
|
+
code: z10.string().describe("TypeScript source containing a defineSubgraph() call"),
|
|
1075
|
+
fromHeight: z10.number().int().nonnegative().describe("Start block height (inclusive)"),
|
|
1076
|
+
toHeight: z10.number().int().nonnegative().optional().describe("End block height (inclusive); default fromHeight+100"),
|
|
1077
|
+
limit: z10.number().int().positive().max(200).optional().describe("Max Index rows per source (default 50, max 200)")
|
|
1069
1078
|
}, async ({ code, fromHeight, toHeight, limit }) => {
|
|
1070
1079
|
const bundled = await bundleSubgraphCode(code);
|
|
1071
1080
|
const def = await loadBundledDefinition(bundled.handlerCode);
|
|
@@ -1146,36 +1155,36 @@ function registerSubgraphTools(server, clientProvider = getClient) {
|
|
|
1146
1155
|
|
|
1147
1156
|
// src/tools/webhooks.ts
|
|
1148
1157
|
import { CHAIN_TRIGGER_TYPES } from "@secondlayer/shared";
|
|
1149
|
-
import { z as
|
|
1158
|
+
import { z as z11 } from "zod";
|
|
1150
1159
|
function registerWebhookTools(server, clientProvider = getClient) {
|
|
1151
1160
|
defineTool(server, "webhooks_list", "List all webhooks for the current account. Returns summary fields (no secrets).", {}, async () => {
|
|
1152
1161
|
const { data } = await clientProvider().webhooks.list();
|
|
1153
1162
|
return jsonResponse(data);
|
|
1154
1163
|
});
|
|
1155
|
-
defineTool(server, "webhooks_get", "Get full detail for a webhook (triggers, auth, retry config, circuit state).", { id:
|
|
1164
|
+
defineTool(server, "webhooks_get", "Get full detail for a webhook (triggers, auth, retry config, circuit state).", { id: webhookIdSchema }, async ({ id }) => {
|
|
1156
1165
|
const detail = await clientProvider().webhooks.get(id);
|
|
1157
1166
|
return jsonResponse(detail);
|
|
1158
1167
|
});
|
|
1159
1168
|
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.", {
|
|
1160
|
-
name:
|
|
1161
|
-
triggers:
|
|
1162
|
-
type:
|
|
1163
|
-
contractId:
|
|
1164
|
-
functionName:
|
|
1165
|
-
caller:
|
|
1166
|
-
sender:
|
|
1167
|
-
recipient:
|
|
1168
|
-
assetIdentifier:
|
|
1169
|
-
deployer:
|
|
1170
|
-
contractName:
|
|
1171
|
-
topic:
|
|
1172
|
-
lockedAddress:
|
|
1173
|
-
trait:
|
|
1174
|
-
minAmount:
|
|
1175
|
-
maxAmount:
|
|
1169
|
+
name: z11.string().describe("Human-readable name, unique per account"),
|
|
1170
|
+
triggers: z11.array(z11.object({
|
|
1171
|
+
type: z11.enum(CHAIN_TRIGGER_TYPES),
|
|
1172
|
+
contractId: z11.string().optional(),
|
|
1173
|
+
functionName: z11.string().optional(),
|
|
1174
|
+
caller: z11.string().optional(),
|
|
1175
|
+
sender: z11.string().optional(),
|
|
1176
|
+
recipient: z11.string().optional(),
|
|
1177
|
+
assetIdentifier: z11.string().optional(),
|
|
1178
|
+
deployer: z11.string().optional(),
|
|
1179
|
+
contractName: z11.string().optional(),
|
|
1180
|
+
topic: z11.string().optional(),
|
|
1181
|
+
lockedAddress: z11.string().optional(),
|
|
1182
|
+
trait: z11.string().optional(),
|
|
1183
|
+
minAmount: z11.union([z11.string(), z11.number()]).optional(),
|
|
1184
|
+
maxAmount: z11.union([z11.string(), z11.number()]).optional()
|
|
1176
1185
|
})).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."),
|
|
1177
|
-
url:
|
|
1178
|
-
format:
|
|
1186
|
+
url: z11.string().describe("Webhook URL"),
|
|
1187
|
+
format: z11.enum([
|
|
1179
1188
|
"standard-webhooks",
|
|
1180
1189
|
"inngest",
|
|
1181
1190
|
"trigger",
|
|
@@ -1183,17 +1192,17 @@ function registerWebhookTools(server, clientProvider = getClient) {
|
|
|
1183
1192
|
"cloudevents",
|
|
1184
1193
|
"raw"
|
|
1185
1194
|
]).optional().describe("Wire format (default standard-webhooks)"),
|
|
1186
|
-
authConfig:
|
|
1195
|
+
authConfig: z11.record(z11.string(), z11.unknown()).optional().describe('Receiver auth sent with each delivery, e.g. {"type": "bearer", "token": "..."}')
|
|
1187
1196
|
}, async (input) => {
|
|
1188
1197
|
const res = await clientProvider().webhooks.create(input);
|
|
1189
1198
|
return jsonResponse(res);
|
|
1190
1199
|
});
|
|
1191
1200
|
defineTool(server, "webhooks_update", "Patch a webhook (name, url, authConfig, format, retry, timeout, concurrency).", {
|
|
1192
|
-
id:
|
|
1193
|
-
name:
|
|
1194
|
-
url:
|
|
1195
|
-
authConfig:
|
|
1196
|
-
format:
|
|
1201
|
+
id: webhookIdSchema,
|
|
1202
|
+
name: z11.string().optional().describe("Rename the webhook"),
|
|
1203
|
+
url: z11.string().optional(),
|
|
1204
|
+
authConfig: z11.record(z11.string(), z11.unknown()).optional().describe("Receiver auth sent with each delivery (bearer/etc.)"),
|
|
1205
|
+
format: z11.enum([
|
|
1197
1206
|
"standard-webhooks",
|
|
1198
1207
|
"inngest",
|
|
1199
1208
|
"trigger",
|
|
@@ -1201,35 +1210,35 @@ function registerWebhookTools(server, clientProvider = getClient) {
|
|
|
1201
1210
|
"cloudevents",
|
|
1202
1211
|
"raw"
|
|
1203
1212
|
]).optional(),
|
|
1204
|
-
maxRetries:
|
|
1205
|
-
timeoutMs:
|
|
1206
|
-
concurrency:
|
|
1213
|
+
maxRetries: z11.number().int().min(0).optional(),
|
|
1214
|
+
timeoutMs: z11.number().int().min(100).optional(),
|
|
1215
|
+
concurrency: z11.number().int().min(1).optional()
|
|
1207
1216
|
}, async ({ id, ...patch }) => {
|
|
1208
1217
|
const res = await clientProvider().webhooks.update(id, patch);
|
|
1209
1218
|
return jsonResponse(res);
|
|
1210
1219
|
});
|
|
1211
|
-
defineTool(server, "webhooks_delete", "Delete a webhook. Pending outbox rows are cascade-deleted.", { id:
|
|
1220
|
+
defineTool(server, "webhooks_delete", "Delete a webhook. Pending outbox rows are cascade-deleted.", { id: webhookIdSchema }, async ({ id }) => {
|
|
1212
1221
|
const res = await clientProvider().webhooks.delete(id);
|
|
1213
1222
|
return jsonResponse(res);
|
|
1214
1223
|
});
|
|
1215
|
-
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:
|
|
1224
|
+
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: webhookIdSchema }, async ({ id }) => {
|
|
1216
1225
|
const res = await clientProvider().webhooks.test(id);
|
|
1217
1226
|
return jsonResponse(res);
|
|
1218
1227
|
});
|
|
1219
|
-
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:
|
|
1220
|
-
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:
|
|
1221
|
-
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:
|
|
1222
|
-
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:
|
|
1223
|
-
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:
|
|
1228
|
+
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: webhookIdSchema }, async ({ id }) => jsonResponse(await clientProvider().webhooks.pause(id)));
|
|
1229
|
+
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: webhookIdSchema }, async ({ id }) => jsonResponse(await clientProvider().webhooks.resume(id)));
|
|
1230
|
+
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: webhookIdSchema }, async ({ id }) => jsonResponse(await clientProvider().webhooks.rotateSecret(id)));
|
|
1231
|
+
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: webhookIdSchema }, async ({ id }) => jsonResponse(await clientProvider().webhooks.deliveries(id)));
|
|
1232
|
+
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: webhookIdSchema }, async ({ id }) => jsonResponse(await clientProvider().webhooks.dead(id)));
|
|
1224
1233
|
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.", {
|
|
1225
|
-
id:
|
|
1226
|
-
outboxId:
|
|
1234
|
+
id: webhookIdSchema,
|
|
1235
|
+
outboxId: uuidSchema.describe("Outbox id of the dead delivery (from webhooks_dead)")
|
|
1227
1236
|
}, async ({ id, outboxId }) => jsonResponse(await clientProvider().webhooks.requeue(id, outboxId)));
|
|
1228
1237
|
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.", {
|
|
1229
|
-
id:
|
|
1230
|
-
fromBlock:
|
|
1231
|
-
toBlock:
|
|
1232
|
-
force:
|
|
1238
|
+
id: webhookIdSchema,
|
|
1239
|
+
fromBlock: z11.number().int().nonnegative(),
|
|
1240
|
+
toBlock: z11.number().int().nonnegative(),
|
|
1241
|
+
force: z11.string().optional().describe("Idempotency suffix to force a duplicate replay of the range")
|
|
1233
1242
|
}, async ({ id, fromBlock, toBlock, force }) => {
|
|
1234
1243
|
const res = await clientProvider().webhooks.replay(id, {
|
|
1235
1244
|
fromBlock,
|
|
@@ -1454,5 +1463,5 @@ httpServer.listen(port, () => {
|
|
|
1454
1463
|
console.error("Warning: SECONDLAYER_MCP_SECRET not set, authentication disabled");
|
|
1455
1464
|
});
|
|
1456
1465
|
|
|
1457
|
-
//# debugId=
|
|
1466
|
+
//# debugId=A0F3507D56CDA04E64756E2164756E21
|
|
1458
1467
|
//# sourceMappingURL=bin-http.js.map
|