mcp-scraper 0.66.0 → 0.66.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +2 -2
  3. package/dist/{analytics-repository-IKE53S3E.js → analytics-repository-RUXBFSFX.js} +1 -2
  4. package/dist/bin/api-server.cjs +2898 -2075
  5. package/dist/bin/api-server.js +4 -5
  6. package/dist/bin/mcp-scraper-cli.cjs +1 -2
  7. package/dist/bin/mcp-scraper-cli.js +6 -7
  8. package/dist/bin/mcp-scraper-install.cjs +7 -3
  9. package/dist/bin/mcp-scraper-install.js +2 -3
  10. package/dist/bin/mcp-stdio-server.cjs +1669 -97
  11. package/dist/bin/mcp-stdio-server.js +11 -12
  12. package/dist/bin/paa-harvest.cjs +0 -1
  13. package/dist/bin/paa-harvest.js +4 -5
  14. package/dist/{chunk-VIWT35S6.js → chunk-3EYALCYK.js} +1 -2
  15. package/dist/{chunk-4LINSJNI.js → chunk-3TKKJQB4.js} +1 -2
  16. package/dist/{chunk-4VG3NUUY.js → chunk-55B3T5L2.js} +23 -28
  17. package/dist/{chunk-FG6LJGJ7.js → chunk-77LQV73B.js} +0 -1
  18. package/dist/{chunk-N54JS5WP.js → chunk-ABYBPODM.js} +1 -2
  19. package/dist/chunk-ALEBMPOW.js +6 -0
  20. package/dist/{chunk-2XUXVKT4.js → chunk-AYJHI2FK.js} +0 -1
  21. package/dist/{chunk-AAGVOPP5.js → chunk-CETDPNMZ.js} +24 -25
  22. package/dist/{chunk-5BEPOFKG.js → chunk-CNLLTD5B.js} +0 -1
  23. package/dist/{chunk-P7YFUNKR.js → chunk-DBWWIK7O.js} +3 -4
  24. package/dist/{chunk-EKJ65E3Z.js → chunk-DNM65UCK.js} +0 -1
  25. package/dist/{chunk-3YSEJTMC.js → chunk-GGZEC22A.js} +0 -1
  26. package/dist/{chunk-AJ4YGHG2.js → chunk-K7Y27ND3.js} +3 -14
  27. package/dist/{chunk-XPFRP5QT.js → chunk-KBTUPRTF.js} +3 -4
  28. package/dist/{chunk-5PIO7QBG.js → chunk-KXRWY7DZ.js} +3 -4
  29. package/dist/{chunk-DCWXVAQT.js → chunk-OZDCTNUV.js} +6 -2
  30. package/dist/{chunk-BIUQ6O2Y.js → chunk-OZJMVCDK.js} +0 -1
  31. package/dist/{chunk-X7UG2JCF.js → chunk-PGJQDMC2.js} +1 -2
  32. package/dist/{chunk-DKIG2TEE.js → chunk-PMCT2YQM.js} +2 -3
  33. package/dist/{chunk-G3P3ZDB4.js → chunk-RJ7JVYKU.js} +0 -1
  34. package/dist/{chunk-WD73OFL3.js → chunk-VXLU74YZ.js} +1 -2
  35. package/dist/{chunk-SRRI2HJL.js → chunk-YKL3O7IU.js} +1742 -104
  36. package/dist/{db-BRI465XQ.js → db-4RVZ3NYZ.js} +9 -10
  37. package/dist/{extract-bundle-QAI7JYV2.js → extract-bundle-EA5URLXN.js} +8 -9
  38. package/dist/index.cjs +0 -1
  39. package/dist/index.js +4 -5
  40. package/dist/{lead-list-enrichment-repository-ODWGRVCQ.js → lead-list-enrichment-repository-IBXNWM6H.js} +2 -3
  41. package/dist/{location-data-repository-67MMEVZQ.js → location-data-repository-WHHQUCUI.js} +3 -4
  42. package/dist/{server-MTKWBSAR.js → server-Q7VYGSGQ.js} +450 -1264
  43. package/dist/{site-extract-repository-J3RH3MOS.js → site-extract-repository-NTM4MDQN.js} +4 -5
  44. package/dist/{worker-K7MPPQ7I.js → worker-UTBUWEXQ.js} +8 -9
  45. package/package.json +4 -1
  46. package/dist/analytics-repository-IKE53S3E.js.map +0 -1
  47. package/dist/bin/api-server.cjs.map +0 -1
  48. package/dist/bin/api-server.js.map +0 -1
  49. package/dist/bin/mcp-scraper-cli.cjs.map +0 -1
  50. package/dist/bin/mcp-scraper-cli.js.map +0 -1
  51. package/dist/bin/mcp-scraper-install.cjs.map +0 -1
  52. package/dist/bin/mcp-scraper-install.js.map +0 -1
  53. package/dist/bin/mcp-stdio-server.cjs.map +0 -1
  54. package/dist/bin/mcp-stdio-server.js.map +0 -1
  55. package/dist/bin/paa-harvest.cjs.map +0 -1
  56. package/dist/bin/paa-harvest.js.map +0 -1
  57. package/dist/chunk-2XUXVKT4.js.map +0 -1
  58. package/dist/chunk-3YSEJTMC.js.map +0 -1
  59. package/dist/chunk-4LINSJNI.js.map +0 -1
  60. package/dist/chunk-4VG3NUUY.js.map +0 -1
  61. package/dist/chunk-5BEPOFKG.js.map +0 -1
  62. package/dist/chunk-5PIO7QBG.js.map +0 -1
  63. package/dist/chunk-AAGVOPP5.js.map +0 -1
  64. package/dist/chunk-AJ4YGHG2.js.map +0 -1
  65. package/dist/chunk-BIUQ6O2Y.js.map +0 -1
  66. package/dist/chunk-DCWXVAQT.js.map +0 -1
  67. package/dist/chunk-DKIG2TEE.js.map +0 -1
  68. package/dist/chunk-EKJ65E3Z.js.map +0 -1
  69. package/dist/chunk-FG6LJGJ7.js.map +0 -1
  70. package/dist/chunk-G3P3ZDB4.js.map +0 -1
  71. package/dist/chunk-HDYOVGC6.js +0 -7
  72. package/dist/chunk-HDYOVGC6.js.map +0 -1
  73. package/dist/chunk-N54JS5WP.js.map +0 -1
  74. package/dist/chunk-P7YFUNKR.js.map +0 -1
  75. package/dist/chunk-SRRI2HJL.js.map +0 -1
  76. package/dist/chunk-VIWT35S6.js.map +0 -1
  77. package/dist/chunk-WD73OFL3.js.map +0 -1
  78. package/dist/chunk-X7UG2JCF.js.map +0 -1
  79. package/dist/chunk-XPFRP5QT.js.map +0 -1
  80. package/dist/db-BRI465XQ.js.map +0 -1
  81. package/dist/extract-bundle-QAI7JYV2.js.map +0 -1
  82. package/dist/index.cjs.map +0 -1
  83. package/dist/index.js.map +0 -1
  84. package/dist/lead-list-enrichment-repository-ODWGRVCQ.js.map +0 -1
  85. package/dist/location-data-repository-67MMEVZQ.js.map +0 -1
  86. package/dist/server-MTKWBSAR.js.map +0 -1
  87. package/dist/site-extract-repository-J3RH3MOS.js.map +0 -1
  88. package/dist/worker-K7MPPQ7I.js.map +0 -1
@@ -5,16 +5,16 @@ import {
5
5
  renderImageSection,
6
6
  renderIssueReport,
7
7
  renderLinkReport
8
- } from "./chunk-X7UG2JCF.js";
8
+ } from "./chunk-PGJQDMC2.js";
9
9
  import {
10
10
  sanitizeOutboundDiagnostics
11
- } from "./chunk-VIWT35S6.js";
11
+ } from "./chunk-3EYALCYK.js";
12
12
  import {
13
13
  browserServiceProfileName,
14
14
  browserServiceProfileSaveChanges,
15
15
  recordVendorUsage,
16
16
  vendorCostUsd
17
- } from "./chunk-4LINSJNI.js";
17
+ } from "./chunk-3TKKJQB4.js";
18
18
  import {
19
19
  buildSerpEmailQuery,
20
20
  classifyEmailScope,
@@ -22,34 +22,34 @@ import {
22
22
  extractContactEvidence,
23
23
  extractSerpEmailEvidence,
24
24
  selectPrimaryEmail
25
- } from "./chunk-WD73OFL3.js";
25
+ } from "./chunk-VXLU74YZ.js";
26
26
  import {
27
27
  PACKAGE_VERSION
28
- } from "./chunk-HDYOVGC6.js";
28
+ } from "./chunk-ALEBMPOW.js";
29
29
  import {
30
30
  createPrivateArtifact,
31
31
  privateArtifactOwnerId,
32
32
  readPrivateArtifactWindow,
33
33
  renewPrivateArtifactDownload
34
- } from "./chunk-EKJ65E3Z.js";
34
+ } from "./chunk-DNM65UCK.js";
35
35
  import {
36
36
  MC_PER_CREDIT,
37
37
  PAA_BASE_CREDITS,
38
38
  PAA_QUESTION_CREDITS,
39
39
  PAGE_SCRAPE_CREDITS,
40
40
  SERP_SEARCH_CREDITS
41
- } from "./chunk-2XUXVKT4.js";
41
+ } from "./chunk-AYJHI2FK.js";
42
42
  import {
43
43
  PUBLIC_ERROR_CODES,
44
44
  buildPublicErrorEnvelope,
45
45
  normalizePublicErrorCode,
46
46
  publicErrorMessage,
47
47
  sanitizeVendorName
48
- } from "./chunk-4VG3NUUY.js";
48
+ } from "./chunk-55B3T5L2.js";
49
49
 
50
50
  // src/harvest-timeout.ts
51
51
  var SCRAPE_FUNCTION_MAX_MS = 8e5;
52
- var DEFAULT_TOOL_CLIENT_TIMEOUT_MS = 3e5;
52
+ var DEFAULT_TOOL_CLIENT_TIMEOUT_MS = 59e4;
53
53
  var CLIENT_OVER_SERVER_MARGIN_MS = 15e3;
