@secondlayer/mcp 11.6.0 → 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.js CHANGED
@@ -104,11 +104,11 @@ import {
104
104
  isHostedApiUrl,
105
105
  resolveAccountKey,
106
106
  resolveApiKey,
107
- resolveBaseUrl
107
+ resolveBaseUrl,
108
+ resolveIdentity
108
109
  } from "@secondlayer/sdk";
109
110
  var instance = null;
110
111
  var HOSTED_KEY_HINT = "set SECONDLAYER_API_KEY (sk-sl_*) for credits; INSTANCE_TOKEN is the instance";
111
- var DEFAULT_ARCHIVE_OPS_URL = "https://api.secondlayer.tools";
112
112
  function readApiKey() {
113
113
  return resolveApiKey(undefined, resolveBaseUrl());
114
114
  }
@@ -126,19 +126,15 @@ function getClient() {
126
126
  }
127
127
  return instance;
128
128
  }
129
- function readArchiveApiKey() {
130
- return resolveAccountKey();
131
- }
132
129
  function getArchiveOpsClient() {
133
- const accountKey = readArchiveApiKey();
134
- if (!accountKey) {
130
+ const { token, url } = resolveIdentity("account");
131
+ if (!token) {
135
132
  throw new Error(HOSTED_KEY_HINT);
136
133
  }
137
- const archiveOpsUrl = process.env.SL_CREDITS_API_URL || process.env.ARCHIVE_OPS_API_URL || DEFAULT_ARCHIVE_OPS_URL;
138
134
  return new SecondLayer({
139
- accountKey,
135
+ accountKey: token,
140
136
  origin: "mcp",
141
- archiveOpsUrl
137
+ archiveOpsUrl: url
142
138
  });
143
139
  }
144
140
  function keyHint(baseUrl = resolveBaseUrl()) {
@@ -873,7 +869,16 @@ import { DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2 } from "@secondlayer/shared
873
869
  import {
874
870
  runSubgraphTest
875
871
  } from "@secondlayer/subgraphs/testing";
872
+ import { z as z10 } from "zod";
873
+
874
+ // src/lib/ids.ts
876
875
  import { z as z9 } from "zod";
876
+ var uuidSchema = z9.string().uuid();
877
+ var webhookIdSchema = uuidSchema.describe("Webhook id");
878
+ var subgraphNameSchema = z9.string().min(1).max(63).regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").describe("Subgraph name");
879
+ var tableNameSchema = z9.string().min(1).max(63).regex(/^[a-z_][a-z0-9_]*$/i, "letters, digits and underscores only").describe("Table name");
880
+
881
+ // src/tools/subgraphs.ts
877
882
  function eventTypeFor(filter) {
878
883
  if (filter.type === "contract_deploy")
879
884
  return null;
@@ -899,13 +904,13 @@ function registerSubgraphTools(server, clientProvider = getClient) {
899
904
  const { data } = await clientProvider().subgraphs.list();
900
905
  return jsonResponse(data.map(formatSubgraphSummary));
901
906
  });
902
- 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 }) => {
907
+ 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 }) => {
903
908
  const detail = await clientProvider().subgraphs.status(name);
904
909
  return jsonResponse(detail);
905
910
  });
906
911
  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.", {
907
- name: z9.string().describe("Subgraph name"),
908
- format: z9.enum(["agent", "openapi", "markdown"]).optional().describe("agent = JSON schema for tool use (default), openapi = OpenAPI JSON, markdown = docs.md")
912
+ name: subgraphNameSchema,
913
+ format: z10.enum(["agent", "openapi", "markdown"]).optional().describe("agent = JSON schema for tool use (default), openapi = OpenAPI JSON, markdown = docs.md")
909
914
  }, async ({ name, format }) => {
910
915
  const client = clientProvider();
911
916
  if (format === "openapi")
@@ -915,15 +920,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
915
920
  return jsonResponse(await client.subgraphs.schema(name));
916
921
  });
917
922
  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.', {
