@clipform/mcp-server 4.10.1 → 4.10.3

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.
@@ -2,7 +2,7 @@ import {
2
2
  CURRENT_PLAN_VERSIONS,
3
3
  PLAN_LIMITS,
4
4
  callApi
5
- } from "./chunk-72MALJLK.js";
5
+ } from "./chunk-E456QCTV.js";
6
6
  import {
7
7
  getMcpAuth
8
8
  } from "./chunk-ENVV65JX.js";
@@ -145,4 +145,4 @@ export {
145
145
  getSessionContextWithAuth,
146
146
  getSessionContext
147
147
  };
148
- //# sourceMappingURL=chunk-2LQ5LNZ2.js.map
148
+ //# sourceMappingURL=chunk-NBHDZORG.js.map
@@ -29,7 +29,7 @@ import {
29
29
  union,
30
30
  unknown,
31
31
  url
32
- } from "./chunk-ZASIHIX3.js";
32
+ } from "./chunk-57ZVZROW.js";
33
33
  import {
34
34
  GUIDE_TYPES,
35
35
  QUIZ_VARIANTS,
@@ -38,7 +38,7 @@ import {
38
38
  getGuideUri,
39
39
  guideFallbackText,
40
40
  registerResources
41
- } from "./chunk-MNDNDG3A.js";
41
+ } from "./chunk-36WRDNVW.js";
42
42
  import {
43
43
  ANON_PREVIEW_LINK_LABEL,
44
44
  ANON_PREVIEW_NOTICE,
@@ -52,7 +52,7 @@ import {
52
52
  isPreviewViewerUrl,
53
53
  previewOnlyNotice,
54
54
  withAdoptedNotice
55
- } from "./chunk-2LQ5LNZ2.js";
55
+ } from "./chunk-NBHDZORG.js";
56
56
  import {
57
57
  ACTIVE_NODE_TYPES,
58
58
  ANON_MCP_BLOCKED_NODE_TYPES,
@@ -81,7 +81,7 @@ import {
81
81
  stripGatedConfigKeys,
82
82
  structuredResult,
83
83
  textResult
84
- } from "./chunk-72MALJLK.js";
84
+ } from "./chunk-E456QCTV.js";
85
85
  import {
86
86
  getMcpAuth,
87
87
  runWithMcpAuth,
@@ -17143,7 +17143,7 @@ function formatFormState(data) {
17143
17143
  const options = q.node_options ?? q.options;
17144
17144
  if (options && options.length > 0) {
17145
17145
  lines.push(
17146
- ` Options: ${options.map((o) => o.content).join(", ")}`
17146
+ ` Options: ${options.map((o) => o.id ? `${o.content} (id: ${o.id})` : o.content).join(", ")}`
17147
17147
  );
17148
17148
  }
17149
17149
  const next = projectNext(q, logicByNode);
@@ -17472,10 +17472,26 @@ function registerDeleteFormTool(server) {
17472
17472
  );
17473
17473
  }
17474
17474
 
17475
+ // src/lib/results-redaction.ts
17476
+ var META = NODE_TYPES;
17477
+ var COUNTS_ONLY_TYPES = Object.entries(META).filter(([, v]) => v.pii || v.respondent_media === "files" || v.respondent_media === "drawing").map(([t]) => t);
17478
+ var ACTION_BREAKDOWN_TYPES = Object.entries(META).filter(([t, v]) => v.category === "action" && !COUNTS_ONLY_TYPES.includes(t)).map(([t]) => t);
17479
+ var PHRASE_OVERRIDES = { details: "contact details" };
17480
+ function typePhrase(type) {
17481
+ return PHRASE_OVERRIDES[type] ?? META[type].label.toLowerCase();
17482
+ }
17483
+ function labelList(types) {
17484
+ const labels = Object.keys(META).filter((t) => types.includes(t)).map(typePhrase);
17485
+ if (labels.length <= 2) return labels.join(" and ");
17486
+ return `${labels.slice(0, -1).join(", ")}, and ${labels[labels.length - 1]}`;
17487
+ }
17488
+
17475
17489
  // src/tools/get-results.ts
17476
17490
  var MAX_TEXT_LENGTH = 500;
17477
17491
  var MAX_LABEL_LENGTH = 80;
17478
17492
  var MAX_RECENT_ANSWERS = 20;
17493
+ var COUNTS_ONLY_LABELS = labelList(COUNTS_ONLY_TYPES);
17494
+ var BREAKDOWN_ACTION_TYPES = ACTION_BREAKDOWN_TYPES.join("/");
17479
17495
  function coerceToString(value, maxLength) {
17480
17496
  if (value === null || value === void 0) return "";
17481
17497
  if (typeof value === "string") {
@@ -17500,8 +17516,7 @@ function projectNode(node) {
17500
17516
  total_responses: node.total_responses,
17501
17517
  total_views: node.total_views
17502
17518
  };
17503
- const meta = NODE_TYPES[node.node_type];
17504
- if (meta && (meta.pii || meta.respondent_media === "files" || meta.respondent_media === "drawing")) {
17519
+ if (COUNTS_ONLY_TYPES.includes(node.node_type)) {
17505
17520
  return base;
17506
17521
  }
17507
17522
  if (node.node_type === "choice") {
@@ -17546,7 +17561,7 @@ function registerGetResultsTool(server) {
17546
17561
  "clipform_get_results",
17547
17562
  {
17548
17563
  title: "Get Clipform Results",
17549
- description: `View response counts, choice/action answer breakdowns, and recent open-text answers for a form. Contact, file, draw, camera, and payment answers are counts only - use the dashboard for per-response detail. Needs a signed-in Clipform account (an anonymous session is asked to sign in).`,
17564
+ description: `View response counts, choice/action answer breakdowns, and recent open-text answers for a form. Answers to ${COUNTS_ONLY_LABELS} nodes are counts only - use the dashboard for per-response detail. Needs a signed-in Clipform account (an anonymous session is asked to sign in).`,
17550
17565
  inputSchema: external_exports.object({
17551
17566
  form_id: external_exports.string().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)")
17552
17567
  }),
@@ -17572,7 +17587,7 @@ function registerGetResultsTool(server) {
17572
17587
  count: external_exports.number(),
17573
17588
  percentage: external_exports.number()
17574
17589
  })
17575
- ).optional().describe("Answer breakdown - choice and action-category (booking/file_download/shopping) nodes only"),
17590
+ ).optional().describe(`Answer breakdown - choice and action-category (${BREAKDOWN_ACTION_TYPES}) nodes only`),
17576
17591
  recent_answers: external_exports.array(
17577
17592
  external_exports.object({
17578
17593
  text: external_exports.string(),
@@ -17580,7 +17595,7 @@ function registerGetResultsTool(server) {
17580
17595
  })
17581
17596
  ).optional().describe("Most recent open-text answers, capped at 20 - open questions only")
17582
17597
  })
17583
- ).describe("Nodes in form order. Contact/file/draw/camera/payment nodes carry only total_responses/total_views - no per-response detail."),
17598
+ ).describe(`Nodes in form order. The ${COUNTS_ONLY_LABELS} nodes carry only total_responses/total_views - no per-response detail.`),
17584
17599
  results_url: external_exports.string().optional().describe("Dashboard Responses tab for this form. Not present for an anonymous caller.")
