farseer-cli 1.9.0 → 1.9.1
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/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/appTools.js +10 -30
- package/dist/mcp/tools/appTools.js.map +2 -2
- package/dist/mcp/tools/cellTools.js +2 -6
- package/dist/mcp/tools/cellTools.js.map +2 -2
- package/dist/mcp/tools/dashboardTools.js +22 -66
- package/dist/mcp/tools/dashboardTools.js.map +2 -2
- package/dist/mcp/tools/dataTools.js +8 -24
- package/dist/mcp/tools/dataTools.js.map +2 -2
- package/dist/mcp/tools/folderTools.js +4 -12
- package/dist/mcp/tools/folderTools.js.map +2 -2
- package/dist/mcp/tools/modelTools.js +30 -84
- package/dist/mcp/tools/modelTools.js.map +2 -2
- package/dist/mcp/tools/runTools.js +4 -12
- package/dist/mcp/tools/runTools.js.map +2 -2
- package/dist/mcp/tools/sheetTools.js +20 -60
- package/dist/mcp/tools/sheetTools.js.map +2 -2
- package/dist/mcp/tools/syncTools.js +8 -30
- package/dist/mcp/tools/syncTools.js.map +2 -2
- package/dist/mcp/utils/helpers.js +4 -17
- package/dist/mcp/utils/helpers.js.map +2 -2
- package/package.json +1 -1
|
@@ -64,20 +64,14 @@ function normalizeRollupType(value) {
|
|
|
64
64
|
return normalized;
|
|
65
65
|
}
|
|
66
66
|
const evaluateFormulaSchema = {
|
|
67
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
68
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
69
67
|
formula: import_zod.z.string().describe("Formula expression to evaluate (e.g., variable name or calculation)"),
|
|
70
68
|
filters: import_zod.z.array(import_zod.z.array(import_zod.z.string()).length(2)).optional().describe('Dimension filters as [tableName, memberName] pairs (e.g., [["Years","2024"],["Months","Jan"]])')
|
|
71
69
|
};
|
|
72
70
|
const listDimensionMembersSchema = {
|
|
73
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
74
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
75
71
|
tableName: import_zod.z.string().describe("Dimension table name"),
|
|
76
72
|
limit: import_zod.z.number().optional().describe("Maximum number of members to return")
|
|
77
73
|
};
|
|
78
74
|
const manageDimensionMembersSchema = {
|
|
79
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
80
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
81
75
|
action: import_zod.z.enum(["create", "delete"]).describe("Action to perform"),
|
|
82
76
|
tableName: import_zod.z.string().describe("Dimension table name"),
|
|
83
77
|
memberName: import_zod.z.string().describe("Member name to create or delete"),
|
|
@@ -86,8 +80,6 @@ const manageDimensionMembersSchema = {
|
|
|
86
80
|
formula: import_zod.z.string().optional().describe('Formula for compound members (e.g., "$M1+$M2"). Only used with compound=true.')
|
|
87
81
|
};
|
|
88
82
|
const createVariableSchema = {
|
|
89
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
90
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
91
83
|
name: import_zod.z.string().describe("Variable name"),
|
|
92
84
|
dimensions: import_zod.z.array(import_zod.z.string()).optional().describe("Dimension table names this variable spans"),
|
|
93
85
|
formula: import_zod.z.string().optional().describe("Formula expression"),
|
|
@@ -100,8 +92,6 @@ const createVariableSchema = {
|
|
|
100
92
|
folderPath: import_zod.z.array(import_zod.z.string()).optional().describe('Folder path to place the variable in (e.g., ["Variables", "Revenue"]). Uses create + move.')
|
|
101
93
|
};
|
|
102
94
|
const updateVariableSchema = {
|
|
103
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
104
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
105
95
|
name: import_zod.z.string().describe("Variable name to update (used for lookup)"),
|
|
106
96
|
newName: import_zod.z.string().optional().describe("Rename the variable to this name"),
|
|
107
97
|
dimensions: import_zod.z.array(import_zod.z.string()).optional().describe("New dimension table names (replaces all existing dimensions)"),
|
|
@@ -117,38 +107,22 @@ const updateVariableSchema = {
|
|
|
117
107
|
)
|
|
118
108
|
};
|
|
119
109
|
const deleteVariableSchema = {
|
|
120
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
121
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
122
110
|
variableName: import_zod.z.string().describe("Variable name to delete")
|
|
123
111
|
};
|
|
124
112
|
const deleteVariableDataSchema = {
|
|
125
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
126
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
127
113
|
variableName: import_zod.z.string().describe("Variable name whose data to delete")
|
|
128
114
|
};
|
|
129
115
|
const exportModelSchema = {
|
|
130
|
-
tenant: import_zod.z.string().optional().describe('Tenant ID (e.g. "salvus-prodaja"). Uses checked-out tenant if omitted.'),
|
|
131
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
132
116
|
includeMembers: import_zod.z.boolean().optional().describe(
|
|
133
117
|
"Include dimension member rows. Default false because the unscoped fetch can exceed the response size limit on larger tenants and time out. Use farseer_get_table for member samples of a single table instead."
|
|
134
118
|
)
|
|
135
119
|
};
|
|
136
|
-
const listTablesSchema = {
|
|
137
|
-
|
|
138
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping.")
|
|
139
|
-
};
|
|
140
|
-
const listVariablesSchema = {
|
|
141
|
-
tenant: import_zod.z.string().optional().describe('Tenant ID (e.g. "salvus-prodaja"). Uses checked-out tenant if omitted.'),
|
|
142
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping.")
|
|
143
|
-
};
|
|
120
|
+
const listTablesSchema = {};
|
|
121
|
+
const listVariablesSchema = {};
|
|
144
122
|
const getTableSchema = {
|
|
145
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
146
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
147
123
|
tableName: import_zod.z.string().describe("Name of the dimension table")
|
|
148
124
|
};
|
|
149
125
|
const getVariableSchema = {
|
|
150
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
151
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
152
126
|
variableName: import_zod.z.string().describe("Name of the variable")
|
|
153
127
|
};
|
|
154
128
|
function registerModelTools(server) {
|
|
@@ -164,12 +138,10 @@ This is essential for understanding a tenant's data structure before writing imp
|
|
|
164
138
|
|
|
165
139
|
For large models (20KB+), the full result is automatically saved to a temp JSON file
|
|
166
140
|
and only a summary is returned. Use the Read tool to inspect the file if needed.
|
|
167
|
-
For a quick overview without the full export, use farseer_list_tables or farseer_list_variables
|
|
168
|
-
|
|
169
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
141
|
+
For a quick overview without the full export, use farseer_list_tables or farseer_list_variables.`,
|
|
170
142
|
exportModelSchema,
|
|
171
143
|
async (params) => {
|
|
172
|
-
const resolved = (0, import_helpers.
|
|
144
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
173
145
|
if (!resolved) {
|
|
174
146
|
return (0, import_helpers.tenantRequiredResponse)();
|
|
175
147
|
}
|
|
@@ -253,12 +225,10 @@ Dimension tables define the structure of data:
|
|
|
253
225
|
- Months, Years (time dimensions - built-in)
|
|
254
226
|
- Versions (scenario dimension - built-in)
|
|
255
227
|
|
|
256
|
-
Returns table names, member counts, and foreign key relationships
|
|
257
|
-
|
|
258
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
228
|
+
Returns table names, member counts, and foreign key relationships.`,
|
|
259
229
|
listTablesSchema,
|
|
260
|
-
async (
|
|
261
|
-
const resolved = (0, import_helpers.
|
|
230
|
+
async () => {
|
|
231
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
262
232
|
if (!resolved) {
|
|
263
233
|
return (0, import_helpers.tenantRequiredResponse)();
|
|
264
234
|
}
|
|
@@ -293,12 +263,10 @@ Variables store data and calculations - they are the core of the data model.
|
|
|
293
263
|
Each variable has:
|
|
294
264
|
- Dimensions it spans (Product, Region, Month, etc.)
|
|
295
265
|
- Optional formula for calculated values
|
|
296
|
-
- Roll-up type (how values aggregate up hierarchies)
|
|
297
|
-
|
|
298
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
266
|
+
- Roll-up type (how values aggregate up hierarchies)`,
|
|
299
267
|
listVariablesSchema,
|
|
300
|
-
async (
|
|
301
|
-
const resolved = (0, import_helpers.
|
|
268
|
+
async () => {
|
|
269
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
302
270
|
if (!resolved) {
|
|
303
271
|
return (0, import_helpers.tenantRequiredResponse)();
|
|
304
272
|
}
|
|
@@ -355,12 +323,10 @@ Returns:
|
|
|
355
323
|
- Sample members (first 20)
|
|
356
324
|
- Total member count
|
|
357
325
|
|
|
358
|
-
This helps understand the structure needed for import scripts
|
|
359
|
-
|
|
360
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
326
|
+
This helps understand the structure needed for import scripts.`,
|
|
361
327
|
getTableSchema,
|
|
362
328
|
async (params) => {
|
|
363
|
-
const resolved = (0, import_helpers.
|
|
329
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
364
330
|
if (!resolved) {
|
|
365
331
|
return (0, import_helpers.tenantRequiredResponse)();
|
|
366
332
|
}
|
|
@@ -410,12 +376,10 @@ Returns:
|
|
|
410
376
|
- Data type and format
|
|
411
377
|
- Whether it's readonly or calculated on demand
|
|
412
378
|
|
|
413
|
-
This is essential for understanding what dimensions and values are needed for imports
|
|
414
|
-
|
|
415
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
379
|
+
This is essential for understanding what dimensions and values are needed for imports.`,
|
|
416
380
|
getVariableSchema,
|
|
417
381
|
async (params) => {
|
|
418
|
-
const resolved = (0, import_helpers.
|
|
382
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
419
383
|
if (!resolved) {
|
|
420
384
|
return (0, import_helpers.tenantRequiredResponse)();
|
|
421
385
|
}
|
|
@@ -476,13 +440,11 @@ Filters narrow the evaluation to specific dimension members.
|
|
|
476
440
|
|
|
477
441
|
Example: evaluate "Revenue" with filters [["Years","Y2025"],["Months","M1"]]
|
|
478
442
|
|
|
479
|
-
Returns the computed value along with cell metadata (readonly, calculated, frozen)
|
|
480
|
-
|
|
481
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
443
|
+
Returns the computed value along with cell metadata (readonly, calculated, frozen).`,
|
|
482
444
|
evaluateFormulaSchema,
|
|
483
445
|
// @ts-expect-error TS2589 - MCP SDK deep type inference with zod schemas
|
|
484
446
|
async (params) => {
|
|
485
|
-
const resolved = (0, import_helpers.
|
|
447
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
486
448
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
487
449
|
const { organisation, tenant } = resolved;
|
|
488
450
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -523,12 +485,10 @@ Uses initTagMap() to load the model's tag map, then retrieves members for the sp
|
|
|
523
485
|
Returns member IDs, names, and parent relationships.
|
|
524
486
|
|
|
525
487
|
For large tables (500+ members), automatically exports to a CSV file and returns the file path
|
|
526
|
-
instead of inline data, to avoid overwhelming the context window
|
|
527
|
-
|
|
528
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
488
|
+
instead of inline data, to avoid overwhelming the context window.`,
|
|
529
489
|
listDimensionMembersSchema,
|
|
530
490
|
async (params) => {
|
|
531
|
-
const resolved = (0, import_helpers.
|
|
491
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
532
492
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
533
493
|
const { organisation, tenant } = resolved;
|
|
534
494
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -594,12 +554,10 @@ Actions:
|
|
|
594
554
|
(e.g., for AC Period / FC Period filters on variance rows).
|
|
595
555
|
- "delete": Deletes an existing member by name from the specified table.
|
|
596
556
|
|
|
597
|
-
WARNING: Delete is destructive and may affect data. Use with caution
|
|
598
|
-
|
|
599
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
557
|
+
WARNING: Delete is destructive and may affect data. Use with caution.`,
|
|
600
558
|
manageDimensionMembersSchema,
|
|
601
559
|
async (params) => {
|
|
602
|
-
const resolved = (0, import_helpers.
|
|
560
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
603
561
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
604
562
|
const { organisation, tenant } = resolved;
|
|
605
563
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -670,18 +628,14 @@ If no tenant is specified, uses the currently checked-out tenant.`,
|
|
|
670
628
|
`Create a new dimension table in a Farseer tenant.
|
|
671
629
|
|
|
672
630
|
Dimension tables define the structure of data (e.g., Product, Region, Compound Members).
|
|
673
|
-
Creates an empty table that you can then add members to with farseer_manage_dimension_members
|
|
674
|
-
|
|
675
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
631
|
+
Creates an empty table that you can then add members to with farseer_manage_dimension_members.`,
|
|
676
632
|
{
|
|
677
|
-
organisation: import_zod.z.string().optional().describe("Farseer organisation (subdomain). If omitted, uses checked-out org or saved mapping."),
|
|
678
|
-
tenant: import_zod.z.string().optional().describe("Tenant ID. Uses checked-out tenant if omitted."),
|
|
679
633
|
name: import_zod.z.string().describe("Dimension table name"),
|
|
680
634
|
folderPath: import_zod.z.array(import_zod.z.string()).optional().describe('Folder path (e.g., ["Dimensions"]). Uses create + move.')
|
|
681
635
|
},
|
|
682
636
|
// @ts-expect-error TS2589 - MCP SDK deep type inference with zod schemas
|
|
683
637
|
async (params) => {
|
|
684
|
-
const resolved = (0, import_helpers.
|
|
638
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
685
639
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
686
640
|
const { organisation, tenant } = resolved;
|
|
687
641
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -749,13 +703,11 @@ Example:
|
|
|
749
703
|
"formula": "Revenue * 1.1",
|
|
750
704
|
"rollupType": "Sum",
|
|
751
705
|
"dataType": "Decimal"
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
706
|
+
}`,
|
|
755
707
|
createVariableSchema,
|
|
756
708
|
// @ts-expect-error TS2589 - MCP SDK deep type inference with zod schemas
|
|
757
709
|
async (params) => {
|
|
758
|
-
const resolved = (0, import_helpers.
|
|
710
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
759
711
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
760
712
|
const { organisation, tenant } = resolved;
|
|
761
713
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -846,13 +798,11 @@ Updatable fields:
|
|
|
846
798
|
- description: Change the variable description
|
|
847
799
|
- readonly: Set or clear read-only status
|
|
848
800
|
- polarity: Set number polarity (POSITIVE or NEGATIVE)
|
|
849
|
-
- numberFormat: Full number format config (type, decimals, polarity, unit, currency, etc.)
|
|
850
|
-
|
|
851
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
801
|
+
- numberFormat: Full number format config (type, decimals, polarity, unit, currency, etc.)`,
|
|
852
802
|
updateVariableSchema,
|
|
853
803
|
// @ts-expect-error TS2589 - MCP SDK deep type inference with zod schemas
|
|
854
804
|
async (params) => {
|
|
855
|
-
const resolved = (0, import_helpers.
|
|
805
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
856
806
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
857
807
|
const { organisation, tenant } = resolved;
|
|
858
808
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -938,12 +888,10 @@ If no tenant is specified, uses the currently checked-out tenant.`,
|
|
|
938
888
|
WARNING: This is destructive and cannot be undone. It removes all cell values
|
|
939
889
|
for the specified variable across all dimensions and time periods.
|
|
940
890
|
|
|
941
|
-
Use this to clear old template data or reset a variable before re-importing
|
|
942
|
-
|
|
943
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
891
|
+
Use this to clear old template data or reset a variable before re-importing.`,
|
|
944
892
|
deleteVariableDataSchema,
|
|
945
893
|
async (params) => {
|
|
946
|
-
const resolved = (0, import_helpers.
|
|
894
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
947
895
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
948
896
|
const { organisation, tenant } = resolved;
|
|
949
897
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|
|
@@ -973,12 +921,10 @@ If no tenant is specified, uses the currently checked-out tenant.`,
|
|
|
973
921
|
|
|
974
922
|
Resolves the variable by name and permanently deletes it along with all its data.
|
|
975
923
|
|
|
976
|
-
WARNING: This is destructive and cannot be undone
|
|
977
|
-
|
|
978
|
-
If no tenant is specified, uses the currently checked-out tenant.`,
|
|
924
|
+
WARNING: This is destructive and cannot be undone.`,
|
|
979
925
|
deleteVariableSchema,
|
|
980
926
|
async (params) => {
|
|
981
|
-
const resolved = (0, import_helpers.
|
|
927
|
+
const resolved = (0, import_helpers.getSessionTenant)();
|
|
982
928
|
if (!resolved) return (0, import_helpers.tenantRequiredResponse)();
|
|
983
929
|
const { organisation, tenant } = resolved;
|
|
984
930
|
const nativeClient = await (0, import_farseerFactory.getNativeFarseerClient)(organisation, tenant);
|