qingflow-mcp 0.2.6 → 0.2.7
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/README.md +1 -0
- package/dist/server.js +28 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,7 @@ MCP client config example:
|
|
|
119
119
|
- if summary params are set (`amount_column` / `time_range` / `stat_policy` / `scan_max_pages`), route to summary query.
|
|
120
120
|
- otherwise route to list query.
|
|
121
121
|
2. `query_mode=list|record|summary` forces explicit behavior.
|
|
122
|
+
3. In `list` mode, `time_range` is translated to list filters when `from` or `to` is provided.
|
|
122
123
|
|
|
123
124
|
Summary mode output:
|
|
124
125
|
|
package/dist/server.js
CHANGED
|
@@ -36,7 +36,7 @@ const client = new QingflowClient({
|
|
|
36
36
|
});
|
|
37
37
|
const server = new McpServer({
|
|
38
38
|
name: "qingflow-mcp",
|
|
39
|
-
version: "0.2.
|
|
39
|
+
version: "0.2.7"
|
|
40
40
|
});
|
|
41
41
|
const jsonPrimitiveSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
42
42
|
const answerValueSchema = z.union([
|
|
@@ -747,6 +747,7 @@ function buildListArgsFromQuery(args) {
|
|
|
747
747
|
if (!args.select_columns?.length) {
|
|
748
748
|
throw new Error("select_columns is required for list query");
|
|
749
749
|
}
|
|
750
|
+
const filters = buildListFiltersFromQuery(args);
|
|
750
751
|
return listInputSchema.parse({
|
|
751
752
|
app_key: args.app_key,
|
|
752
753
|
user_id: args.user_id,
|
|
@@ -758,7 +759,7 @@ function buildListArgsFromQuery(args) {
|
|
|
758
759
|
query_logic: args.query_logic,
|
|
759
760
|
apply_ids: args.apply_ids,
|
|
760
761
|
sort: args.sort,
|
|
761
|
-
filters
|
|
762
|
+
filters,
|
|
762
763
|
max_rows: args.max_rows,
|
|
763
764
|
max_items: args.max_items,
|
|
764
765
|
max_columns: args.max_columns,
|
|
@@ -766,6 +767,31 @@ function buildListArgsFromQuery(args) {
|
|
|
766
767
|
include_answers: args.include_answers
|
|
767
768
|
});
|
|
768
769
|
}
|
|
770
|
+
function buildListFiltersFromQuery(args) {
|
|
771
|
+
const filters = [...(args.filters ?? [])];
|
|
772
|
+
const timeRange = args.time_range;
|
|
773
|
+
if (!timeRange) {
|
|
774
|
+
return filters.length > 0 ? filters : undefined;
|
|
775
|
+
}
|
|
776
|
+
if (timeRange.from === undefined && timeRange.to === undefined) {
|
|
777
|
+
return filters.length > 0 ? filters : undefined;
|
|
778
|
+
}
|
|
779
|
+
const timeSelector = normalizeColumnSelector(timeRange.column);
|
|
780
|
+
const alreadyHasTimeFilter = filters.some((item) => {
|
|
781
|
+
if (item.que_id === undefined) {
|
|
782
|
+
return false;
|
|
783
|
+
}
|
|
784
|
+
return normalizeColumnSelector(item.que_id) === timeSelector;
|
|
785
|
+
});
|
|
786
|
+
if (!alreadyHasTimeFilter) {
|
|
787
|
+
filters.push({
|
|
788
|
+
que_id: timeRange.column,
|
|
789
|
+
...(timeRange.from !== undefined ? { min_value: timeRange.from } : {}),
|
|
790
|
+
...(timeRange.to !== undefined ? { max_value: timeRange.to } : {})
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
return filters.length > 0 ? filters : undefined;
|
|
794
|
+
}
|
|
769
795
|
function buildRecordGetArgsFromQuery(args) {
|
|
770
796
|
if (args.apply_id === undefined) {
|
|
771
797
|
throw new Error("apply_id is required for record query");
|