918
- name: z9.string().describe("Subgraph name"),
919
- table: z9.string().describe("Table name"),
920
- filters: z9.record(z9.string(), z9.string()).optional().describe('Column filters — plain values or with operators (e.g. {"amount.gte": "1000", "sender": "SP..."})'),
921
- sort: z9.string().optional().describe("Column to sort by"),
922
- order: z9.enum(["asc", "desc"]).optional().describe("Sort order"),
923
- limit: z9.number().max(200).optional().describe("Max rows (default 50, max 200)"),
924
- cursor: z9.string().optional().describe("Resume from a previous response's nextCursor"),
925
- fields: z9.string().optional().describe('Comma-separated column list to return (e.g. "sender,amount")'),
926
- count: z9.boolean().optional().describe("If true, return row count instead of rows")
923
+ name: subgraphNameSchema,
924
+ table: tableNameSchema,
925
+ filters: z10.record(z10.string(), z10.string()).optional().describe('Column filters — plain values or with operators (e.g. {"amount.gte": "1000", "sender": "SP..."})'),
926
+ sort: z10.string().optional().describe("Column to sort by"),
927
+ order: z10.enum(["asc", "desc"]).optional().describe("Sort order"),
928
+ limit: z10.number().max(200).optional().describe("Max rows (default 50, max 200)"),
929
+ cursor: z10.string().optional().describe("Resume from a previous response's nextCursor"),
930
+ fields: z10.string().optional().describe('Comma-separated column list to return (e.g. "sender,amount")'),
931
+ count: z10.boolean().optional().describe("If true, return row count instead of rows")
927
932
  }, async ({
928
933
  name,
929
934
  table,
@@ -953,15 +958,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
953
958
  return jsonResponse({ ...capped, nextCursor: next_cursor, tip });
954
959
  });
955
960
  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.", {
956
- name: z9.string().describe("Subgraph name")
961
+ name: subgraphNameSchema
957
962
  }, async ({ name }) => {
958
963
  const result = await clientProvider().subgraphs.reindex(name);
959
964
  return jsonResponse(result);
960
965
  });
961
966
  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.", {
962
- name: z9.string().describe("Subgraph name"),
963
- fromBlock: z9.number().int().nonnegative().describe("Start block (inclusive)"),
964
- toBlock: z9.number().int().nonnegative().describe("End block (inclusive)")
967
+ name: subgraphNameSchema,
968
+ fromBlock: z10.number().int().nonnegative().describe("Start block (inclusive)"),
969
+ toBlock: z10.number().int().nonnegative().describe("End block (inclusive)")
965
970
  }, async ({ name, fromBlock, toBlock }) => {
966
971
  const result = await clientProvider().subgraphs.backfill(name, {
967
972
  fromBlock,
@@ -969,15 +974,15 @@ function registerSubgraphTools(server, clientProvider = getClient) {
969
974
  });
970
975
  return jsonResponse(result);
971
976
  });
972
- 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 }) => {
977
+ 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 }) => {
973
978
  const result = await clientProvider().subgraphs.stop(name);
974
979
  return jsonResponse(result);
975
980
  });
976
981
  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.", {
977
- name: z9.string().describe("Subgraph name"),
978
- limit: z9.number().int().positive().optional().describe("Max gaps to return"),
979
- offset: z9.number().int().nonnegative().optional().describe("Pagination offset"),
980
- resolved: z9.boolean().optional().describe("Filter by resolved state (omit for unresolved only)")
982
+ name: subgraphNameSchema,
983
+ limit: z10.number().int().positive().optional().describe("Max gaps to return"),
984
+ offset: z10.number().int().nonnegative().optional().describe("Pagination offset"),
985
+ resolved: z10.boolean().optional().describe("Filter by resolved state (omit for unresolved only)")
981
986
  }, async ({ name, limit, offset, resolved }) => {
982
987
  const result = await clientProvider().subgraphs.gaps(name, {
983
988
  limit,
@@ -987,20 +992,20 @@ function registerSubgraphTools(server, clientProvider = getClient) {
987
992
  return jsonResponse(result);
988
993
  });
989
994
  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.", {
990
- name: z9.string().describe("Subgraph name"),
991
- operationId: z9.string().optional().describe("Fetch one operation by id (the operationId returned by reindex/backfill/stop); omit for recent history")
995
+ name: subgraphNameSchema,
996
+ operationId: z10.string().optional().describe("Fetch one operation by id (the operationId returned by reindex/backfill/stop); omit for recent history")
992
997
  }, async ({ name, operationId }) => {
993
998
  const client = clientProvider();
994
999
  return jsonResponse(operationId ? await client.subgraphs.getOperation(name, operationId) : await client.subgraphs.operations(name));
995
1000
  });