17585
17600
  }),
17586
17601
  annotations: {
@@ -17635,6 +17650,8 @@ var REDACTED_TYPES = Object.fromEntries([
17635
17650
  // open is redacted ONLY when the answer is a recording (handled below).
17636
17651
  ...Object.entries(NODE_TYPES).filter(([, v]) => v.respondent_media === "files" || v.respondent_media === "drawing").map(([t, v]) => [t, `[${v.label.toLowerCase()} - view in dashboard]`])
17637
17652
  ]);
17653
+ var REDACTED_LABELS = labelList(Object.keys(REDACTED_TYPES));
17654
+ var REDACTION_FOOTER = `Answers to ${REDACTED_LABELS} questions and audio/video recordings are redacted here; payments show an amount/status summary only (the customer's details stay in the dashboard, which shows full response detail). For aggregate stats use clipform_get_results.`;
17638
17655
  function truncate(s, n = MAX_ANSWER_LENGTH) {
17639
17656
  return s.length > n ? `${s.slice(0, n - 1)}\u2026` : s;
17640
17657
  }
@@ -17655,7 +17672,7 @@ function registerGetResponsesTool(server) {
17655
17672
  "clipform_get_responses",
17656
17673
  {
17657
17674
  title: "List form responses",
17658
- description: "List a Clipform form's individual responses (submissions) with time filtering - complements clipform_get_results (aggregates). Answers questions like 'what came in during the last 24 hours', 'what's the longest answer', 'what did people say'. Text answers plus a non-PII payment summary (amount and status); contact details, file uploads, and audio/video answers are redacted to placeholders and the customer's payment details stay in the dashboard (the responses URL from clipform_get_form). Responses are sorted newest first unless sort: 'oldest'. Needs a signed-in Clipform account (an anonymous session is asked to sign in).",
17675
+ description: `List a Clipform form's individual responses (submissions) with time filtering - complements clipform_get_results (aggregates). Answers questions like 'what came in during the last 24 hours', 'what's the longest answer', 'what did people say'. Text answers plus a non-PII payment summary (amount and status); ${REDACTED_LABELS} answers and audio/video recordings are redacted to placeholders and the customer's payment details stay in the dashboard (the responses URL from clipform_get_form). Responses are sorted newest first unless sort: 'oldest'. Needs a signed-in Clipform account (an anonymous session is asked to sign in).`,
17659
17676
  inputSchema: external_exports.object({
17660
17677
  form_id: external_exports.string().describe("Form UUID (from clipform_list_forms / clipform_create_form)"),
17661
17678
  since: external_exports.string().datetime({ offset: true }).optional().describe("Only responses submitted at or after this ISO 8601 time (e.g. '2026-08-29T00:00:00Z')"),
@@ -17774,7 +17791,7 @@ function registerGetResponsesTool(server) {
17774
17791
  ...r.answers.map((a) => ` ${a.question}: ${a.answer}`)
17775
17792
  ]),
17776
17793
  ``,
17777
- `Contact details, files, and recordings are redacted here; payments show an amount/status summary only (the customer's details stay in the dashboard, which shows full response detail). For aggregate stats use clipform_get_results.`
17794
+ REDACTION_FOOTER
17778
17795
  ];
17779
17796
  return structuredResult(lines.join("\n"), {
17780
17797
  total_matching: totalMatching,
@@ -17929,6 +17946,9 @@ function registerAddNodeTool(server) {
17929
17946
  }
17930
17947
 
17931
17948
  // src/tools/update-node.ts
17949
+ var UpdateOptionSchema = OptionSchema.extend({
17950
+ id: external_exports.string().uuid().optional().describe("The option's id from clipform_get_form. Include it to keep this option with its routes, answer key and results; omit it to add a new option.")
17951
+ });
17932
17952
  var NodeUpdateSchema = external_exports.object({
17933
17953
  node_id: external_exports.string().describe("The node ID to update"),
17934
17954
  prompt: external_exports.string().optional().describe("New node prompt text"),
@@ -17938,8 +17958,8 @@ var NodeUpdateSchema = external_exports.object({
17938
17958
  config: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe(
17939
17959
  `${CONFIG_FIELD_DESCRIPTION} Merged shallowly into the stored config - only the keys you pass are changed. Set a key to null to delete it; nested objects are replaced wholesale. When type is changed in the same call, config replaces the stored configuration instead of merging.`
17940
17960
  ),
17941
- options: external_exports.array(OptionSchema).optional().describe(
17942
- "Replace all options (for choice nodes). Omit to keep existing options."
17961
+ options: external_exports.array(UpdateOptionSchema).optional().describe(
17962
+ "The full option list (for choice nodes). Include each option's id from clipform_get_form to keep that option and its routes, answer key and results. Options without an id are added as new. Options left out are removed together with their routes. Omit to keep existing options."
17943
17963
  )
17944
17964
  }).superRefine((update, ctx) => {
17945
17965
  if (update.type && update.options !== void 0) {
@@ -20392,4 +20412,4 @@ export {
20392
20412
  * MIT Licensed
20393
20413
  *)
20394
20414
  */
20395
- //# sourceMappingURL=chunk-RQ5HBDZN.js.map
20415
+ //# sourceMappingURL=chunk-PKBBPOXQ.js.map