@avallon-labs/mcp 62.4.0 → 62.5.0-staging.1342
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/index.js
CHANGED
|
@@ -2806,6 +2806,28 @@ var createFormSubmission = async (createFormSubmissionBody, options) => {
|
|
|
2806
2806
|
const data = body ? JSON.parse(body) : {};
|
|
2807
2807
|
return { data, status: res.status, headers: res.headers };
|
|
2808
2808
|
};
|
|
2809
|
+
var getListFormSubmissionsUrl = (params) => {
|
|
2810
|
+
const normalizedParams = new URLSearchParams();
|
|
2811
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
2812
|
+
if (value !== void 0) {
|
|
2813
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2814
|
+
}
|
|
2815
|
+
});
|
|
2816
|
+
const stringifiedParams = normalizedParams.toString();
|
|
2817
|
+
return stringifiedParams.length > 0 ? `/v1/form-submissions?${stringifiedParams}` : `/v1/form-submissions`;
|
|
2818
|
+
};
|
|
2819
|
+
var listFormSubmissions = async (params, options) => {
|
|
2820
|
+
const res = await fetch(
|
|
2821
|
+
getListFormSubmissionsUrl(params),
|
|
2822
|
+
{
|
|
2823
|
+
...options,
|
|
2824
|
+
method: "GET"
|
|
2825
|
+
}
|
|
2826
|
+
);
|
|
2827
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2828
|
+
const data = body ? JSON.parse(body) : {};
|
|
2829
|
+
return { data, status: res.status, headers: res.headers };
|
|
2830
|
+
};
|
|
2809
2831
|
var getGetFormSubmissionUrl = (id) => {
|
|
2810
2832
|
return `/v1/form-submissions/${id}`;
|
|
2811
2833
|
};
|
|
@@ -7307,6 +7329,29 @@ var createFormSubmissionHandler = async (args, options) => {
|
|
|
7307
7329
|
structuredContent: res.data
|
|
7308
7330
|
};
|
|
7309
7331
|
};
|
|
7332
|
+
var listFormSubmissionsHandler = async (args, options) => {
|
|
7333
|
+
const res = await listFormSubmissions(args.queryParams, options);
|
|
7334
|
+
if (res.status >= 400) {
|
|
7335
|
+
return {
|
|
7336
|
+
content: [
|
|
7337
|
+
{
|
|
7338
|
+
type: "text",
|
|
7339
|
+
text: JSON.stringify(res.data ?? null)
|
|
7340
|
+
}
|
|
7341
|
+
],
|
|
7342
|
+
isError: true
|
|
7343
|
+
};
|
|
7344
|
+
}
|
|
7345
|
+
return {
|
|
7346
|
+
content: [
|
|
7347
|
+
{
|
|
7348
|
+
type: "text",
|
|
7349
|
+
text: JSON.stringify(res.data ?? null)
|
|
7350
|
+
}
|
|
7351
|
+
],
|
|
7352
|
+
structuredContent: res.data
|
|
7353
|
+
};
|
|
7354
|
+
};
|
|
7310
7355
|
var getFormSubmissionHandler = async (args, options) => {
|
|
7311
7356
|
const res = await getFormSubmission(args.pathParams.id, options);
|
|
7312
7357
|
if (res.status >= 400) {
|
|
@@ -12936,6 +12981,39 @@ var CreateFormSubmissionResponse = zod.object({
|
|
|
12936
12981
|
}),
|
|
12937
12982
|
"message": zod.string()
|
|
12938
12983
|
});
|
|
12984
|
+
var listFormSubmissionsQueryCountDefault = 50;
|
|
12985
|
+
var listFormSubmissionsQueryCountMax = 100;
|
|
12986
|
+
var listFormSubmissionsQueryOffsetDefault = 0;
|
|
12987
|
+
var listFormSubmissionsQueryOffsetMin = 0;
|
|
12988
|
+
var listFormSubmissionsQuerySortByDefault = `created_at`;
|
|
12989
|
+
var listFormSubmissionsQuerySortOrderDefault = `desc`;
|
|
12990
|
+
var ListFormSubmissionsQueryParams = zod.object({
|
|
12991
|
+
"form_id": zod.string().uuid().optional(),
|
|
12992
|
+
"environment": zod.enum(["live", "test"]).optional(),
|
|
12993
|
+
"submitted": zod.enum(["true", "false"]).optional().describe("Only submitted (`true`) or only open (`false`) links. Omit for both."),
|
|
12994
|
+
"count": zod.number().min(1).max(listFormSubmissionsQueryCountMax).default(listFormSubmissionsQueryCountDefault),
|
|
12995
|
+
"offset": zod.number().min(listFormSubmissionsQueryOffsetMin).default(listFormSubmissionsQueryOffsetDefault),
|
|
12996
|
+
"sort_by": zod.enum(["created_at"]).default(listFormSubmissionsQuerySortByDefault),
|
|
12997
|
+
"sort_order": zod.enum(["asc", "desc"]).default(listFormSubmissionsQuerySortOrderDefault)
|
|
12998
|
+
});
|
|
12999
|
+
var listFormSubmissionsResponseMetaTotalMin = -9007199254740991;
|
|
13000
|
+
var listFormSubmissionsResponseMetaTotalMax = 9007199254740991;
|
|
13001
|
+
var ListFormSubmissionsResponse = zod.object({
|
|
13002
|
+
"data": zod.array(zod.object({
|
|
13003
|
+
"id": zod.string().describe("Unguessable id that is the link: the renderer opens `/public/v1/form-submissions/{id}`."),
|
|
13004
|
+
"form_id": zod.string().uuid(),
|
|
13005
|
+
"form_version": zod.number(),
|
|
13006
|
+
"environment": zod.enum(["live", "test"]),
|
|
13007
|
+
"prefill": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Values the renderer fills in before the person edits them"),
|
|
13008
|
+
"submission": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Answers keyed by form field; null until submitted"),
|
|
13009
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
13010
|
+
"submitted_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()])
|
|
13011
|
+
})),
|
|
13012
|
+
"message": zod.string(),
|
|
13013
|
+
"meta": zod.object({
|
|
13014
|
+
"total": zod.number().int().min(listFormSubmissionsResponseMetaTotalMin).max(listFormSubmissionsResponseMetaTotalMax)
|
|
13015
|
+
})
|
|
13016
|
+
});
|
|
12939
13017
|
var GetFormSubmissionParams = zod.object({
|
|
12940
13018
|
"id": zod.string().uuid()
|
|
12941
13019
|
});
|
|
@@ -17274,6 +17352,22 @@ var createMcpServer = (options) => {
|
|
|
17274
17352
|
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
17275
17353
|
})
|
|
17276
17354
|
);
|
|
17355
|
+
tools.listFormSubmissions = server2.registerTool(
|
|
17356
|
+
"listFormSubmissions",
|
|
17357
|
+
{
|
|
17358
|
+
title: "List form submissions",
|
|
17359
|
+
description: "List the submission links of the forms shared with the caller, with the answers of those already submitted.",
|
|
17360
|
+
inputSchema: {
|
|
17361
|
+
queryParams: ListFormSubmissionsQueryParams
|
|
17362
|
+
},
|
|
17363
|
+
outputSchema: ListFormSubmissionsResponse,
|
|
17364
|
+
annotations: { readOnlyHint: true }
|
|
17365
|
+
},
|
|
17366
|
+
(args, ctx) => listFormSubmissionsHandler(args, {
|
|
17367
|
+
...options,
|
|
17368
|
+
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
17369
|
+
})
|
|
17370
|
+
);
|
|
17277
17371
|
tools.getFormSubmission = server2.registerTool(
|
|
17278
17372
|
"getFormSubmission",
|
|
17279
17373
|
{
|
|
@@ -18439,4 +18533,4 @@ var transport = new StdioServerTransport();
|
|
|
18439
18533
|
server.connect(transport).then(() => {
|
|
18440
18534
|
console.error("MCP server running on stdio");
|
|
18441
18535
|
}).catch(console.error);
|
|
18442
|
-
//# sourceMappingURL=server-
|
|
18536
|
+
//# sourceMappingURL=server-NRNDVAMW.js.map
|