996
- defineTool(server, "subgraphs_delete", "Delete a subgraph permanently.", { name: z9.string().describe("Subgraph name") }, async ({ name }) => {
1001
+ defineTool(server, "subgraphs_delete", "Delete a subgraph permanently.", { name: subgraphNameSchema }, async ({ name }) => {
997
1002
  const result = await clientProvider().subgraphs.delete(name);
998
1003
  return textResponse(result.message);
999
1004
  });
1000
1005
  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.", {
1001
- code: z9.string().describe("TypeScript source code containing a defineSubgraph() call"),
1002
- startBlock: z9.number().int().nonnegative().optional().describe("Override the definition startBlock for this deploy"),
1003
- dryRun: z9.boolean().optional().describe("Validate schema/DDL only — does not run handlers. Use subgraphs_test to prove a mapping writes rows.")
1006
+ code: z10.string().describe("TypeScript source code containing a defineSubgraph() call"),
1007
+ startBlock: z10.number().int().nonnegative().optional().describe("Override the definition startBlock for this deploy"),
1008
+ dryRun: z10.boolean().optional().describe("Validate schema/DDL only — does not run handlers. Use subgraphs_test to prove a mapping writes rows.")
1004
1009
  }, async ({ code, startBlock, dryRun }) => {
1005
1010
  const bundled = await bundleSubgraphCode(code);
1006
1011
  const result = await clientProvider().subgraphs.deploy({
@@ -1016,10 +1021,10 @@ function registerSubgraphTools(server, clientProvider = getClient) {
1016
1021
  return jsonResponse(result);
1017
1022
  });
1018
1023
  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.", {
1019
- code: z9.string().describe("TypeScript source containing a defineSubgraph() call"),
1020
- fromHeight: z9.number().int().nonnegative().describe("Start block height (inclusive)"),
1021
- toHeight: z9.number().int().nonnegative().optional().describe("End block height (inclusive); default fromHeight+100"),
1022
- limit: z9.number().int().positive().max(200).optional().describe("Max Index rows per source (default 50, max 200)")
1024
+ code: z10.string().describe("TypeScript source containing a defineSubgraph() call"),
1025
+ fromHeight: z10.number().int().nonnegative().describe("Start block height (inclusive)"),
1026
+ toHeight: z10.number().int().nonnegative().optional().describe("End block height (inclusive); default fromHeight+100"),
1027
+ limit: z10.number().int().positive().max(200).optional().describe("Max Index rows per source (default 50, max 200)")
1023
1028
  }, async ({ code, fromHeight, toHeight, limit }) => {
1024
1029
  const bundled = await bundleSubgraphCode(code);
1025
1030
  const def = await loadBundledDefinition(bundled.handlerCode);
@@ -1100,36 +1105,36 @@ function registerSubgraphTools(server, clientProvider = getClient) {
1100
1105
 
1101
1106
  // src/tools/webhooks.ts
1102
1107
  import { CHAIN_TRIGGER_TYPES } from "@secondlayer/shared";
1103
- import { z as z10 } from "zod";
1108
+ import { z as z11 } from "zod";
1104
1109
  function registerWebhookTools(server, clientProvider = getClient) {
1105
1110
  defineTool(server, "webhooks_list", "List all webhooks for the current account. Returns summary fields (no secrets).", {}, async () => {
1106
1111
  const { data } = await clientProvider().webhooks.list();
1107
1112
  return jsonResponse(data);
1108
1113
  });
1109
- defineTool(server, "webhooks_get", "Get full detail for a webhook (triggers, auth, retry config, circuit state).", { id: z10.string().describe("Webhook id") }, async ({ id }) => {
1114
+ defineTool(server, "webhooks_get", "Get full detail for a webhook (triggers, auth, retry config, circuit state).", { id: webhookIdSchema }, async ({ id }) => {
1110
1115
  const detail = await clientProvider().webhooks.get(id);
1111
1116
  return jsonResponse(detail);
1112
1117
  });
1113
1118
  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.", {
1114
- name: z10.string().describe("Human-readable name, unique per account"),
1115
- triggers: z10.array(z10.object({
1116
- type: z10.enum(CHAIN_TRIGGER_TYPES),
1117
- contractId: z10.string().optional(),
1118
- functionName: z10.string().optional(),
1119
- caller: z10.string().optional(),
1120
- sender: z10.string().optional(),
1121
- recipient: z10.string().optional(),
1122
- assetIdentifier: z10.string().optional(),
1123
- deployer: z10.string().optional(),
1124
- contractName: z10.string().optional(),
1125
- topic: z10.string().optional(),
1126
- lockedAddress: z10.string().optional(),
1127
- trait: z10.string().optional(),
1128
- minAmount: z10.union([z10.string(), z10.number()]).optional(),
1129
- maxAmount: z10.union([z10.string(), z10.number()]).optional()
1119
+ name: z11.string().describe("Human-readable name, unique per account"),
1120
+ triggers: z11.array(z11.object({
1121
+ type: z11.enum(CHAIN_TRIGGER_TYPES),
1122
+ contractId: z11.string().optional(),
1123
+ functionName: z11.string().optional(),
1124
+ caller: z11.string().optional(),
1125
+ sender: z11.string().optional(),
1126
+ recipient: z11.string().optional(),
1127
+ assetIdentifier: z11.string().optional(),
1128
+ deployer: z11.string().optional(),
1129
+ contractName: z11.string().optional(),
1130
+ topic: z11.string().optional(),
1131
+ lockedAddress: z11.string().optional(),
1132
+ trait: z11.string().optional(),
1133
+ minAmount: z11.union([z11.string(), z11.number()]).optional(),
1134
+ maxAmount: z11.union([z11.string(), z11.number()]).optional()
1130
1135
  })).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."),
1131
- url: z10.string().describe("Webhook URL"),
1132
- format: z10.enum([
1136
+ url: z11.string().describe("Webhook URL"),
1137
+ format: z11.enum([
1133
1138
  "standard-webhooks",
1134
1139
  "inngest",
1135
1140
  "trigger",
@@ -1137,17 +1142,17 @@ function registerWebhookTools(server, clientProvider = getClient) {
1137
1142
  "cloudevents",
1138
1143
  "raw"
1139
1144
  ]).optional().describe("Wire format (default standard-webhooks)"),
1140
- authConfig: z10.record(z10.string(), z10.unknown()).optional().describe('Receiver auth sent with each delivery, e.g. {"type": "bearer", "token": "..."}')
1145
+ authConfig: z11.record(z11.string(), z11.unknown()).optional().describe('Receiver auth sent with each delivery, e.g. {"type": "bearer", "token": "..."}')
1141
1146
  }, async (input) => {
1142
1147
  const res = await clientProvider().webhooks.create(input);
1143
1148
  return jsonResponse(res);
1144
1149
  });
1145
1150
  defineTool(server, "webhooks_update", "Patch a webhook (name, url, authConfig, format, retry, timeout, concurrency).", {
1146
- id: z10.string(),
1147
- name: z10.string().optional().describe("Rename the webhook"),
1148
- url: z10.string().optional(),
1149
- authConfig: z10.record(z10.string(), z10.unknown()).optional().describe("Receiver auth sent with each delivery (bearer/etc.)"),
1150
- format: z10.enum([
1151
+ id: webhookIdSchema,
1152
+ name: z11.string().optional().describe("Rename the webhook"),
1153
+ url: z11.string().optional(),
1154
+ authConfig: z11.record(z11.string(), z11.unknown()).optional().describe("Receiver auth sent with each delivery (bearer/etc.)"),
1155
+ format: z11.enum([
1151
1156
  "standard-webhooks",
1152
1157
  "inngest",
1153
1158
  "trigger",
@@ -1155,35 +1160,35 @@ function registerWebhookTools(server, clientProvider = getClient) {
1155
1160
  "cloudevents",
1156
1161
  "raw"
1157
1162
  ]).optional(),
1158
- maxRetries: z10.number().int().min(0).optional(),
1159
- timeoutMs: z10.number().int().min(100).optional(),
1160
- concurrency: z10.number().int().min(1).optional()
1163
+ maxRetries: z11.number().int().min(0).optional(),
1164
+ timeoutMs: z11.number().int().min(100).optional(),
1165
+ concurrency: z11.number().int().min(1).optional()
1161
1166
  }, async ({ id, ...patch }) => {
1162
1167
  const res = await clientProvider().webhooks.update(id, patch);
1163
1168
  return jsonResponse(res);
1164
1169
  });
1165
- defineTool(server, "webhooks_delete", "Delete a webhook. Pending outbox rows are cascade-deleted.", { id: z10.string() }, async ({ id }) => {
1170
+ defineTool(server, "webhooks_delete", "Delete a webhook. Pending outbox rows are cascade-deleted.", { id: webhookIdSchema }, async ({ id }) => {
1166
1171
  const res = await clientProvider().webhooks.delete(id);
1167
1172
  return jsonResponse(res);
1168
1173
  });
1169
- 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 }) => {
1174
+ 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 }) => {
1170
1175
  const res = await clientProvider().webhooks.test(id);
1171
1176
  return jsonResponse(res);
1172
1177
  });
1173
- 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)));
1174
- 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)));
1175
- 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)));
1176
- 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)));
1177
- 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)));
1178
+ 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)));
1179
+ 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)));
1180
+ 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)));
1181
+ 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)));
1182
+ 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)));
1178
1183
  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.", {
