@clipform/mcp-server 5.11.0 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-client.js +1 -1
- package/dist/{chunk-P27RWNSP.js → chunk-4T23OPCL.js} +2 -2
- package/dist/{chunk-73UYEWQP.js → chunk-EWYIXFGI.js} +32 -31
- package/dist/chunk-EWYIXFGI.js.map +1 -0
- package/dist/{chunk-7NLXUGGN.js → chunk-OUUEFJ6K.js} +37 -13
- package/dist/chunk-OUUEFJ6K.js.map +1 -0
- package/dist/{chunk-4RTWGIA7.js → chunk-UVQWEPR2.js} +3 -3
- package/dist/{chunk-V76FKPAT.js → chunk-Z4EWEJ6E.js} +3 -3
- package/dist/index.js +5 -5
- package/dist/prompts.js +3 -3
- package/dist/resources.js +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +5 -5
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/chunk-73UYEWQP.js.map +0 -1
- package/dist/chunk-7NLXUGGN.js.map +0 -1
- /package/dist/{chunk-P27RWNSP.js.map → chunk-4T23OPCL.js.map} +0 -0
- /package/dist/{chunk-4RTWGIA7.js.map → chunk-UVQWEPR2.js.map} +0 -0
- /package/dist/{chunk-V76FKPAT.js.map → chunk-Z4EWEJ6E.js.map} +0 -0
package/dist/api-client.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CURRENT_PLAN_VERSIONS,
|
|
3
3
|
PLAN_LIMITS,
|
|
4
4
|
callApi
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OUUEFJ6K.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-
|
|
148
|
+
//# sourceMappingURL=chunk-4T23OPCL.js.map
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
union,
|
|
32
32
|
unknown,
|
|
33
33
|
url
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-Z4EWEJ6E.js";
|
|
35
35
|
import {
|
|
36
36
|
GUIDE_TYPES,
|
|
37
37
|
QUIZ_VARIANTS,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
getGuideUri,
|
|
41
41
|
guideFallbackText,
|
|
42
42
|
registerResources
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-UVQWEPR2.js";
|
|
44
44
|
import {
|
|
45
45
|
ANON_PREVIEW_LINK_LABEL,
|
|
46
46
|
ANON_PREVIEW_NOTICE,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
isPreviewViewerUrl,
|
|
55
55
|
previewOnlyNotice,
|
|
56
56
|
withAdoptedNotice
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-4T23OPCL.js";
|
|
58
58
|
import {
|
|
59
59
|
ACTIVE_NODE_TYPES,
|
|
60
60
|
ANON_MCP_BLOCKED_NODE_TYPES,
|
|
@@ -66,6 +66,7 @@ import {
|
|
|
66
66
|
FEATURE_FLAGS,
|
|
67
67
|
FORM_TYPES_LIST,
|
|
68
68
|
FORM_TYPE_ALIASES,
|
|
69
|
+
LINK_VARIABLE_PRESETS,
|
|
69
70
|
LOGIC_TARGET_TYPES,
|
|
70
71
|
MAX_CLIP_SECONDS,
|
|
71
72
|
MAX_NARRATION_CHARS,
|
|
@@ -113,7 +114,7 @@ import {
|
|
|
113
114
|
textResult,
|
|
114
115
|
validateVariableKey,
|
|
115
116
|
viewerUrl
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-OUUEFJ6K.js";
|
|
117
118
|
import {
|
|
118
119
|
getMcpAuth,
|
|
119
120
|
runWithMcpAuth,
|
|
@@ -17319,11 +17320,11 @@ function formatFormState(data) {
|
|
|
17319
17320
|
|
|
17320
17321
|
// src/tools/get-form.ts
|
|
17321
17322
|
var TargetTypeSchema = external_exports.enum(LOGIC_TARGET_TYPES);
|
|
17322
|
-
function
|
|
17323
|
+
function linkVariablesText(data) {
|
|
17323
17324
|
const rows = Array.isArray(data.variables) ? data.variables : [];
|
|
17324
17325
|
const links = rows.filter((v) => v && v.kind === "custom" && v.url_settable === true && typeof v.key === "string" && !isReservedVariableKey(v.key));
|
|
17325
17326
|
if (links.length === 0) return "";
|
|
17326
|
-
const lines = ["", "
|
|
17327
|
+
const lines = ["", "Variables filled from the link (change with clipform_set_link_variables):"];
|
|
17327
17328
|
for (const v of links) {
|
|
17328
17329
|
lines.push(` ${v.key} (${v.type ?? "text"}, after ${isPersonalLinkKey(v.key) ? "#" : "?"} in the link)`);
|
|
17329
17330
|
}
|
|
@@ -17394,7 +17395,7 @@ function registerGetFormTool(server, opts = {}) {
|
|
|
17394
17395
|
if (!result.ok) {
|
|
17395
17396
|
return apiErrorResult(result);
|
|
17396
17397
|
}
|
|
17397
|
-
const text = formatFormState(result.data) + (opts.variables ?
|
|
17398
|
+
const text = formatFormState(result.data) + (opts.variables ? linkVariablesText(result.data) : "");
|
|
17398
17399
|
return structuredResult(text, projectFormState(result.data));
|
|
17399
17400
|
}
|
|
17400
17401
|
);
|
|
@@ -18927,8 +18928,8 @@ Routes by answer are set. Call clipform_get_form to check each answer's route; i
|
|
|
18927
18928
|
);
|
|
18928
18929
|
}
|
|
18929
18930
|
|
|
18930
|
-
// src/tools/set-link-
|
|
18931
|
-
var NOT_AVAILABLE = "
|
|
18931
|
+
// src/tools/set-link-variables.ts
|
|
18932
|
+
var NOT_AVAILABLE = "Variables filled from the link are not available on this workspace.";
|
|
18932
18933
|
var PasteSchema = external_exports.object({
|
|
18933
18934
|
tool: external_exports.string().describe("The email/chat tool this key is the merge tag for"),
|
|
18934
18935
|
snippet: external_exports.string().nullable().describe("Text to paste after the form link in that tool, or null when the tool adds it itself"),
|
|
@@ -18942,28 +18943,28 @@ function normExample(type, raw) {
|
|
|
18942
18943
|
if (raw === "" || raw === null) return null;
|
|
18943
18944
|
return coerceVariableValue(type, raw);
|
|
18944
18945
|
}
|
|
18945
|
-
function
|
|
18946
|
+
function registerSetLinkVariablesTool(server) {
|
|
18946
18947
|
server.registerTool(
|
|
18947
|
-
"
|
|
18948
|
+
"clipform_set_link_variables",
|
|
18948
18949
|
{
|
|
18949
|
-
title: "Set link
|
|
18950
|
-
description: `Declare which
|
|
18950
|
+
title: "Set link variables",
|
|
18951
|
+
description: `Declare which variables a form fills from its link (also called hidden fields or URL parameters), and get back the form's "Your link" to paste into an email or chat tool. A link variable is a value like a subscriber id that the link carries into the response, so you can tell who replied. Send the full list: variables you leave out are switched off (never deleted, so earlier answers keep working), and an unchanged list makes no changes. Use an opaque id as the value (e.g. the tool's subscriber id), not an email. Keys are lowercase letters, digits and underscores (e.g. mailchimp_id); a key that looks personal (email, phone, name) goes after # in the link so it never reaches a server log. Known keys come with the exact merge tag to paste: ${LINK_VARIABLE_PRESETS.map((p) => `${p.key} (${p.tool})`).join(", ")}. At most ${VARIABLE_MAX_LINK_PER_FORM} link variables per form. Read the values back with clipform_get_responses.`,
|
|
18951
18952
|
inputSchema: external_exports.object({
|
|
18952
18953
|
form_id: external_exports.string().uuid().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)"),
|
|
18953
|
-
|
|
18954
|
+
variables: external_exports.array(
|
|
18954
18955
|
external_exports.object({
|
|
18955
18956
|
key: external_exports.string().describe("Lowercase key the link carries, e.g. mailchimp_id"),
|
|
18956
18957
|
label: external_exports.string().optional().describe("Name shown in the dashboard (defaults to the key)"),
|
|
18957
|
-
type: external_exports.enum(VARIABLE_TYPES).optional().describe("text (default) or number. Cannot change once the
|
|
18958
|
+
type: external_exports.enum(VARIABLE_TYPES).optional().describe("text (default) or number. Cannot change once the variable exists."),
|
|
18958
18959
|
example: external_exports.union([external_exports.string(), external_exports.number()]).optional().describe("Sample value shown in the link")
|
|
18959
18960
|
})
|
|
18960
|
-
).max(VARIABLE_MAX_LINK_PER_FORM).describe("The complete list of
|
|
18961
|
+
).max(VARIABLE_MAX_LINK_PER_FORM).describe("The complete list of variables this form fills from its link")
|
|
18961
18962
|
}),
|
|
18962
18963
|
outputSchema: external_exports.object({
|
|
18963
18964
|
form_id: external_exports.string(),
|
|
18964
|
-
link: external_exports.string().optional().describe("Your link: the form link with every link
|
|
18965
|
+
link: external_exports.string().optional().describe("Your link: the form link with every link variable on it. Not viewable until the form is published (see live)."),
|
|
18965
18966
|
live: external_exports.boolean().optional().describe("Whether the form is published, i.e. the link works for respondents now"),
|
|
18966
|
-
|
|
18967
|
+
variables: external_exports.array(
|
|
18967
18968
|
external_exports.object({
|
|
18968
18969
|
key: external_exports.string(),
|
|
18969
18970
|
type: external_exports.string(),
|
|
@@ -18971,7 +18972,7 @@ function registerSetLinkFieldsTool(server) {
|
|
|
18971
18972
|
paste: PasteSchema.optional().describe("Present when the key is a known tool's merge tag")
|
|
18972
18973
|
})
|
|
18973
18974
|
),
|
|
18974
|
-
switched_off: external_exports.array(external_exports.string()).describe("Link
|
|
18975
|
+
switched_off: external_exports.array(external_exports.string()).describe("Link variables that were on and are now off (kept, not deleted)"),
|
|
18975
18976
|
changed: external_exports.boolean().describe("False when the list already matched and nothing was written")
|
|
18976
18977
|
}),
|
|
18977
18978
|
annotations: {
|
|
@@ -18981,8 +18982,8 @@ function registerSetLinkFieldsTool(server) {
|
|
|
18981
18982
|
openWorldHint: false
|
|
18982
18983
|
}
|
|
18983
18984
|
},
|
|
18984
|
-
async ({ form_id,
|
|
18985
|
-
const input =
|
|
18985
|
+
async ({ form_id, variables }) => {
|
|
18986
|
+
const input = variables;
|
|
18986
18987
|
const seen = /* @__PURE__ */ new Set();
|
|
18987
18988
|
for (const f of input) {
|
|
18988
18989
|
const keyError = validateVariableKey(f.key);
|
|
@@ -18994,7 +18995,7 @@ function registerSetLinkFieldsTool(server) {
|
|
|
18994
18995
|
}
|
|
18995
18996
|
}
|
|
18996
18997
|
if (input.length > VARIABLE_MAX_LINK_PER_FORM) {
|
|
18997
|
-
return refusedResult(`A form can fill ${VARIABLE_MAX_LINK_PER_FORM} link
|
|
18998
|
+
return refusedResult(`A form can fill ${VARIABLE_MAX_LINK_PER_FORM} variables from the link at most (got ${input.length}).`);
|
|
18998
18999
|
}
|
|
18999
19000
|
const listed = await callApi(`/forms/${form_id}/variables`);
|
|
19000
19001
|
if (!listed.ok) return apiErrorResult(listed);
|
|
@@ -19015,10 +19016,10 @@ function registerSetLinkFieldsTool(server) {
|
|
|
19015
19016
|
continue;
|
|
19016
19017
|
}
|
|
19017
19018
|
if (row.kind !== "custom" || score && row.id === score.id) {
|
|
19018
|
-
return refusedResult(`${f.key} is a built-in or Score variable,
|
|
19019
|
+
return refusedResult(`${f.key} is a built-in or Score variable, which the link cannot fill. Pick another key.`);
|
|
19019
19020
|
}
|
|
19020
19021
|
if (f.type !== void 0 && f.type !== row.type) {
|
|
19021
|
-
return refusedResult(`${f.key} already exists as ${row.type} and a
|
|
19022
|
+
return refusedResult(`${f.key} already exists as ${row.type} and a variable's type cannot change. Use another key, or delete it in the dashboard first.`);
|
|
19022
19023
|
}
|
|
19023
19024
|
const wantExample = f.example === void 0 ? void 0 : normExample(row.type, f.example);
|
|
19024
19025
|
if (f.example !== void 0 && wantExample === void 0) {
|
|
@@ -19082,7 +19083,7 @@ function registerSetLinkFieldsTool(server) {
|
|
|
19082
19083
|
if (failed.length > 0) {
|
|
19083
19084
|
const allRefused = failedStatuses.every((f) => isRefusedStatus(f.status, f.code));
|
|
19084
19085
|
return (allRefused ? refusedResult : errorResult)(
|
|
19085
|
-
`Some link
|
|
19086
|
+
`Some link variables were not saved. Done: ${applied.length ? applied.join(", ") : "nothing"}. Failed: ${failed.join("; ")}. Call clipform_set_link_variables again with the same list to finish - it only retries what is missing.`
|
|
19086
19087
|
);
|
|
19087
19088
|
}
|
|
19088
19089
|
const live = input.map((f) => finalRows.get(f.key)).filter((v) => !!v);
|
|
@@ -19102,9 +19103,9 @@ function registerSetLinkFieldsTool(server) {
|
|
|
19102
19103
|
});
|
|
19103
19104
|
const changed = applied.length > 0;
|
|
19104
19105
|
const lines = [
|
|
19105
|
-
changed ? `
|
|
19106
|
+
changed ? `Variables filled from the link saved on form ${form_id}.` : `Variables filled from the link already match - nothing changed on form ${form_id}.`
|
|
19106
19107
|
];
|
|
19107
|
-
if (outFields.length === 0) lines.push("No
|
|
19108
|
+
if (outFields.length === 0) lines.push("No variables are filled from the link. The form link carries no values.");
|
|
19108
19109
|
for (const f of outFields) {
|
|
19109
19110
|
lines.push(`- ${f.key} (${f.type}, after ${f.in === "hash" ? "#" : "?"} in the link)${f.paste ? ` - ${f.paste.tool}: ${f.paste.snippet ?? f.paste.note}` : ""}`);
|
|
19110
19111
|
}
|
|
@@ -19116,7 +19117,7 @@ function registerSetLinkFieldsTool(server) {
|
|
|
19116
19117
|
);
|
|
19117
19118
|
lines.push("Replace each empty or sample value with the tool's own merge tag for the subscriber id.");
|
|
19118
19119
|
} else if (outFields.length > 0) {
|
|
19119
|
-
lines.push("", "The form link could not be read just now. Call clipform_get_form to get the form's link, then add each
|
|
19120
|
+
lines.push("", "The form link could not be read just now. Call clipform_get_form to get the form's link, then add each variable after ? (or # for a personal key).");
|
|
19120
19121
|
}
|
|
19121
19122
|
if (outFields.some((f) => f.in === "hash")) {
|
|
19122
19123
|
lines.push("A personal key (email, phone, name) goes after # so it stays out of server logs. Prefer an opaque id over an email where the tool offers one.");
|
|
@@ -19126,7 +19127,7 @@ function registerSetLinkFieldsTool(server) {
|
|
|
19126
19127
|
return structuredResult(lines.join("\n"), {
|
|
19127
19128
|
form_id,
|
|
19128
19129
|
...link && outFields.length > 0 ? { link, live: isLive } : {},
|
|
19129
|
-
|
|
19130
|
+
variables: outFields,
|
|
19130
19131
|
switched_off: switchedOff,
|
|
19131
19132
|
changed
|
|
19132
19133
|
});
|
|
@@ -20848,7 +20849,7 @@ function createServer(options) {
|
|
|
20848
20849
|
registerGetNodeMediaTool(server);
|
|
20849
20850
|
registerDeleteNodeMediaTool(server);
|
|
20850
20851
|
registerSetNodeLogicTool(server);
|
|
20851
|
-
if (options?.variables === true)
|
|
20852
|
+
if (options?.variables === true) registerSetLinkVariablesTool(server);
|
|
20852
20853
|
registerLogGenerationTool(server);
|
|
20853
20854
|
registerSearchNewsTool(server);
|
|
20854
20855
|
registerGenerateTtsTool(server);
|
|
@@ -20935,4 +20936,4 @@ export {
|
|
|
20935
20936
|
* MIT Licensed
|
|
20936
20937
|
*)
|
|
20937
20938
|
*/
|
|
20938
|
-
//# sourceMappingURL=chunk-
|
|
20939
|
+
//# sourceMappingURL=chunk-EWYIXFGI.js.map
|