54
54
  function harvestTimeoutBudget(maxQuestions, serpOnly = false) {
55
55
  const requested = Number.isFinite(maxQuestions) && maxQuestions > 0 ? Math.trunc(maxQuestions) : 30;
@@ -5006,60 +5006,10 @@ ${rows}` : ""
5006
5006
  }
5007
5007
 
5008
5008
  // src/mcp/output-schema-registry.ts
5009
- var ESSENTIAL_OUTPUT_SCHEMA_TOOLS = /* @__PURE__ */ new Set([
5010
- "extract_url",
5011
- "extract_site",
5012
- "analyze_site_similarity",
5013
- "audit_site",
5014
- "check_site_export",
5015
- "site_export_read",
5016
- "site_export_image",
5017
- "archive_read",
5018
- "report_artifact_read",
5019
- "directory_workflow",
5020
- "directory_workflow_status",
5021
- "lead_list_upload_start",
5022
- "lead_list_import",
5023
- "lead_list_enrich",
5024
- "lead_list_enrich_status",
5025
- "video_frame_analysis",
5026
- "video_frame_analysis_status",
5027
- "workflow_run",
5028
- "workflow_step",
5029
- "workflow_status",
5030
- "workflow_artifact_read",
5031
- "export_connected_service_data",
5032
- "export_search_console_table_data",
5033
- "renew_connected_data_download",
5034
- "browser_open",
5035
- "browser_screenshot",
5036
- "browser_replay_start",
5037
- "browser_replay_stop",
5038
- "browser_replay_download",
5039
- "create_scheduled_run_view_link",
5040
- "get_scheduled_run",
5041
- "library-ingest",
5042
- "image_project_create",
5043
- "image_project_list",
5044
- "image_folder_create",
5045
- "image_folder_list",
5046
- "image_asset_save",
5047
- "image_asset_get",
5048
- "image_asset_list",
5049
- "image_asset_search",
5050
- "image_asset_move",
5051
- "image_asset_delete"
5052
- ]);
5053
- function resolveOutputSchemaMode(env = process.env) {
5054
- const explicit = env.MCP_SCRAPER_OUTPUT_SCHEMA_MODE?.trim().toLowerCase();
5055
- if (explicit === "none" || explicit === "essential" || explicit === "all") return explicit;
5056
- return env.MCP_SCRAPER_ADVERTISE_OUTPUT_SCHEMAS === "true" ? "all" : "none";
5057
- }
5058
- var OUTPUT_SCHEMA_MODE = resolveOutputSchemaMode();
5059
5009
  var OUTPUT_SCHEMAS = {};
5060
5010
  function recordOutputSchema(name, schema) {
5061
5011
  OUTPUT_SCHEMAS[name] = schema;
5062
- return OUTPUT_SCHEMA_MODE === "all" || OUTPUT_SCHEMA_MODE === "essential" && ESSENTIAL_OUTPUT_SCHEMA_TOOLS.has(name) ? schema : void 0;
5012
+ return schema;
5063
5013
  }
5064
5014
 
5065
5015
  // src/mcp/meta-ad-creative-media.ts
@@ -7160,7 +7110,7 @@ var HarvestPaaInputSchema = {
7160
7110
  gl: z6.string().length(2).default("us").describe("Google country code inferred from location or user language."),
7161
7111
  hl: z6.string().default("en").describe("Google interface/content language inferred from the user request."),
7162
7112
  device: z6.enum(["desktop", "mobile"]).default("desktop").describe("SERP device context. Use mobile only for mobile rankings."),
7163
- idempotencyKey: z6.string().trim().min(8).max(200).optional().describe("Retry key: reuse after a timeout to avoid re-billing. New key per harvest."),
7113
+ idempotencyKey: z6.string().trim().min(8).max(200).optional().describe("Optional duplicate-start key. Reuse it only after an uncertain or lost response to the same logical call; use a new key for an intentional retry after a terminal failure. This is not the run identifier."),
7164
7114
  serpIdentity: z6.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/).optional().describe("Optional persistent SERP identity created with serp_identity_create. Reuses the same saved browser state and fixed network address across calls."),
7165
7115
  includeAllSerpFeatures: z6.boolean().default(false).describe("Capture every optional same-page SERP surface: local pack, forums, videos, AI Overview/AI Mode, and What People Are Saying."),
7166
7116
  includeLocalPack: z6.boolean().default(false).describe("Include Google local/map-pack businesses and merge their entity IDs."),
@@ -7170,6 +7120,9 @@ var HarvestPaaInputSchema = {
7170
7120
  includeWhatPeopleSaying: z6.boolean().default(false).describe("Include the What People Are Saying social surface when present."),
7171
7121
  debug: z6.boolean().default(false).describe("Include sanitized diagnostics for debugging.")
7172
7122
  };
7123
+ var HarvestPaaHostedInputSchema = Object.fromEntries(
7124
+ Object.entries(HarvestPaaInputSchema).filter(([name]) => name !== "debug")
7125
+ );
7173
7126
  var ExtractUrlBaseInputSchema = {
7174
7127
  url: z6.string().url().describe("Public http/https URL to extract."),
7175
7128
  screenshot: z6.boolean().default(false).describe("Capture a full-page screenshot. Large captures may be offloaded to an owned artifact."),
@@ -10378,6 +10331,15 @@ var TASK_TTL_MS = 24 * 60 * 60 * 1e3;
10378
10331
  var TASK_POLL_INTERVAL_MS = 5e3;
10379
10332
  var TASK_INVALID_PARAMS = -32602;
10380
10333
  var TASK_MISSING_CAPABILITY = -32003;
10334
+ var TASK_START_TOOL_NAMES = /* @__PURE__ */ new Set([
10335
+ "harvest_paa",
10336
+ "extract_site",
10337
+ "analyze_site_similarity",
10338
+ "audit_site",
10339
+ "video_frame_analysis",
10340
+ "directory_workflow",
10341
+ "lead_list_enrich"
10342
+ ]);
10381
10343
  function hasTasksCapability(capabilityValue) {
10382
10344
  const capabilities = objectValue(capabilityValue);
10383
10345
  const extensions = objectValue(capabilities?.extensions);
@@ -10419,7 +10381,7 @@ function decodeTaskHandle(taskId, secret, ownerId) {
10419
10381
  decipher.update(ciphertext),
10420
10382
  decipher.final()
10421
10383
  ]).toString("utf8"));
10422
- if (parsed.v !== 1 || parsed.ownerId !== ownerId || !["site_export", "directory_workflow", "video_frame_analysis", "lead_list_enrichment"].includes(String(parsed.kind)) || typeof parsed.operationId !== "string" || !parsed.operationId || typeof parsed.createdAtMs !== "number" || typeof parsed.expiresAtMs !== "number") throw new Error("invalid payload");
10384
+ if (parsed.v !== 1 || parsed.ownerId !== ownerId || !["paa_harvest", "site_export", "directory_workflow", "video_frame_analysis", "lead_list_enrichment"].includes(String(parsed.kind)) || typeof parsed.operationId !== "string" || !parsed.operationId || typeof parsed.createdAtMs !== "number" || typeof parsed.expiresAtMs !== "number") throw new Error("invalid payload");
10423
10385
  if (Date.now() > parsed.expiresAtMs) {
10424
10386
  throw new ProtocolError(TASK_INVALID_PARAMS, "Failed to retrieve task: Task has expired");
10425
10387
  }
@@ -10432,9 +10394,25 @@ function decodeTaskHandle(taskId, secret, ownerId) {
10432
10394
  function objectValue(value) {
10433
10395
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
10434
10396
  }
10435
- function taskSeed(kind, result) {
10397
+ function resultValue(result) {
10436
10398
  const structured = objectValue(result.structuredContent);
10399
+ if (structured) return structured;
10400
+ const block = result.content.find((item) => item.type === "text");
10401
+ if (!block || block.type !== "text") return void 0;
10402
+ try {
10403
+ return objectValue(JSON.parse(block.text));
10404
+ } catch {
10405
+ return void 0;
10406
+ }
10407
+ }
10408
+ function taskSeed(kind, result) {
10409
+ const structured = resultValue(result);
10437
10410
  if (!structured || result.isError === true) return void 0;
10411
+ if (kind === "paa_harvest") {
10412
+ const operationId2 = structured.job_id ?? structured.jobId;
10413
+ if (typeof operationId2 !== "string" || !["pending", "running"].includes(String(structured.status))) return void 0;
10414
+ return { kind, operationId: operationId2, statusMessage: "PAA harvest started. Progress will be preserved while the client polls this Task." };
10415
+ }
10438
10416
  if (kind === "site_export") {
10439
10417
  const operationId2 = structured.jobId;
10440
10418
  if (typeof operationId2 !== "string" || structured.status !== "pending") return void 0;
@@ -10455,6 +10433,73 @@ function taskSeed(kind, result) {
10455
10433
  if (structured.ok !== true || !["queued", "running", "processing", "pending"].includes(String(structured.status))) return void 0;
10456
10434
  return { kind, operationId, statusMessage: "Video analysis is running." };
10457
10435
  }
10436
+ function createTaskResult(kind, result, options) {
10437
+ const seed = taskSeed(kind, result);
10438
+ if (!seed) return result;
10439
+ const createdAtMs = Date.now();
10440
+ const payload = {
10441
+ v: 1,
10442
+ ownerId: options.ownerId,
10443
+ kind: seed.kind,
10444
+ operationId: seed.operationId,
10445
+ createdAtMs,
10446
+ expiresAtMs: createdAtMs + TASK_TTL_MS
10447
+ };
10448
+ return {
10449
+ resultType: "task",
10450
+ taskId: encodeTaskHandle(payload, options.secret),
10451
+ status: "working",
10452
+ statusMessage: seed.statusMessage,
10453
+ createdAt: new Date(createdAtMs).toISOString(),
10454
+ lastUpdatedAt: new Date(createdAtMs).toISOString(),
10455
+ ttlMs: TASK_TTL_MS,
10456
+ pollIntervalMs: TASK_POLL_INTERVAL_MS,
10457
+ // The registered SDK path validates structuredContent against the tool's
10458
+ // terminal output schema before it can serialize a Task envelope. Retain
10459
+ // the bounded start receipt for that path; the hosted HTTP Task seam runs
10460
+ // before terminal-output serialization.
10461
+ ...result.structuredContent ? { structuredContent: result.structuredContent } : {}
10462
+ };
10463
+ }
10464
+ async function startTaskTool(executor, toolName, rawArguments) {
10465
+ const args = objectValue(rawArguments) ?? {};
10466
+ if (toolName === "harvest_paa") {
10467
+ const parsed = z7.object(HarvestPaaHostedInputSchema).strict().safeParse(args);
10468
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid harvest_paa arguments");
10469
+ return { kind: "paa_harvest", result: await executor.startHarvestPaa({ ...parsed.data, debug: false }) };
10470
+ }
10471
+ if (toolName === "extract_site") {
10472
+ const parsed = z7.object(ExtractSiteInputSchema).safeParse(args);
10473
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid extract_site arguments");
10474
+ return { kind: "site_export", result: await executor.extractSite(parsed.data) };
10475
+ }
10476
+ if (toolName === "analyze_site_similarity") {
10477
+ const parsed = z7.object(AnalyzeSiteSimilarityInputSchema).safeParse(args);
10478
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid analyze_site_similarity arguments");
10479
+ return { kind: "site_export", result: await executor.analyzeSiteSimilarity(parsed.data) };
10480
+ }
10481
+ if (toolName === "audit_site") {
10482
+ const parsed = z7.object(AuditSiteInputSchema).safeParse(args);
10483
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid audit_site arguments");
10484
+ return { kind: "site_export", result: await executor.auditSite(parsed.data) };
10485
+ }
10486
+ if (toolName === "video_frame_analysis") {
10487
+ const parsed = z7.object(VideoFrameAnalysisInputSchema).safeParse(args);
10488
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid video_frame_analysis arguments");
10489
+ return { kind: "video_frame_analysis", result: await executor.videoFrameAnalysis(parsed.data) };
10490
+ }
10491
+ if (toolName === "directory_workflow") {
10492
+ const parsed = z7.object(DirectoryWorkflowInputSchema).safeParse(args);
10493
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid directory_workflow arguments");
10494
+ return { kind: "directory_workflow", result: await executor.directoryWorkflow(parsed.data) };
10495
+ }
10496
+ if (toolName === "lead_list_enrich") {
10497
+ const parsed = z7.object(LeadListEnrichInputSchema).safeParse(args);
10498
+ if (!parsed.success) throw new ProtocolError(TASK_INVALID_PARAMS, parsed.error.issues[0]?.message ?? "Invalid lead_list_enrich arguments");
10499
+ return { kind: "lead_list_enrichment", result: await executor.leadListEnrich(parsed.data) };
10500
+ }
10501
+ throw new ProtocolError(TASK_INVALID_PARAMS, `Unsupported Task-start tool: ${toolName}`);
10502
+ }
10458
10503
  function taskBase(payload, taskId) {
10459
10504
  return {
10460
10505
  taskId,
@@ -10465,10 +10510,13 @@ function taskBase(payload, taskId) {
10465
10510
  };
10466
10511
  }
10467
10512
  function statusFrom(result) {
10468
- const status = objectValue(result.structuredContent)?.status;
10513
+ const status = resultValue(result)?.status;
10469
10514
  return typeof status === "string" ? status : void 0;
10470
10515
  }
10471
10516
  async function pollTask(executor, payload) {
10517
+ if (payload.kind === "paa_harvest") {
10518
+ return executor.harvestPaaStatus({ jobId: payload.operationId });
10519
+ }
10472
10520
  if (payload.kind === "site_export") {
10473
10521
  return executor.checkSiteExport({ jobId: payload.operationId });
10474
10522
  }
@@ -10480,6 +10528,30 @@ async function pollTask(executor, payload) {
10480
10528
  }
10481
10529
  return executor.videoFrameAnalysisStatus({ runId: payload.operationId });
10482
10530
  }
10531
+ function taskProgressMessage(kind, result, status) {
10532
+ const value = resultValue(result) ?? {};
10533
+ if (kind === "paa_harvest") {
10534
+ const resultRecord = objectValue(value.result) ?? {};
10535
+ const progress = objectValue(resultRecord.progress) ?? {};
10536
+ const records = Array.isArray(progress.records) ? progress.records.length : 0;
10537
+ const attempts = Array.isArray(value.attempts) ? value.attempts.length : 0;
10538
+ const pieces = [records > 0 ? `${records} questions preserved` : null, attempts > 0 ? `${attempts} attempts recorded` : null].filter(Boolean);
10539
+ return pieces.length > 0 ? `PAA harvest is ${status ?? "running"}: ${pieces.join(", ")}.` : `PAA harvest is ${status ?? "running"}; no question checkpoint has been persisted yet.`;
10540
+ }
10541
+ if (kind === "lead_list_enrichment") {
10542
+ const progress = objectValue(value.progress) ?? {};
10543
+ const completed = typeof progress.completedRows === "number" ? progress.completedRows : null;
10544
+ const total = typeof progress.totalRows === "number" ? progress.totalRows : null;
10545
+ if (completed !== null && total !== null) return `Lead list enrichment is ${status ?? "running"}: ${completed}/${total} rows completed.`;
10546
+ }
10547
+ if (kind === "directory_workflow") {
10548
+ const progress = objectValue(value.progress) ?? {};
10549
+ const completed = typeof progress.completedCities === "number" ? progress.completedCities : null;
10550
+ const total = typeof progress.totalCities === "number" ? progress.totalCities : null;
10551
+ if (completed !== null && total !== null) return `Directory workflow is ${status ?? "running"}: ${completed}/${total} markets completed.`;
10552
+ }
10553
+ return status ? `Underlying operation status: ${status}.` : "Underlying operation is running.";
10554
+ }
10483
10555
  async function cancelTask(executor, payload) {
10484
10556
  if (payload.kind !== "lead_list_enrichment") return;
10485
10557
  const result = await executor.leadListEnrichCancel({ jobId: payload.operationId });
@@ -10496,7 +10568,7 @@ async function detailedTask(executor, taskId, options) {
10496
10568
  return {
10497
10569
  ...base,
10498
10570
  status: "working",
10499
- statusMessage: status ? `Underlying operation status: ${status}.` : "Underlying operation is running."
10571
+ statusMessage: taskProgressMessage(payload.kind, result, status)
10500
10572
  };
10501
10573
  }
10502
10574
  if (payload.kind === "lead_list_enrichment" && status === "failed") {
@@ -10507,6 +10579,22 @@ async function detailedTask(executor, taskId, options) {
10507
10579
  result
10508
10580
  };
10509
10581
  }
10582
+ if (payload.kind === "paa_harvest" && status === "failed") {
10583
+ return {
10584
+ ...base,
10585
+ status: "failed",
10586
+ statusMessage: "PAA harvest failed; persisted attempts and billing state are included in the result.",
10587
+ result
10588
+ };
10589
+ }
10590
+ if (payload.kind === "paa_harvest" && status === "cancelled") {
10591
+ return {
10592
+ ...base,
10593
+ status: "cancelled",
10594
+ statusMessage: "PAA harvest was cancelled.",
10595
+ result
10596
+ };
10597
+ }
10510
10598
  if (payload.kind === "lead_list_enrichment" && status === "cancelled") {
10511
10599
  return {
10512
10600
  ...base,
@@ -10523,12 +10611,20 @@ async function detailedTask(executor, taskId, options) {
10523
10611
  };
10524
10612
  }
10525
10613
  function isWorking(kind, status) {
10614
+ if (kind === "paa_harvest") return status === "pending" || status === "running";
10526
10615
  if (kind === "site_export") return status === "pending" || status === "running";
10527
10616
  if (kind === "directory_workflow") return status === "queued" || status === "running";
10528
10617
  if (kind === "lead_list_enrichment") return status === "queued" || status === "running";
10529
10618
  return status === "queued" || status === "running" || status === "processing" || status === "pending";
10530
10619
  }
10531
10620
  function registerMcpTasksExtension(server, executor, options) {
10621
+ const enabled = options.enableTaskStarts !== false;
10622
+ if (!enabled) {
10623
+ return {
10624
+ supportsTasks: () => false,
10625
+ taskify: (_kind, result) => result
10626
+ };
10627
+ }
10532
10628
  server.server.registerCapabilities({
10533
10629
  extensions: { [MCP_TASKS_EXTENSION_ID]: {} }
10534
10630
  });
@@ -10554,34 +10650,12 @@ function registerMcpTasksExtension(server, executor, options) {
10554
10650
  return {};
10555
10651
  });
10556
10652
  return {
10653
+ supportsTasks() {
10654
+ return hasTasksCapability(server.server.getClientCapabilities());
10655
+ },
10557
10656
  taskify(kind, result) {
10558
10657
  if (!hasTasksCapability(server.server.getClientCapabilities())) return result;
10559
- const seed = taskSeed(kind, result);
10560
- if (!seed) return result;
10561
- const createdAtMs = Date.now();
10562
- const payload = {
10563
- v: 1,
10564
- ownerId: options.ownerId,
10565
- kind: seed.kind,
10566
- operationId: seed.operationId,
10567
- createdAtMs,
10568
- expiresAtMs: createdAtMs + TASK_TTL_MS
10569
- };
10570
- const taskId = encodeTaskHandle(payload, options.secret);
10571
- return {
10572
- resultType: "task",
10573
- taskId,
10574
- status: "working",
10575
- statusMessage: seed.statusMessage,
10576
- createdAt: new Date(createdAtMs).toISOString(),
10577
- lastUpdatedAt: new Date(createdAtMs).toISOString(),
10578
- ttlMs: TASK_TTL_MS,
10579
- pollIntervalMs: TASK_POLL_INTERVAL_MS,
10580
- // The SDK validates advertised outputSchema before serializing the
10581
- // Task envelope. Preserve the already-bounded start receipt so typed
10582
- // tools remain task-capable when essential output schemas are on.
10583
- ...result.structuredContent ? { structuredContent: result.structuredContent } : {}
10584
- };
10658
+ return createTaskResult(kind, result, options);
10585
10659
  }
10586
10660
  };
10587
10661
  }
@@ -10594,10 +10668,12 @@ function taskHttpError(id, error) {
10594
10668
  }
10595
10669
  async function handleMcpTasksHttpRequest(request, executor, options) {
10596
10670
  const routedMethod = request.headers.get("mcp-method");
10597
- if (!["tasks/get", "tasks/update", "tasks/cancel"].includes(routedMethod ?? "")) return void 0;
10671
+ const routedToolName = request.headers.get("mcp-name");
10672
+ const taskStartCall = routedMethod === "tools/call" && TASK_START_TOOL_NAMES.has(routedToolName ?? "");
10673
+ if (!taskStartCall && !["tasks/get", "tasks/update", "tasks/cancel"].includes(routedMethod ?? "")) return void 0;
10598
10674
  let payload;
10599
10675
  try {
10600
- payload = await request.json();
10676
+ payload = await request.clone().json();
10601
10677
  } catch {
10602
10678
  return taskHttpError(null, new ProtocolError(-32700, "Parse error"));
10603
10679
  }
@@ -10610,6 +10686,28 @@ async function handleMcpTasksHttpRequest(request, executor, options) {
10610
10686
  throw new ProtocolError(-32020, "Mcp-Method header does not match the JSON-RPC method");
10611
10687
  }
10612
10688
  const params = objectValue(payload.params);
10689
+ if (taskStartCall) {
10690
+ if (params?.name !== routedToolName || typeof routedToolName !== "string") {
10691
+ throw new ProtocolError(-32020, "Mcp-Name header must match params.name");
10692
+ }
10693
+ const meta2 = objectValue(params?._meta);
10694
+ if (!hasTasksCapability(meta2?.["io.modelcontextprotocol/clientCapabilities"])) return void 0;
10695
+ if (routedToolName === "harvest_paa" && objectValue(params?.arguments)?.serpIdentity !== void 0) {
10696
+ return void 0;
10697
+ }
10698
+ const started = await startTaskTool(executor, routedToolName, params?.arguments);
10699
+ const task = createTaskResult(started.kind, started.result, options);
10700
+ const taskObject = task;
10701
+ return new Response(JSON.stringify({
10702
+ jsonrpc: "2.0",
10703
+ id,
10704
+ result: {
10705
+ ...taskObject,
10706
+ resultType: taskObject.resultType === "task" ? "task" : "complete",
10707
+ _meta: { "io.modelcontextprotocol/serverInfo": options.serverInfo }
10708
+ }
10709
+ }), { status: 200, headers: { "content-type": "application/json" } });
10710
+ }
10613
10711
  const taskId = params?.taskId;
10614
10712
  if (typeof taskId !== "string" || !taskId) throw new ProtocolError(TASK_INVALID_PARAMS, "Invalid taskId");
10615
10713
  if (request.headers.get("mcp-name") !== taskId) {
@@ -11056,19 +11154,21 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
11056
11154
  const fileBehavior = (local, hosted) => savesReports ? local : hosted;
11057
11155
  const ownerId = options.ownerId ?? "local";
11058
11156
  const ctx = { hosted: !savesReports, ownerId };
11157
+ const transportProfile = options.transportProfile ?? (savesReports ? "stdio" : "hosted_http");
11059
11158
  registerAnalyticsMcpTools(server, executor);
11060
11159
  const exposesLocalNetworkAccess = options.localNetworkAccess ?? permitsLocalNetworkAccess({
11061
11160
  deploymentProfile: options.deploymentProfile ?? "production",
11062
- transportProfile: options.transportProfile ?? (savesReports ? "stdio" : "hosted_http"),
11161
+ transportProfile,
11063
11162
  baseUrl: options.baseUrl
11064
11163
  });
11065
11164
  const exposesDevelopmentDiagnostics = options.deploymentProfile === "development" || options.deploymentProfile === "test";
11066
11165
  const tasks = registerMcpTasksExtension(server, executor, {
11067
11166
  ownerId,
11068
- secret: options.taskHandleSecret ?? `local:${ownerId}`
11167
+ secret: options.taskHandleSecret ?? `local:${ownerId}`,
11168
+ enableTaskStarts: transportProfile === "hosted_http"
11069
11169
  });
11070
11170
  const privateSearchFields = exposesDevelopmentDiagnostics ? [] : ["debug"];
11071
- const harvestPaaInputSchema = schemaWithoutFields(HarvestPaaInputSchema, privateSearchFields);
11171
+ const harvestPaaInputSchema = exposesDevelopmentDiagnostics ? HarvestPaaInputSchema : HarvestPaaHostedInputSchema;
11072
11172
  const searchSerpInputSchema = schemaWithoutFields(SearchSerpInputSchema, privateSearchFields);
11073
11173
  const mapsSearchInputSchema = schemaWithoutFields(MapsSearchInputSchema, privateSearchFields);
11074
11174
  const directoryWorkflowInputSchema = schemaWithoutFields(
@@ -11082,7 +11182,13 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
11082
11182
  inputSchema: harvestPaaInputSchema,
11083
11183
  outputSchema: recordOutputSchema("harvest_paa", HarvestPaaOutputSchema),
11084
11184
  annotations: liveWebToolAnnotations("Google PAA + SERP Harvest")
11085
- }, async (input) => formatHarvestPaa(await executor.harvestPaa(input), input));
11185
+ }, async (input, requestContext) => {
11186
+ const executionInput = { ...input, debug: input.debug === true };
11187
+ if (tasks.supportsTasks() && !executionInput.serpIdentity) {
11188
+ return tasks.taskify("paa_harvest", await executor.startHarvestPaa(executionInput), requestContext);
11189
+ }
11190
+ return formatHarvestPaa(await executor.harvestPaa(executionInput), executionInput);
11191
+ });
11086
11192
  server.registerTool("search_serp", {
11087
11193
  title: "Google SERP Lookup",
11088
11194
  description: `Google SERP lookup without PAA expansion. Defaults to organic rankings and Google entity IDs; request local pack, forums, videos, AI surfaces, and What People Are Saying with individual include flags or includeAllSerpFeatures at the same product price. Use gl for country and location only when city or regional context matters. Costs ${SERP_SEARCH_CREDITS} Credits per search. Call credits_info for current pricing and balance.`,
@@ -12047,7 +12153,7 @@ var HttpMcpToolExecutor = class {
12047
12153
  retryable: true,
12048
12154
  path,
12049
12155
  timeoutMs,
12050
- message: `MCP Scraper request exceeded ${Math.round(timeoutMs / 1e3)}s and was cancelled client-side. The operation may still be running or may have already completed and been billed on our side. Retry with fewer results or use the async API for deep harvests. ${timeoutGuidance}`
12156
+ message: `MCP Scraper stopped waiting after ${Math.round(timeoutMs / 1e3)}s. This does not prove server-side work stopped: the operation may still be running or may have already completed and been billed. Prefer the returned Task or job handle for long work. ${timeoutGuidance}`
12051
12157
  })
12052
12158
  }],
12053
12159
  isError: true
@@ -12130,8 +12236,17 @@ var HttpMcpToolExecutor = class {
12130
12236
  }
12131
12237
  harvestPaa(input) {
12132
12238
  const timeoutMs = this.httpTimeoutOverrideMs ?? harvestTimeoutBudget(input.maxQuestions ?? 30).clientMs;
12133
- const headers = input.idempotencyKey ? { "Idempotency-Key": input.idempotencyKey } : {};
12134
- return this.call("/harvest/sync", input, timeoutMs, "POST", headers, true);
12239
+ const { idempotencyKey, ...body } = input;
12240
+ const headers = idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {};
12241
+ return this.call("/harvest/sync", body, timeoutMs, "POST", headers, true);
12242
+ }
12243
+ startHarvestPaa(input) {
12244
+ const { idempotencyKey, ...body } = input;
12245
+ const headers = idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {};
12246
+ return this.call("/harvest", body, this.timeoutMs, "POST", headers, true);
12247
+ }
12248
+ harvestPaaStatus(input) {
12249
+ return this.getJson(`/jobs/${encodeURIComponent(input.jobId)}`);
12135
12250
  }
12136
12251
  searchSerp(input) {
12137
12252
  const timeoutMs = this.httpTimeoutOverrideMs ?? harvestTimeoutBudget(0, true).clientMs;
@@ -14335,8 +14450,1532 @@ function registerBrowserAgentMcpTools(server, opts) {
14335
14450
  // src/mcp/memory-mcp-server.ts
14336
14451
  import { fromJsonSchema } from "@modelcontextprotocol/server";
14337
14452
 
14338
- // src/mcp/memory-tool-registry.ts
14339
- import { IMAGE_ASSET_MCP_DEFINITIONS } from "mcpscraper-memory-tools/tools/assets/image-assets";
14453
+ // src/mcp/memory-image-tool-schemas.generated.ts
14454
+ var MEMORY_IMAGE_TOOL_SCHEMAS = [
14455
+ {
14456
+ "id": "image_project_create",
14457
+ "upstreamName": "image_project_create",
14458
+ "description": "Create a stable image project inside a writable hosted Memory vault. Projects organize governed private image assets; they do not create local folders or change object keys.",
14459
+ "inputJsonSchema": {
14460
+ "type": "object",
14461
+ "properties": {
14462
+ "vault": {
14463
+ "type": "string",
14464
+ "description": "Writable logical Memory vault. Defaults to the active vault."
14465
+ },
14466
+ "name": {
14467
+ "type": "string",
14468
+ "minLength": 1,
14469
+ "maxLength": 120
14470
+ },
14471
+ "description": {
14472
+ "type": "string",
14473
+ "maxLength": 2e3
14474
+ }
14475
+ },
14476
+ "required": [
14477
+ "name"
14478
+ ],
14479
+ "additionalProperties": false,
14480
+ "$schema": "http://json-schema.org/draft-07/schema#"
14481
+ },
14482
+ "outputJsonSchema": {
14483
+ "type": "object",
14484
+ "properties": {
14485
+ "ok": {
14486
+ "type": "boolean",
14487
+ "enum": [
14488
+ true,
14489
+ false
14490
+ ]
14491
+ },
14492
+ "project": {
14493
+ "type": "object",
14494
+ "properties": {
14495
+ "id": {
14496
+ "type": "string"
14497
+ },
14498
+ "name": {
14499
+ "type": "string"
14500
+ },
14501
+ "description": {
14502
+ "type": [
14503
+ "string",
14504
+ "null"
14505
+ ]
14506
+ },
14507
+ "createdAt": {
14508
+ "type": "string"
14509
+ }
14510
+ },
14511
+ "required": [
14512
+ "id",
14513
+ "name",
14514
+ "description",
14515
+ "createdAt"
14516
+ ],
14517
+ "additionalProperties": false
14518
+ },
14519
+ "code": {
14520
+ "type": "string"
14521
+ },
14522
+ "error": {
14523
+ "type": "string"
14524
+ }
14525
+ },
14526
+ "required": [
14527
+ "ok"
14528
+ ],
14529
+ "additionalProperties": false,
14530
+ "$schema": "http://json-schema.org/draft-07/schema#"
14531
+ },
14532
+ "annotations": {
14533
+ "title": "Create Image Project",
14534
+ "readOnlyHint": false,
14535
+ "destructiveHint": false,
14536
+ "idempotentHint": false,
14537
+ "openWorldHint": false
14538
+ }
14539
+ },
14540
+ {
14541
+ "id": "image_project_list",
14542
+ "upstreamName": "image_project_list",
14543
+ "description": "List image projects in an accessible hosted Memory vault. Returns organization metadata only, never object-store keys.",
14544
+ "inputJsonSchema": {
14545
+ "type": "object",
14546
+ "properties": {
14547
+ "vault": {
14548
+ "type": "string"
14549
+ }
14550
+ },
14551
+ "additionalProperties": false,
14552
+ "$schema": "http://json-schema.org/draft-07/schema#"
14553
+ },
14554
+ "outputJsonSchema": {
14555
+ "type": "object",
14556
+ "properties": {
14557
+ "ok": {
14558
+ "type": "boolean",
14559
+ "enum": [
14560
+ true,
14561
+ false
14562
+ ]
14563
+ },
14564
+ "projects": {
14565
+ "type": "array",
14566
+ "items": {
14567
+ "type": "object",
14568
+ "properties": {
14569
+ "id": {
14570
+ "type": "string"
14571
+ },
14572
+ "name": {
14573
+ "type": "string"
14574
+ },
14575
+ "description": {
14576
+ "type": [
14577
+ "string",
14578
+ "null"
14579
+ ]
14580
+ },
14581
+ "status": {
14582
+ "type": "string"
14583
+ },
14584
+ "createdAt": {
14585
+ "type": "string"
14586
+ },
14587
+ "updatedAt": {
14588
+ "type": "string"
14589
+ }
14590
+ },
14591
+ "required": [
14592
+ "id",
14593
+ "name",
14594
+ "description",
14595
+ "status",
14596
+ "createdAt",
14597
+ "updatedAt"
14598
+ ],
14599
+ "additionalProperties": false
14600
+ }
14601
+ },
14602
+ "code": {
14603
+ "type": "string"
14604
+ },
14605
+ "error": {
14606
+ "type": "string"
14607
+ }
14608
+ },
14609
+ "required": [
14610
+ "ok"
14611
+ ],
14612
+ "additionalProperties": false,
14613
+ "$schema": "http://json-schema.org/draft-07/schema#"
14614
+ },
14615
+ "annotations": {
14616
+ "title": "List Image Projects",
14617
+ "readOnlyHint": true,
14618
+ "destructiveHint": false,
14619
+ "idempotentHint": true,
14620
+ "openWorldHint": false
14621
+ }
14622
+ },
14623
+ {
14624
+ "id": "image_folder_create",
14625
+ "upstreamName": "image_folder_create",
14626
+ "description": "Create a nested image folder inside one writable Memory image project. Maximum nesting depth is eight; this changes logical organization only.",
14627
+ "inputJsonSchema": {
14628
+ "type": "object",
14629
+ "properties": {
14630
+ "vault": {
14631
+ "type": "string"
14632
+ },
14633
+ "projectId": {
14634
+ "type": "string",
14635
+ "minLength": 1
14636
+ },
14637
+ "parentId": {
14638
+ "type": "string",
14639
+ "minLength": 1
14640
+ },
14641
+ "name": {
14642
+ "type": "string",
14643
+ "minLength": 1,
14644
+ "maxLength": 120
14645
+ }
14646
+ },
14647
+ "required": [
14648
+ "projectId",
14649
+ "name"
14650
+ ],
14651
+ "additionalProperties": false,
14652
+ "$schema": "http://json-schema.org/draft-07/schema#"
14653
+ },
14654
+ "outputJsonSchema": {
14655
+ "type": "object",
14656
+ "properties": {
14657
+ "ok": {
14658
+ "type": "boolean",
14659
+ "enum": [
14660
+ true,
14661
+ false
14662
+ ]
14663
+ },
14664
+ "folder": {
14665
+ "type": "object",
14666
+ "properties": {
14667
+ "id": {
14668
+ "type": "string"
14669
+ },
14670
+ "projectId": {
14671
+ "type": "string"
14672
+ },
14673
+ "parentId": {
14674
+ "type": [
14675
+ "string",
14676
+ "null"
14677
+ ]
14678
+ },
14679
+ "name": {
14680
+ "type": "string"
14681
+ },
14682
+ "depth": {
14683
+ "type": "number"
14684
+ },
14685
+ "createdAt": {
14686
+ "type": "string"
14687
+ }
14688
+ },
14689
+ "required": [
14690
+ "id",
14691
+ "projectId",
14692
+ "parentId",
14693
+ "name",
14694
+ "depth",
14695
+ "createdAt"
14696
+ ],
14697
+ "additionalProperties": false
14698
+ },
14699
+ "code": {
14700
+ "type": "string"
14701
+ },
14702
+ "error": {
14703
+ "type": "string"
14704
+ }
14705
+ },
14706
+ "required": [
14707
+ "ok"
14708
+ ],
14709
+ "additionalProperties": false,
14710
+ "$schema": "http://json-schema.org/draft-07/schema#"
14711
+ },
14712
+ "annotations": {
14713
+ "title": "Create Image Folder",
14714
+ "readOnlyHint": false,
14715
+ "destructiveHint": false,
14716
+ "idempotentHint": false,
14717
+ "openWorldHint": false
14718
+ }
14719
+ },
14720
+ {
14721
+ "id": "image_folder_list",
14722
+ "upstreamName": "image_folder_list",
14723
+ "description": "List the bounded folder tree for one accessible Memory image project.",
14724
+ "inputJsonSchema": {
14725
+ "type": "object",
14726
+ "properties": {
14727
+ "vault": {
14728
+ "type": "string"
14729
+ },
14730
+ "projectId": {
14731
+ "type": "string",
14732
+ "minLength": 1
14733
+ }
14734
+ },
14735
+ "required": [
14736
+ "projectId"
14737
+ ],
14738
+ "additionalProperties": false,
14739
+ "$schema": "http://json-schema.org/draft-07/schema#"
14740
+ },
14741
+ "outputJsonSchema": {
14742
+ "type": "object",
14743
+ "properties": {
14744
+ "ok": {
14745
+ "type": "boolean",
14746
+ "enum": [
14747
+ true,
14748
+ false
14749
+ ]
14750
+ },
14751
+ "folders": {
14752
+ "type": "array",
14753
+ "items": {
14754
+ "type": "object",
14755
+ "properties": {
14756
+ "id": {
14757
+ "type": "string"
14758
+ },
14759
+ "projectId": {
14760
+ "type": "string"
14761
+ },
14762
+ "parentId": {
14763
+ "type": [
14764
+ "string",
14765
+ "null"
14766
+ ]
14767
+ },
14768
+ "name": {
14769
+ "type": "string"
14770
+ },
14771
+ "depth": {
14772
+ "type": "number"
14773
+ },
14774
+ "createdAt": {
14775
+ "type": "string"
14776
+ },
14777
+ "updatedAt": {
14778
+ "type": "string"
14779
+ }
14780
+ },
14781
+ "required": [
14782
+ "id",
14783
+ "projectId",
14784
+ "parentId",
14785
+ "name",
14786
+ "depth",
14787
+ "createdAt",
14788
+ "updatedAt"
14789
+ ],
14790
+ "additionalProperties": false
14791
+ }
14792
+ },
14793
+ "code": {
14794
+ "type": "string"
14795
+ },
14796
+ "error": {
14797
+ "type": "string"
14798
+ }
14799
+ },
14800
+ "required": [
14801
+ "ok"
14802
+ ],
14803
+ "additionalProperties": false,
14804
+ "$schema": "http://json-schema.org/draft-07/schema#"
14805
+ },
14806
+ "annotations": {
14807
+ "title": "List Image Folders",
14808
+ "readOnlyHint": true,
14809
+ "destructiveHint": false,
14810
+ "idempotentHint": true,
14811
+ "openWorldHint": false
14812
+ }
14813
+ },
14814
+ {
14815
+ "id": "image_asset_save",
14816
+ "upstreamName": "image_asset_save",
14817
+ "description": "Opt in to preserving one image in hosted Memory. Saves immutable private bytes, creates a sanitized preview, consumes storage/embedding quota, and queues visual plus useful fused embeddings. Use for durable image recall; do not use merely to view a transient scrape result.",
14818
+ "inputJsonSchema": {
14819
+ "type": "object",
14820
+ "properties": {
14821
+ "vault": {
14822
+ "type": "string"
14823
+ },
14824
+ "projectId": {
14825
+ "type": "string",
14826
+ "minLength": 1
14827
+ },
14828
+ "folderId": {
14829
+ "type": "string",
14830
+ "minLength": 1
14831
+ },
14832
+ "sourceUrl": {
14833
+ "type": "string",
14834
+ "format": "uri",
14835
+ "description": "Public HTTPS image URL. Private-network and redirect targets are rejected."
14836
+ },
14837
+ "artifactId": {
14838
+ "type": "string",
14839
+ "minLength": 1,
14840
+ "description": "Owned MCP Scraper artifact ID. Available through the aggregate MCP handoff."
14841
+ },
14842
+ "imageBase64": {
14843
+ "type": "string",
14844
+ "minLength": 1,
14845
+ "description": "Bounded base64 image for clients without an upload transport; maximum decoded size is 20 MiB."
14846
+ },
14847
+ "title": {
14848
+ "type": "string",
14849
+ "minLength": 1,
14850
+ "maxLength": 240
14851
+ },
14852
+ "description": {
14853
+ "type": "string",
14854
+ "maxLength": 4e3
14855
+ },
14856
+ "altText": {
14857
+ "type": "string",
14858
+ "maxLength": 2e3
14859
+ },
14860
+ "tags": {
14861
+ "type": "array",
14862
+ "items": {
14863
+ "type": "string",
14864
+ "minLength": 1,
14865
+ "maxLength": 80
14866
+ },
14867
+ "maxItems": 20
14868
+ },
14869
+ "sourceRef": {
14870
+ "type": "object",
14871
+ "additionalProperties": {
14872
+ "anyOf": [
14873
+ {
14874
+ "type": "string",
14875
+ "maxLength": 1e3
14876
+ },
14877
+ {
14878
+ "type": "number"
14879
+ },
14880
+ {
14881
+ "type": "boolean"
14882
+ },
14883
+ {
14884
+ "type": "null"
14885
+ }
14886
+ ]
14887
+ }
14888
+ },
14889
+ "idempotencyKey": {
14890
+ "type": "string",
14891
+ "minLength": 8,
14892
+ "maxLength": 200,
14893
+ "description": "Stable key for this logical save. Retrying the same request returns the same asset without another write."
14894
+ }
14895
+ },
14896
+ "required": [
14897
+ "title",
14898
+ "idempotencyKey"
14899
+ ],
14900
+ "additionalProperties": false,
14901
+ "$schema": "http://json-schema.org/draft-07/schema#"
14902
+ },
14903
+ "outputJsonSchema": {
14904
+ "type": "object",
14905
+ "properties": {
14906
+ "ok": {
14907
+ "type": "boolean",
14908
+ "enum": [
14909
+ true,
14910
+ false
14911
+ ]
14912
+ },
14913
+ "asset": {
14914
+ "type": "object",
14915
+ "properties": {
14916
+ "assetId": {
14917
+ "type": "string"
14918
+ },
14919
+ "title": {
14920
+ "type": "string"
14921
+ },
14922
+ "description": {
14923
+ "type": [
14924
+ "string",
14925
+ "null"
14926
+ ]
14927
+ },
14928
+ "altText": {
14929
+ "type": [
14930
+ "string",
14931
+ "null"
14932
+ ]
14933
+ },
14934
+ "sourceUrl": {
14935
+ "type": [
14936
+ "string",
14937
+ "null"
14938
+ ]
14939
+ },
14940
+ "sourceKind": {
14941
+ "type": "string"
14942
+ },
14943
+ "mimeType": {
14944
+ "type": "string"
14945
+ },
14946
+ "bytes": {
14947
+ "type": "number"
14948
+ },
14949
+ "width": {
14950
+ "type": "number"
14951
+ },
14952
+ "height": {
14953
+ "type": "number"
14954
+ },
14955
+ "projectId": {
14956
+ "type": [
14957
+ "string",
14958
+ "null"
14959
+ ]
14960
+ },
14961
+ "folderId": {
14962
+ "type": [
14963
+ "string",
14964
+ "null"
14965
+ ]
14966
+ },
14967
+ "tags": {
14968
+ "type": "array",
14969
+ "items": {
14970
+ "type": "string"
14971
+ }
14972
+ },
14973
+ "status": {
14974
+ "type": "string"
14975
+ },
14976
+ "embeddingStatus": {
14977
+ "type": "string"
14978
+ },
14979
+ "createdAt": {
14980
+ "type": "string"
14981
+ },
14982
+ "updatedAt": {
14983
+ "type": "string"
14984
+ },
14985
+ "preview": {
14986
+ "type": "object",
14987
+ "properties": {
14988
+ "url": {
14989
+ "type": "string",
14990
+ "format": "uri"
14991
+ },
14992
+ "expiresAt": {
14993
+ "type": "string",
14994
+ "format": "date-time"
14995
+ },
14996
+ "mimeType": {
14997
+ "type": "string",
14998
+ "const": "image/webp"
14999
+ }
15000
+ },
15001
+ "required": [
15002
+ "url",
15003
+ "expiresAt",
15004
+ "mimeType"
15005
+ ],
15006
+ "additionalProperties": false
15007
+ }
15008
+ },
15009
+ "required": [
15010
+ "assetId",
15011
+ "title",
15012
+ "description",
15013
+ "altText",
15014
+ "sourceUrl",
15015
+ "sourceKind",
15016
+ "mimeType",
15017
+ "bytes",
15018
+ "width",
15019
+ "height",
15020
+ "projectId",
15021
+ "folderId",
15022
+ "tags",
15023
+ "status",
15024
+ "embeddingStatus",
15025
+ "createdAt",
15026
+ "updatedAt"
15027
+ ],
15028
+ "additionalProperties": false
15029
+ },
15030
+ "reusedObject": {
15031
+ "type": "boolean"
15032
+ },
15033
+ "nextAction": {
15034
+ "type": "string"
15035
+ },
15036
+ "code": {
15037
+ "type": "string"
15038
+ },
15039
+ "error": {
15040
+ "type": "string"
15041
+ }
15042
+ },
15043
+ "required": [
15044
+ "ok"
15045
+ ],
15046
+ "additionalProperties": false,
15047
+ "$schema": "http://json-schema.org/draft-07/schema#"
15048
+ },
15049
+ "annotations": {
15050
+ "title": "Save Image Asset",
15051
+ "readOnlyHint": false,
15052
+ "destructiveHint": false,
15053
+ "idempotentHint": true,
15054
+ "openWorldHint": true
15055
+ }
15056
+ },
15057
+ {
15058
+ "id": "image_asset_get",
15059
+ "upstreamName": "image_asset_get",
15060
+ "description": "Read one authorized private image asset and optionally mint a five-minute preview URL. The URL is never persisted; call again after expiry.",
15061
+ "inputJsonSchema": {
15062
+ "type": "object",
15063
+ "properties": {
15064
+ "vault": {
15065
+ "type": "string"
15066
+ },
15067
+ "assetId": {
15068
+ "type": "string",
15069
+ "minLength": 1
15070
+ },
15071
+ "includePreview": {
15072
+ "type": "boolean",
15073
+ "default": true
15074
+ }
15075
+ },
15076
+ "required": [
15077
+ "assetId"
15078
+ ],
15079
+ "additionalProperties": false,
15080
+ "$schema": "http://json-schema.org/draft-07/schema#"
15081
+ },
15082
+ "outputJsonSchema": {
15083
+ "type": "object",
15084
+ "properties": {
15085
+ "ok": {
15086
+ "type": "boolean",
15087
+ "enum": [
15088
+ true,
15089
+ false
15090
+ ]
15091
+ },
15092
+ "asset": {
15093
+ "type": "object",
15094
+ "properties": {
15095
+ "assetId": {
15096
+ "type": "string"
15097
+ },
15098
+ "title": {
15099
+ "type": "string"
15100
+ },
15101
+ "description": {
15102
+ "type": [
15103
+ "string",
15104
+ "null"
15105
+ ]
15106
+ },
15107
+ "altText": {
15108
+ "type": [
15109
+ "string",
15110
+ "null"
15111
+ ]
15112
+ },
15113
+ "sourceUrl": {
15114
+ "type": [
15115
+ "string",
15116
+ "null"
15117
+ ]
15118
+ },
15119
+ "sourceKind": {
15120
+ "type": "string"
15121
+ },
15122
+ "mimeType": {
15123
+ "type": "string"
15124
+ },
15125
+ "bytes": {
15126
+ "type": "number"
15127
+ },
15128
+ "width": {
15129
+ "type": "number"
15130
+ },
15131
+ "height": {
15132
+ "type": "number"
15133
+ },
15134
+ "projectId": {
15135
+ "type": [
15136
+ "string",
15137
+ "null"
15138
+ ]
15139
+ },
15140
+ "folderId": {
15141
+ "type": [
15142
+ "string",
15143
+ "null"
15144
+ ]
15145
+ },
15146
+ "tags": {
15147
+ "type": "array",
15148
+ "items": {
15149
+ "type": "string"
15150
+ }
15151
+ },
15152
+ "status": {
15153
+ "type": "string"
15154
+ },
15155
+ "embeddingStatus": {
15156
+ "type": "string"
15157
+ },
15158
+ "createdAt": {
15159
+ "type": "string"
15160
+ },
15161
+ "updatedAt": {
15162
+ "type": "string"
15163
+ },
15164
+ "preview": {
15165
+ "type": "object",
15166
+ "properties": {
15167
+ "url": {
15168
+ "type": "string",
15169
+ "format": "uri"
15170
+ },
15171
+ "expiresAt": {
15172
+ "type": "string",
15173
+ "format": "date-time"
15174
+ },
15175
+ "mimeType": {
15176
+ "type": "string",
15177
+ "const": "image/webp"
15178
+ }
15179
+ },
15180
+ "required": [
15181
+ "url",
15182
+ "expiresAt",
15183
+ "mimeType"
15184
+ ],
15185
+ "additionalProperties": false
15186
+ }
15187
+ },
15188
+ "required": [
15189
+ "assetId",
15190
+ "title",
15191
+ "description",
15192
+ "altText",
15193
+ "sourceUrl",
15194
+ "sourceKind",
15195
+ "mimeType",
15196
+ "bytes",
15197
+ "width",
15198
+ "height",
15199
+ "projectId",
15200
+ "folderId",
15201
+ "tags",
15202
+ "status",
15203
+ "embeddingStatus",
15204
+ "createdAt",
15205
+ "updatedAt"
15206
+ ],
15207
+ "additionalProperties": false
15208
+ },
15209
+ "code": {
15210
+ "type": "string"
15211
+ },
15212
+ "error": {
15213
+ "type": "string"
15214
+ }
15215
+ },
15216
+ "required": [
15217
+ "ok"
15218
+ ],
15219
+ "additionalProperties": false,
15220
+ "$schema": "http://json-schema.org/draft-07/schema#"
15221
+ },
15222
+ "annotations": {
15223
+ "title": "Get Image Asset",
15224
+ "readOnlyHint": true,
15225
+ "destructiveHint": false,
15226
+ "idempotentHint": true,
15227
+ "openWorldHint": false
15228
+ }
15229
+ },
15230
+ {
15231
+ "id": "image_asset_list",
15232
+ "upstreamName": "image_asset_list",
15233
+ "description": "List authorized private image metadata with exact location, provenance, media, tag, and creation-time filters. Use image_asset_search for semantic retrieval.",
15234
+ "inputJsonSchema": {
15235
+ "type": "object",
15236
+ "properties": {
15237
+ "vault": {
15238
+ "type": "string"
15239
+ },
15240
+ "projectId": {
15241
+ "type": "string"
15242
+ },
15243
+ "folderId": {
15244
+ "type": "string"
15245
+ },
15246
+ "sourceKind": {
15247
+ "type": "string",
15248
+ "enum": [
15249
+ "upload",
15250
+ "scrape",
15251
+ "screenshot",
15252
+ "instagram",
15253
+ "external_url",
15254
+ "import"
15255
+ ]
15256
+ },
15257
+ "sourceHost": {
15258
+ "type": "string",
15259
+ "minLength": 1,
15260
+ "maxLength": 253
15261
+ },
15262
+ "mimeType": {
15263
+ "type": "string",
15264
+ "enum": [
15265
+ "image/jpeg",
15266
+ "image/png",
15267
+ "image/webp",
15268
+ "image/gif"
15269
+ ]
15270
+ },
15271
+ "tags": {
15272
+ "type": "array",
15273
+ "items": {
15274
+ "type": "string",
15275
+ "minLength": 1,
15276
+ "maxLength": 80
15277
+ },
15278
+ "maxItems": 20
15279
+ },
15280
+ "createdAfter": {
15281
+ "type": "string",
15282
+ "format": "date-time"
15283
+ },
15284
+ "createdBefore": {
15285
+ "type": "string",
15286
+ "format": "date-time"
15287
+ },
15288
+ "limit": {
15289
+ "type": "integer",
15290
+ "minimum": 1,
15291
+ "maximum": 100,
15292
+ "default": 30
15293
+ }
15294
+ },
15295
+ "additionalProperties": false,
15296
+ "$schema": "http://json-schema.org/draft-07/schema#"
15297
+ },
15298
+ "outputJsonSchema": {
15299
+ "type": "object",
15300
+ "properties": {
15301
+ "ok": {
15302
+ "type": "boolean",
15303
+ "enum": [
15304
+ true,
15305
+ false
15306
+ ]
15307
+ },
15308
+ "assets": {
15309
+ "type": "array",
15310
+ "items": {
15311
+ "type": "object",
15312
+ "properties": {
15313
+ "assetId": {
15314
+ "type": "string"
15315
+ },
15316
+ "title": {
15317
+ "type": "string"
15318
+ },
15319
+ "description": {
15320
+ "type": [
15321
+ "string",
15322
+ "null"
15323
+ ]
15324
+ },
15325
+ "altText": {
15326
+ "type": [
15327
+ "string",
15328
+ "null"
15329
+ ]
15330
+ },
15331
+ "sourceUrl": {
15332
+ "type": [
15333
+ "string",
15334
+ "null"
15335
+ ]
15336
+ },
15337
+ "sourceKind": {
15338
+ "type": "string"
15339
+ },
15340
+ "mimeType": {
15341
+ "type": "string"
15342
+ },
15343
+ "bytes": {
15344
+ "type": "number"
15345
+ },
15346
+ "width": {
15347
+ "type": "number"
15348
+ },
15349
+ "height": {
15350
+ "type": "number"
15351
+ },
15352
+ "projectId": {
15353
+ "type": [
15354
+ "string",
15355
+ "null"
15356
+ ]
15357
+ },
15358
+ "folderId": {
15359
+ "type": [
15360
+ "string",
15361
+ "null"
15362
+ ]
15363
+ },
15364
+ "tags": {
15365
+ "type": "array",
15366
+ "items": {
15367
+ "type": "string"
15368
+ }
15369
+ },
15370
+ "status": {
15371
+ "type": "string"
15372
+ },
15373
+ "embeddingStatus": {
15374
+ "type": "string"
15375
+ },
15376
+ "createdAt": {
15377
+ "type": "string"
15378
+ },
15379
+ "updatedAt": {
15380
+ "type": "string"
15381
+ },
15382
+ "preview": {
15383
+ "type": "object",
15384
+ "properties": {
15385
+ "url": {
15386
+ "type": "string",
15387
+ "format": "uri"
15388
+ },
15389
+ "expiresAt": {
15390
+ "type": "string",
15391
+ "format": "date-time"
15392
+ },
15393
+ "mimeType": {
15394
+ "type": "string",
15395
+ "const": "image/webp"
15396
+ }
15397
+ },
15398
+ "required": [
15399
+ "url",
15400
+ "expiresAt",
15401
+ "mimeType"
15402
+ ],
15403
+ "additionalProperties": false
15404
+ }
15405
+ },
15406
+ "required": [
15407
+ "assetId",
15408
+ "title",
15409
+ "description",
15410
+ "altText",
15411
+ "sourceUrl",
15412
+ "sourceKind",
15413
+ "mimeType",
15414
+ "bytes",
15415
+ "width",
15416
+ "height",
15417
+ "projectId",
15418
+ "folderId",
15419
+ "tags",
15420
+ "status",
15421
+ "embeddingStatus",
15422
+ "createdAt",
15423
+ "updatedAt"
15424
+ ],
15425
+ "additionalProperties": false
15426
+ }
15427
+ },
15428
+ "count": {
15429
+ "type": "number"
15430
+ },
15431
+ "code": {
15432
+ "type": "string"
15433
+ },
15434
+ "error": {
15435
+ "type": "string"
15436
+ }
15437
+ },
15438
+ "required": [
15439
+ "ok"
15440
+ ],
15441
+ "additionalProperties": false,
15442
+ "$schema": "http://json-schema.org/draft-07/schema#"
15443
+ },
15444
+ "annotations": {
15445
+ "title": "List Image Assets",
15446
+ "readOnlyHint": true,
15447
+ "destructiveHint": false,
15448
+ "idempotentHint": true,
15449
+ "openWorldHint": false
15450
+ }
15451
+ },
15452
+ {
15453
+ "id": "image_asset_search",
15454
+ "upstreamName": "image_asset_search",
15455
+ "description": "Semantically search authorized private image Memory using text, a stored asset, a public HTTPS image, or bounded base64. Text plus one image performs a fused query. This consumes query-embedding usage.",
15456
+ "inputJsonSchema": {
15457
+ "type": "object",
15458
+ "properties": {
15459
+ "vault": {
15460
+ "type": "string"
15461
+ },
15462
+ "queryText": {
15463
+ "type": "string",
15464
+ "minLength": 1,
15465
+ "maxLength": 4e3
15466
+ },
15467
+ "queryAssetId": {
15468
+ "type": "string",
15469
+ "minLength": 1
15470
+ },
15471
+ "queryUrl": {
15472
+ "type": "string",
15473
+ "format": "uri"
15474
+ },
15475
+ "queryImageBase64": {
15476
+ "type": "string",
15477
+ "minLength": 1
15478
+ },
15479
+ "projectId": {
15480
+ "type": "string"
15481
+ },
15482
+ "folderId": {
15483
+ "type": "string"
15484
+ },
15485
+ "sourceKind": {
15486
+ "type": "string",
15487
+ "enum": [
15488
+ "upload",
15489
+ "scrape",
15490
+ "screenshot",
15491
+ "instagram",
15492
+ "external_url",
15493
+ "import"
15494
+ ]
15495
+ },
15496
+ "sourceHost": {
15497
+ "type": "string",
15498
+ "minLength": 1,
15499
+ "maxLength": 253
15500
+ },
15501
+ "mimeType": {
15502
+ "type": "string",
15503
+ "enum": [
15504
+ "image/jpeg",
15505
+ "image/png",
15506
+ "image/webp",
15507
+ "image/gif"
15508
+ ]
15509
+ },
15510
+ "tags": {
15511
+ "type": "array",
15512
+ "items": {
15513
+ "type": "string",
15514
+ "minLength": 1,
15515
+ "maxLength": 80
15516
+ },
15517
+ "maxItems": 20
15518
+ },
15519
+ "createdAfter": {
15520
+ "type": "string",
15521
+ "format": "date-time"
15522
+ },
15523
+ "createdBefore": {
15524
+ "type": "string",
15525
+ "format": "date-time"
15526
+ },
15527
+ "limit": {
15528
+ "type": "integer",
15529
+ "minimum": 1,
15530
+ "maximum": 30,
15531
+ "default": 10
15532
+ },
15533
+ "includePreview": {
15534
+ "type": "boolean",
15535
+ "default": false
15536
+ }
15537
+ },
15538
+ "additionalProperties": false,
15539
+ "$schema": "http://json-schema.org/draft-07/schema#"
15540
+ },
15541
+ "outputJsonSchema": {
15542
+ "type": "object",
15543
+ "properties": {
15544
+ "ok": {
15545
+ "type": "boolean",
15546
+ "enum": [
15547
+ true,
15548
+ false
15549
+ ]
15550
+ },
15551
+ "results": {
15552
+ "type": "array",
15553
+ "items": {
15554
+ "type": "object",
15555
+ "properties": {
15556
+ "asset": {
15557
+ "type": "object",
15558
+ "properties": {
15559
+ "assetId": {
15560
+ "type": "string"
15561
+ },
15562
+ "title": {
15563
+ "type": "string"
15564
+ },
15565
+ "description": {
15566
+ "type": [
15567
+ "string",
15568
+ "null"
15569
+ ]
15570
+ },
15571
+ "altText": {
15572
+ "type": [
15573
+ "string",
15574
+ "null"
15575
+ ]
15576
+ },
15577
+ "sourceUrl": {
15578
+ "type": [
15579
+ "string",
15580
+ "null"
15581
+ ]
15582
+ },
15583
+ "sourceKind": {
15584
+ "type": "string"
15585
+ },
15586
+ "mimeType": {
15587
+ "type": "string"
15588
+ },
15589
+ "bytes": {
15590
+ "type": "number"
15591
+ },
15592
+ "width": {
15593
+ "type": "number"
15594
+ },
15595
+ "height": {
15596
+ "type": "number"
15597
+ },
15598
+ "projectId": {
15599
+ "type": [
15600
+ "string",
15601
+ "null"
15602
+ ]
15603
+ },
15604
+ "folderId": {
15605
+ "type": [
15606
+ "string",
15607
+ "null"
15608
+ ]
15609
+ },
15610
+ "tags": {
15611
+ "type": "array",
15612
+ "items": {
15613
+ "type": "string"
15614
+ }
15615
+ },
15616
+ "status": {
15617
+ "type": "string"
15618
+ },
15619
+ "embeddingStatus": {
15620
+ "type": "string"
15621
+ },
15622
+ "createdAt": {
15623
+ "type": "string"
15624
+ },
15625
+ "updatedAt": {
15626
+ "type": "string"
15627
+ },
15628
+ "preview": {
15629
+ "type": "object",
15630
+ "properties": {
15631
+ "url": {
15632
+ "type": "string",
15633
+ "format": "uri"
15634
+ },
15635
+ "expiresAt": {
15636
+ "type": "string",
15637
+ "format": "date-time"
15638
+ },
15639
+ "mimeType": {
15640
+ "type": "string",
15641
+ "const": "image/webp"
15642
+ }
15643
+ },
15644
+ "required": [
15645
+ "url",
15646
+ "expiresAt",
15647
+ "mimeType"
15648
+ ],
15649
+ "additionalProperties": false
15650
+ }
15651
+ },
15652
+ "required": [
15653
+ "assetId",
15654
+ "title",
15655
+ "description",
15656
+ "altText",
15657
+ "sourceUrl",
15658
+ "sourceKind",
15659
+ "mimeType",
15660
+ "bytes",
15661
+ "width",
15662
+ "height",
15663
+ "projectId",
15664
+ "folderId",
15665
+ "tags",
15666
+ "status",
15667
+ "embeddingStatus",
15668
+ "createdAt",
15669
+ "updatedAt"
15670
+ ],
15671
+ "additionalProperties": false
15672
+ },
15673
+ "score": {
15674
+ "type": "number"
15675
+ },
15676
+ "matchRepresentations": {
15677
+ "type": "array",
15678
+ "items": {
15679
+ "type": "string",
15680
+ "enum": [
15681
+ "visual",
15682
+ "fused"
15683
+ ]
15684
+ }
15685
+ },
15686
+ "embeddingModel": {
15687
+ "type": "string"
15688
+ }
15689
+ },
15690
+ "required": [
15691
+ "asset",
15692
+ "score",
15693
+ "matchRepresentations",
15694
+ "embeddingModel"
15695
+ ],
15696
+ "additionalProperties": false
15697
+ }
15698
+ },
15699
+ "count": {
15700
+ "type": "number"
15701
+ },
15702
+ "code": {
15703
+ "type": "string"
15704
+ },
15705
+ "error": {
15706
+ "type": "string"
15707
+ }
15708
+ },
15709
+ "required": [
15710
+ "ok"
15711
+ ],
15712
+ "additionalProperties": false,
15713
+ "$schema": "http://json-schema.org/draft-07/schema#"
15714
+ },
15715
+ "annotations": {
15716
+ "title": "Search Image Assets",
15717
+ "readOnlyHint": true,
15718
+ "destructiveHint": false,
15719
+ "idempotentHint": true,
15720
+ "openWorldHint": true
15721
+ }
15722
+ },
15723
+ {
15724
+ "id": "image_asset_move",
15725
+ "upstreamName": "image_asset_move",
15726
+ "description": "Move an image asset between project/folder locations in the same writable Memory vault. This updates metadata only and never copies private image bytes.",
15727
+ "inputJsonSchema": {
15728
+ "type": "object",
15729
+ "properties": {
15730
+ "vault": {
15731
+ "type": "string"
15732
+ },
15733
+ "assetId": {
15734
+ "type": "string",
15735
+ "minLength": 1
15736
+ },
15737
+ "projectId": {
15738
+ "anyOf": [
15739
+ {
15740
+ "type": "string",
15741
+ "minLength": 1
15742
+ },
15743
+ {
15744
+ "type": "null"
15745
+ }
15746
+ ]
15747
+ },
15748
+ "folderId": {
15749
+ "anyOf": [
15750
+ {
15751
+ "type": "string",
15752
+ "minLength": 1
15753
+ },
15754
+ {
15755
+ "type": "null"
15756
+ }
15757
+ ]
15758
+ }
15759
+ },
15760
+ "required": [
15761
+ "assetId"
15762
+ ],
15763
+ "additionalProperties": false,
15764
+ "$schema": "http://json-schema.org/draft-07/schema#"
15765
+ },
15766
+ "outputJsonSchema": {
15767
+ "type": "object",
15768
+ "properties": {
15769
+ "ok": {
15770
+ "type": "boolean",
15771
+ "enum": [
15772
+ true,
15773
+ false
15774
+ ]
15775
+ },
15776
+ "asset": {
15777
+ "type": "object",
15778
+ "properties": {
15779
+ "assetId": {
15780
+ "type": "string"
15781
+ },
15782
+ "title": {
15783
+ "type": "string"
15784
+ },
15785
+ "description": {
15786
+ "type": [
15787
+ "string",
15788
+ "null"
15789
+ ]
15790
+ },
15791
+ "altText": {
15792
+ "type": [
15793
+ "string",
15794
+ "null"
15795
+ ]
15796
+ },
15797
+ "sourceUrl": {
15798
+ "type": [
15799
+ "string",
15800
+ "null"
15801
+ ]
15802
+ },
15803
+ "sourceKind": {
15804
+ "type": "string"
15805
+ },
15806
+ "mimeType": {
15807
+ "type": "string"
15808
+ },
15809
+ "bytes": {
15810
+ "type": "number"
15811
+ },
15812
+ "width": {
15813
+ "type": "number"
15814
+ },
15815
+ "height": {
15816
+ "type": "number"
15817
+ },
15818
+ "projectId": {
15819
+ "type": [
15820
+ "string",
15821
+ "null"
15822
+ ]
15823
+ },
15824
+ "folderId": {
15825
+ "type": [
15826
+ "string",
15827
+ "null"
15828
+ ]
15829
+ },
15830
+ "tags": {
15831
+ "type": "array",
15832
+ "items": {
15833
+ "type": "string"
15834
+ }
15835
+ },
15836
+ "status": {
15837
+ "type": "string"
15838
+ },
15839
+ "embeddingStatus": {
15840
+ "type": "string"
15841
+ },
15842
+ "createdAt": {
15843
+ "type": "string"
15844
+ },
15845
+ "updatedAt": {
15846
+ "type": "string"
15847
+ },
15848
+ "preview": {
15849
+ "type": "object",
15850
+ "properties": {
15851
+ "url": {
15852
+ "type": "string",
15853
+ "format": "uri"
15854
+ },
15855
+ "expiresAt": {
15856
+ "type": "string",
15857
+ "format": "date-time"
15858
+ },
15859
+ "mimeType": {
15860
+ "type": "string",
15861
+ "const": "image/webp"
15862
+ }
15863
+ },
15864
+ "required": [
15865
+ "url",
15866
+ "expiresAt",
15867
+ "mimeType"
15868
+ ],
15869
+ "additionalProperties": false
15870
+ }
15871
+ },
15872
+ "required": [
15873
+ "assetId",
15874
+ "title",
15875
+ "description",
15876
+ "altText",
15877
+ "sourceUrl",
15878
+ "sourceKind",
15879
+ "mimeType",
15880
+ "bytes",
15881
+ "width",
15882
+ "height",
15883
+ "projectId",
15884
+ "folderId",
15885
+ "tags",
15886
+ "status",
15887
+ "embeddingStatus",
15888
+ "createdAt",
15889
+ "updatedAt"
15890
+ ],
15891
+ "additionalProperties": false
15892
+ },
15893
+ "code": {
15894
+ "type": "string"
15895
+ },
15896
+ "error": {
15897
+ "type": "string"
15898
+ }
15899
+ },
15900
+ "required": [
15901
+ "ok"
15902
+ ],
15903
+ "additionalProperties": false,
15904
+ "$schema": "http://json-schema.org/draft-07/schema#"
15905
+ },
15906
+ "annotations": {
15907
+ "title": "Move Image Asset",
15908
+ "readOnlyHint": false,
15909
+ "destructiveHint": false,
15910
+ "idempotentHint": true,
15911
+ "openWorldHint": false
15912
+ }
15913
+ },
15914
+ {
15915
+ "id": "image_asset_delete",
15916
+ "upstreamName": "image_asset_delete",
15917
+ "description": "DESTRUCTIVE: delete one governed image asset, remove its semantic vectors, and purge private bytes when no other logical asset uses them. Retry with the same assetId if an earlier response was lost.",
15918
+ "inputJsonSchema": {
15919
+ "type": "object",
15920
+ "properties": {
15921
+ "vault": {
15922
+ "type": "string"
15923
+ },
15924
+ "assetId": {
15925
+ "type": "string",
15926
+ "minLength": 1
15927
+ },
15928
+ "confirmDelete": {
15929
+ "type": "boolean",
15930
+ "const": true,
15931
+ "description": "Must be true after the caller has confirmed deletion."
15932
+ }
15933
+ },
15934
+ "required": [
15935
+ "assetId",
15936
+ "confirmDelete"
15937
+ ],
15938
+ "additionalProperties": false,
15939
+ "$schema": "http://json-schema.org/draft-07/schema#"
15940
+ },
15941
+ "outputJsonSchema": {
15942
+ "type": "object",
15943
+ "properties": {
15944
+ "ok": {
15945
+ "type": "boolean",
15946
+ "enum": [
15947
+ true,
15948
+ false
15949
+ ]
15950
+ },
15951
+ "deleted": {
15952
+ "type": "boolean"
15953
+ },
15954
+ "assetId": {
15955
+ "type": "string"
15956
+ },
15957
+ "code": {
15958
+ "type": "string"
15959
+ },
15960
+ "error": {
15961
+ "type": "string"
15962
+ }
15963
+ },
15964
+ "required": [
15965
+ "ok"
15966
+ ],
15967
+ "additionalProperties": false,
15968
+ "$schema": "http://json-schema.org/draft-07/schema#"
15969
+ },
15970
+ "annotations": {
15971
+ "title": "Delete Image Asset",
15972
+ "readOnlyHint": false,
15973
+ "destructiveHint": true,
15974
+ "idempotentHint": true,
15975
+ "openWorldHint": false
15976
+ }
15977
+ }
15978
+ ];
14340
15979
 
14341
15980
  // src/mcp/memory-tool-schemas.ts
14342
15981
  import { z as z11 } from "zod";
@@ -16869,7 +18508,7 @@ var MEMORY_TOOL_REGISTRY = [
16869
18508
  ...schema,
16870
18509
  description: MEMORY_TOOL_DESCRIPTION_OVERRIDES[schema.id] ?? schema.description
16871
18510
  })),
16872
- ...IMAGE_ASSET_MCP_DEFINITIONS
18511
+ ...MEMORY_IMAGE_TOOL_SCHEMAS
16873
18512
  ];
16874
18513
 
16875
18514
  // src/mcp/memory-mcp-server.ts
@@ -17626,4 +19265,3 @@ export {
17626
19265
  ScheduledResultsMcpExecutor,
17627
19266
  registerScheduledResultsMcpTools
17628
19267
  };
17629
- //# sourceMappingURL=chunk-SRRI2HJL.js.map