1179
- id: z10.string().describe("Webhook id"),
1180
- outboxId: z10.string().describe("Outbox id of the dead delivery (from webhooks_dead)")
1184
+ id: webhookIdSchema,
1185
+ outboxId: uuidSchema.describe("Outbox id of the dead delivery (from webhooks_dead)")
1181
1186
  }, async ({ id, outboxId }) => jsonResponse(await clientProvider().webhooks.requeue(id, outboxId)));
1182
1187
  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.", {
1183
- id: z10.string(),
1184
- fromBlock: z10.number().int().nonnegative(),
1185
- toBlock: z10.number().int().nonnegative(),
1186
- force: z10.string().optional().describe("Idempotency suffix to force a duplicate replay of the range")
1188
+ id: webhookIdSchema,
1189
+ fromBlock: z11.number().int().nonnegative(),
1190
+ toBlock: z11.number().int().nonnegative(),
1191
+ force: z11.string().optional().describe("Idempotency suffix to force a duplicate replay of the range")
1187
1192
  }, async ({ id, fromBlock, toBlock, force }) => {
1188
1193
  const res = await clientProvider().webhooks.replay(id, {
1189
1194
  fromBlock,
@@ -1313,5 +1318,5 @@ var server = createServer();
1313
1318
  var transport = new StdioServerTransport;
1314
1319
  await server.connect(transport);
1315
1320
 
1316
- //# debugId=AE01C7C7444677B464756E2164756E21
1321
+ //# debugId=AA879F736F365AF664756E2164756E21
1317
1322
  //# sourceMappingURL=bin.js.map