mcp-quickbase 2.0.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.
Files changed (135) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +21 -0
  3. package/README.md +301 -0
  4. package/dist/client/quickbase.d.ts +28 -0
  5. package/dist/client/quickbase.js +235 -0
  6. package/dist/client/quickbase.js.map +1 -0
  7. package/dist/mcp/index.d.ts +4 -0
  8. package/dist/mcp/index.js +21 -0
  9. package/dist/mcp/index.js.map +1 -0
  10. package/dist/mcp/server.d.ts +19 -0
  11. package/dist/mcp/server.js +102 -0
  12. package/dist/mcp/server.js.map +1 -0
  13. package/dist/mcp-stdio-server.d.ts +2 -0
  14. package/dist/mcp-stdio-server.js +168 -0
  15. package/dist/mcp-stdio-server.js.map +1 -0
  16. package/dist/server.d.ts +2 -0
  17. package/dist/server.js +318 -0
  18. package/dist/server.js.map +1 -0
  19. package/dist/tools/apps/create_app.d.ts +87 -0
  20. package/dist/tools/apps/create_app.js +87 -0
  21. package/dist/tools/apps/create_app.js.map +1 -0
  22. package/dist/tools/apps/index.d.ts +9 -0
  23. package/dist/tools/apps/index.js +40 -0
  24. package/dist/tools/apps/index.js.map +1 -0
  25. package/dist/tools/apps/list_tables.d.ts +108 -0
  26. package/dist/tools/apps/list_tables.js +100 -0
  27. package/dist/tools/apps/list_tables.js.map +1 -0
  28. package/dist/tools/apps/update_app.d.ts +91 -0
  29. package/dist/tools/apps/update_app.js +99 -0
  30. package/dist/tools/apps/update_app.js.map +1 -0
  31. package/dist/tools/base.d.ts +47 -0
  32. package/dist/tools/base.js +63 -0
  33. package/dist/tools/base.js.map +1 -0
  34. package/dist/tools/configure_cache.d.ts +81 -0
  35. package/dist/tools/configure_cache.js +77 -0
  36. package/dist/tools/configure_cache.js.map +1 -0
  37. package/dist/tools/fields/create_field.d.ts +121 -0
  38. package/dist/tools/fields/create_field.js +102 -0
  39. package/dist/tools/fields/create_field.js.map +1 -0
  40. package/dist/tools/fields/index.d.ts +8 -0
  41. package/dist/tools/fields/index.js +37 -0
  42. package/dist/tools/fields/index.js.map +1 -0
  43. package/dist/tools/fields/update_field.d.ts +112 -0
  44. package/dist/tools/fields/update_field.js +114 -0
  45. package/dist/tools/fields/update_field.js.map +1 -0
  46. package/dist/tools/files/download_file.d.ts +111 -0
  47. package/dist/tools/files/download_file.js +173 -0
  48. package/dist/tools/files/download_file.js.map +1 -0
  49. package/dist/tools/files/index.d.ts +8 -0
  50. package/dist/tools/files/index.js +37 -0
  51. package/dist/tools/files/index.js.map +1 -0
  52. package/dist/tools/files/upload_file.d.ts +107 -0
  53. package/dist/tools/files/upload_file.js +211 -0
  54. package/dist/tools/files/upload_file.js.map +1 -0
  55. package/dist/tools/index.d.ts +18 -0
  56. package/dist/tools/index.js +65 -0
  57. package/dist/tools/index.js.map +1 -0
  58. package/dist/tools/records/bulk_create_records.d.ts +75 -0
  59. package/dist/tools/records/bulk_create_records.js +104 -0
  60. package/dist/tools/records/bulk_create_records.js.map +1 -0
  61. package/dist/tools/records/bulk_update_records.d.ts +77 -0
  62. package/dist/tools/records/bulk_update_records.js +102 -0
  63. package/dist/tools/records/bulk_update_records.js.map +1 -0
  64. package/dist/tools/records/create_record.d.ts +68 -0
  65. package/dist/tools/records/create_record.js +123 -0
  66. package/dist/tools/records/create_record.js.map +1 -0
  67. package/dist/tools/records/index.d.ts +11 -0
  68. package/dist/tools/records/index.js +46 -0
  69. package/dist/tools/records/index.js.map +1 -0
  70. package/dist/tools/records/query_records.d.ts +164 -0
  71. package/dist/tools/records/query_records.js +261 -0
  72. package/dist/tools/records/query_records.js.map +1 -0
  73. package/dist/tools/records/update_record.d.ts +81 -0
  74. package/dist/tools/records/update_record.js +99 -0
  75. package/dist/tools/records/update_record.js.map +1 -0
  76. package/dist/tools/registry.d.ts +41 -0
  77. package/dist/tools/registry.js +66 -0
  78. package/dist/tools/registry.js.map +1 -0
  79. package/dist/tools/reports/index.d.ts +6 -0
  80. package/dist/tools/reports/index.js +31 -0
  81. package/dist/tools/reports/index.js.map +1 -0
  82. package/dist/tools/reports/run_report.d.ts +70 -0
  83. package/dist/tools/reports/run_report.js +72 -0
  84. package/dist/tools/reports/run_report.js.map +1 -0
  85. package/dist/tools/tables/create_table.d.ts +142 -0
  86. package/dist/tools/tables/create_table.js +119 -0
  87. package/dist/tools/tables/create_table.js.map +1 -0
  88. package/dist/tools/tables/get_table_fields.d.ts +108 -0
  89. package/dist/tools/tables/get_table_fields.js +96 -0
  90. package/dist/tools/tables/get_table_fields.js.map +1 -0
  91. package/dist/tools/tables/index.d.ts +9 -0
  92. package/dist/tools/tables/index.js +40 -0
  93. package/dist/tools/tables/index.js.map +1 -0
  94. package/dist/tools/tables/update_table.d.ts +91 -0
  95. package/dist/tools/tables/update_table.js +99 -0
  96. package/dist/tools/tables/update_table.js.map +1 -0
  97. package/dist/tools/test_connection.d.ts +51 -0
  98. package/dist/tools/test_connection.js +101 -0
  99. package/dist/tools/test_connection.js.map +1 -0
  100. package/dist/types/api.d.ts +70 -0
  101. package/dist/types/api.js +6 -0
  102. package/dist/types/api.js.map +1 -0
  103. package/dist/types/config.d.ts +49 -0
  104. package/dist/types/config.js +3 -0
  105. package/dist/types/config.js.map +1 -0
  106. package/dist/types/mcp.d.ts +55 -0
  107. package/dist/types/mcp.js +3 -0
  108. package/dist/types/mcp.js.map +1 -0
  109. package/dist/utils/cache.d.ts +87 -0
  110. package/dist/utils/cache.js +211 -0
  111. package/dist/utils/cache.js.map +1 -0
  112. package/dist/utils/file.d.ts +40 -0
  113. package/dist/utils/file.js +167 -0
  114. package/dist/utils/file.js.map +1 -0
  115. package/dist/utils/logger.d.ts +37 -0
  116. package/dist/utils/logger.js +144 -0
  117. package/dist/utils/logger.js.map +1 -0
  118. package/dist/utils/retry.d.ts +39 -0
  119. package/dist/utils/retry.js +88 -0
  120. package/dist/utils/retry.js.map +1 -0
  121. package/dist/utils/validation.d.ts +32 -0
  122. package/dist/utils/validation.js +227 -0
  123. package/dist/utils/validation.js.map +1 -0
  124. package/docs/README.md +41 -0
  125. package/docs/architecture.md +94 -0
  126. package/docs/claude-prompts.md +218 -0
  127. package/docs/deployment.md +244 -0
  128. package/docs/developer-guide.md +537 -0
  129. package/docs/final-qa-report.md +243 -0
  130. package/docs/performance-benchmarks.md +306 -0
  131. package/docs/quick-reference.md +109 -0
  132. package/docs/quickstart.md +183 -0
  133. package/docs/security-review.md +263 -0
  134. package/docs/tools.md +269 -0
  135. package/package.json +68 -0
@@ -0,0 +1,70 @@
1
+ import { BaseTool } from '../base';
2
+ import { QuickbaseClient } from '../../client/quickbase';
3
+ interface RunReportParams {
4
+ report_id: string;
5
+ options?: {
6
+ filters?: Record<string, any>;
7
+ format?: 'JSON' | 'CSV' | 'XML';
8
+ groupBy?: string[];
9
+ sortBy?: string[];
10
+ skip?: number;
11
+ top?: number;
12
+ };
13
+ }
14
+ /**
15
+ * Tool for executing Quickbase reports
16
+ */
17
+ export declare class RunReportTool extends BaseTool<RunReportParams, any> {
18
+ readonly name = "run_report";
19
+ readonly description = "Execute a Quickbase report with optional filters and parameters";
20
+ readonly paramSchema: {
21
+ type: string;
22
+ properties: {
23
+ report_id: {
24
+ type: string;
25
+ description: string;
26
+ };
27
+ options: {
28
+ type: string;
29
+ description: string;
30
+ properties: {
31
+ filters: {
32
+ type: string;
33
+ description: string;
34
+ };
35
+ format: {
36
+ type: string;
37
+ description: string;
38
+ enum: string[];
39
+ };
40
+ groupBy: {
41
+ type: string;
42
+ description: string;
43
+ items: {
44
+ type: string;
45
+ };
46
+ };
47
+ sortBy: {
48
+ type: string;
49
+ description: string;
50
+ items: {
51
+ type: string;
52
+ };
53
+ };
54
+ skip: {
55
+ type: string;
56
+ description: string;
57
+ };
58
+ top: {
59
+ type: string;
60
+ description: string;
61
+ };
62
+ };
63
+ };
64
+ };
65
+ required: string[];
66
+ };
67
+ constructor(client: QuickbaseClient);
68
+ protected run(params: RunReportParams): Promise<any>;
69
+ }
70
+ export {};
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RunReportTool = void 0;
4
+ const base_1 = require("../base");
5
+ const logger_1 = require("../../utils/logger");
6
+ const logger = (0, logger_1.createLogger)('RunReportTool');
7
+ /**
8
+ * Tool for executing Quickbase reports
9
+ */
10
+ class RunReportTool extends base_1.BaseTool {
11
+ constructor(client) {
12
+ super(client);
13
+ this.name = 'run_report';
14
+ this.description = 'Execute a Quickbase report with optional filters and parameters';
15
+ this.paramSchema = {
16
+ type: 'object',
17
+ properties: {
18
+ report_id: {
19
+ type: 'string',
20
+ description: 'The ID of the report to run'
21
+ },
22
+ options: {
23
+ type: 'object',
24
+ description: 'Additional options for the report execution',
25
+ properties: {
26
+ filters: {
27
+ type: 'object',
28
+ description: 'Filter conditions for the report'
29
+ },
30
+ format: {
31
+ type: 'string',
32
+ description: 'Output format for the report',
33
+ enum: ['JSON', 'CSV', 'XML']
34
+ },
35
+ groupBy: {
36
+ type: 'array',
37
+ description: 'Fields to group results by',
38
+ items: { type: 'string' }
39
+ },
40
+ sortBy: {
41
+ type: 'array',
42
+ description: 'Fields to sort results by',
43
+ items: { type: 'string' }
44
+ },
45
+ skip: {
46
+ type: 'number',
47
+ description: 'Number of records to skip'
48
+ },
49
+ top: {
50
+ type: 'number',
51
+ description: 'Number of records to retrieve'
52
+ }
53
+ }
54
+ }
55
+ },
56
+ required: ['report_id']
57
+ };
58
+ }
59
+ async run(params) {
60
+ const { report_id, options = {} } = params;
61
+ logger.info(`Running report: ${report_id}`);
62
+ const response = await this.client.request({
63
+ method: 'POST',
64
+ path: `/reports/${report_id}/run`,
65
+ body: options
66
+ });
67
+ logger.info(`Report executed successfully: ${report_id}`);
68
+ return response;
69
+ }
70
+ }
71
+ exports.RunReportTool = RunReportTool;
72
+ //# sourceMappingURL=run_report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run_report.js","sourceRoot":"","sources":["../../../src/tools/reports/run_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AAC,GAAG,CAAC,MAAuB;QACzC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;QAE3C,MAAM,CAAC,IAAI,CAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACzC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,YAAY,SAAS,MAAM;YACjC,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;QAE1D,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAlED,sCAkEC"}
@@ -0,0 +1,142 @@
1
+ import { BaseTool } from '../base';
2
+ import { QuickbaseClient } from '../../client/quickbase';
3
+ /**
4
+ * Field definition for table creation
5
+ */
6
+ export interface FieldDefinition {
7
+ /**
8
+ * Name of the field
9
+ */
10
+ name: string;
11
+ /**
12
+ * Type of the field (e.g., text, number, date)
13
+ */
14
+ type: string;
15
+ /**
16
+ * Description of the field
17
+ */
18
+ description?: string;
19
+ /**
20
+ * Additional field properties
21
+ */
22
+ properties?: Record<string, any>;
23
+ }
24
+ /**
25
+ * Parameters for create_table tool
26
+ */
27
+ export interface CreateTableParams {
28
+ /**
29
+ * The ID of the application
30
+ */
31
+ app_id: string;
32
+ /**
33
+ * Name of the table
34
+ */
35
+ name: string;
36
+ /**
37
+ * Description of the table
38
+ */
39
+ description?: string;
40
+ /**
41
+ * Initial fields to create with the table
42
+ */
43
+ fields?: FieldDefinition[];
44
+ /**
45
+ * Additional options for table creation
46
+ */
47
+ options?: Record<string, any>;
48
+ }
49
+ /**
50
+ * Response from creating a table
51
+ */
52
+ export interface CreateTableResult {
53
+ /**
54
+ * The ID of the created table
55
+ */
56
+ tableId: string;
57
+ /**
58
+ * The name of the created table
59
+ */
60
+ name: string;
61
+ /**
62
+ * The description of the created table
63
+ */
64
+ description?: string;
65
+ /**
66
+ * Information about created fields
67
+ */
68
+ fields?: Record<string, any>[];
69
+ /**
70
+ * The date the table was created
71
+ */
72
+ created?: string;
73
+ /**
74
+ * Additional details returned from the API
75
+ */
76
+ [key: string]: any;
77
+ }
78
+ /**
79
+ * Tool for creating a new table in a Quickbase application
80
+ */
81
+ export declare class CreateTableTool extends BaseTool<CreateTableParams, CreateTableResult> {
82
+ name: string;
83
+ description: string;
84
+ /**
85
+ * Parameter schema for create_table
86
+ */
87
+ paramSchema: {
88
+ type: string;
89
+ properties: {
90
+ app_id: {
91
+ type: string;
92
+ description: string;
93
+ };
94
+ name: {
95
+ type: string;
96
+ description: string;
97
+ };
98
+ description: {
99
+ type: string;
100
+ description: string;
101
+ };
102
+ fields: {
103
+ type: string;
104
+ description: string;
105
+ items: {
106
+ type: string;
107
+ properties: {
108
+ name: {
109
+ type: string;
110
+ };
111
+ type: {
112
+ type: string;
113
+ };
114
+ description: {
115
+ type: string;
116
+ };
117
+ properties: {
118
+ type: string;
119
+ };
120
+ };
121
+ required: string[];
122
+ };
123
+ };
124
+ options: {
125
+ type: string;
126
+ description: string;
127
+ };
128
+ };
129
+ required: string[];
130
+ };
131
+ /**
132
+ * Constructor
133
+ * @param client Quickbase client
134
+ */
135
+ constructor(client: QuickbaseClient);
136
+ /**
137
+ * Run the create_table tool
138
+ * @param params Tool parameters
139
+ * @returns Created table details
140
+ */
141
+ protected run(params: CreateTableParams): Promise<CreateTableResult>;
142
+ }
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateTableTool = void 0;
4
+ const base_1 = require("../base");
5
+ const logger_1 = require("../../utils/logger");
6
+ const logger = (0, logger_1.createLogger)('CreateTableTool');
7
+ /**
8
+ * Tool for creating a new table in a Quickbase application
9
+ */
10
+ class CreateTableTool extends base_1.BaseTool {
11
+ /**
12
+ * Constructor
13
+ * @param client Quickbase client
14
+ */
15
+ constructor(client) {
16
+ super(client);
17
+ this.name = 'create_table';
18
+ this.description = 'Creates a new table in a Quickbase application';
19
+ /**
20
+ * Parameter schema for create_table
21
+ */
22
+ this.paramSchema = {
23
+ type: 'object',
24
+ properties: {
25
+ app_id: {
26
+ type: 'string',
27
+ description: 'The ID of the application'
28
+ },
29
+ name: {
30
+ type: 'string',
31
+ description: 'Name of the table'
32
+ },
33
+ description: {
34
+ type: 'string',
35
+ description: 'Description of the table'
36
+ },
37
+ fields: {
38
+ type: 'array',
39
+ description: 'List of field definitions',
40
+ items: {
41
+ type: 'object',
42
+ properties: {
43
+ name: { type: 'string' },
44
+ type: { type: 'string' },
45
+ description: { type: 'string' },
46
+ properties: { type: 'object' }
47
+ },
48
+ required: ['name', 'type']
49
+ }
50
+ },
51
+ options: {
52
+ type: 'object',
53
+ description: 'Additional options for table creation'
54
+ }
55
+ },
56
+ required: ['app_id', 'name']
57
+ };
58
+ }
59
+ /**
60
+ * Run the create_table tool
61
+ * @param params Tool parameters
62
+ * @returns Created table details
63
+ */
64
+ async run(params) {
65
+ logger.info('Creating new table in Quickbase application', {
66
+ appId: params.app_id,
67
+ tableName: params.name
68
+ });
69
+ const { app_id, name, description, fields, options } = params;
70
+ // Prepare request body
71
+ const body = {
72
+ name,
73
+ description: description || ''
74
+ };
75
+ // Add fields if provided
76
+ if (fields && fields.length > 0) {
77
+ body.fields = fields.map(field => ({
78
+ fieldType: field.type,
79
+ label: field.name,
80
+ description: field.description || '',
81
+ ...(field.properties || {})
82
+ }));
83
+ }
84
+ // Add any additional options
85
+ if (options) {
86
+ Object.assign(body, options);
87
+ }
88
+ // Create the table
89
+ const response = await this.client.request({
90
+ method: 'POST',
91
+ path: `/tables?appId=${app_id}`,
92
+ body
93
+ });
94
+ if (!response.success || !response.data) {
95
+ logger.error('Failed to create table', {
96
+ error: response.error,
97
+ appId: app_id,
98
+ tableName: name
99
+ });
100
+ throw new Error(response.error?.message || 'Failed to create table');
101
+ }
102
+ const table = response.data;
103
+ logger.info('Successfully created table', {
104
+ tableId: table.id,
105
+ appId: app_id,
106
+ tableName: table.name
107
+ });
108
+ return {
109
+ tableId: table.id,
110
+ name: table.name,
111
+ description: table.description,
112
+ fields: table.fields,
113
+ created: table.created,
114
+ ...table
115
+ };
116
+ }
117
+ }
118
+ exports.CreateTableTool = CreateTableTool;
119
+ //# sourceMappingURL=create_table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create_table.js","sourceRoot":"","sources":["../../../src/tools/tables/create_table.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;AA4F/C;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAA8C;IA4CjF;;;OAGG;IACH,YAAY,MAAuB;QACjC,KAAK,CAAC,MAAM,CAAC,CAAC;QAhDT,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,gDAAgD,CAAC;QAEtE;;WAEG;QACI,gBAAW,GAAG;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mBAAmB;iBACjC;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,0BAA0B;iBACxC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,2BAA2B;oBACxC,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACxB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;y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iBAAiB,MAAM,EAAE;YAC/B,IAAI;SACL,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE;gBACrC,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,KAAK,EAAE,MAAM;gBACb,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;YACH,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,wBAAwB,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,IAA2B,CAAC;QAEnD,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACxC,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,KAAK,CAAC,IAAI;SACtB,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,GAAG,KAAK;SACT,CAAC;IACJ,CAAC;CACF;AAvHD,0CAuHC"}
@@ -0,0 +1,108 @@
1
+ import { BaseTool } from '../base';
2
+ import { QuickbaseClient } from '../../client/quickbase';
3
+ /**
4
+ * Field information returned by get_table_fields
5
+ */
6
+ export interface FieldInfo {
7
+ /**
8
+ * The ID of the field
9
+ */
10
+ id: string;
11
+ /**
12
+ * The label (display name) of the field
13
+ */
14
+ label: string;
15
+ /**
16
+ * The type of the field
17
+ */
18
+ fieldType: string;
19
+ /**
20
+ * The description of the field
21
+ */
22
+ description?: string;
23
+ /**
24
+ * Whether the field is required
25
+ */
26
+ required?: boolean;
27
+ /**
28
+ * Whether the field is unique
29
+ */
30
+ unique?: boolean;
31
+ /**
32
+ * Additional properties of the field
33
+ */
34
+ properties?: Record<string, any>;
35
+ /**
36
+ * Additional details about the field
37
+ */
38
+ [key: string]: any;
39
+ }
40
+ /**
41
+ * Parameters for get_table_fields tool
42
+ */
43
+ export interface GetTableFieldsParams {
44
+ /**
45
+ * The ID of the table
46
+ */
47
+ table_id: string;
48
+ /**
49
+ * Whether to include system fields
50
+ */
51
+ include_system?: boolean;
52
+ /**
53
+ * Filter fields by type
54
+ */
55
+ field_type?: string;
56
+ }
57
+ /**
58
+ * Response from getting table fields
59
+ */
60
+ export interface GetTableFieldsResult {
61
+ /**
62
+ * Array of field information
63
+ */
64
+ fields: FieldInfo[];
65
+ /**
66
+ * The table ID that was queried
67
+ */
68
+ tableId: string;
69
+ }
70
+ /**
71
+ * Tool for retrieving field information for a specific Quickbase table
72
+ */
73
+ export declare class GetTableFieldsTool extends BaseTool<GetTableFieldsParams, GetTableFieldsResult> {
74
+ name: string;
75
+ description: string;
76
+ /**
77
+ * Parameter schema for get_table_fields
78
+ */
79
+ paramSchema: {
80
+ type: string;
81
+ properties: {
82
+ table_id: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ include_system: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ field_type: {
91
+ type: string;
92
+ description: string;
93
+ };
94
+ };
95
+ required: string[];
96
+ };
97
+ /**
98
+ * Constructor
99
+ * @param client Quickbase client
100
+ */
101
+ constructor(client: QuickbaseClient);
102
+ /**
103
+ * Run the get_table_fields tool
104
+ * @param params Tool parameters
105
+ * @returns Table field information
106
+ */
107
+ protected run(params: GetTableFieldsParams): Promise<GetTableFieldsResult>;
108
+ }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetTableFieldsTool = void 0;
4
+ const base_1 = require("../base");
5
+ const logger_1 = require("../../utils/logger");
6
+ const logger = (0, logger_1.createLogger)('GetTableFieldsTool');
7
+ /**
8
+ * Tool for retrieving field information for a specific Quickbase table
9
+ */
10
+ class GetTableFieldsTool extends base_1.BaseTool {
11
+ /**
12
+ * Constructor
13
+ * @param client Quickbase client
14
+ */
15
+ constructor(client) {
16
+ super(client);
17
+ this.name = 'get_table_fields';
18
+ this.description = 'Retrieves field information for a specific Quickbase table';
19
+ /**
20
+ * Parameter schema for get_table_fields
21
+ */
22
+ this.paramSchema = {
23
+ type: 'object',
24
+ properties: {
25
+ table_id: {
26
+ type: 'string',
27
+ description: 'The ID of the Quickbase table'
28
+ },
29
+ include_system: {
30
+ type: 'boolean',
31
+ description: 'Whether to include system fields'
32
+ },
33
+ field_type: {
34
+ type: 'string',
35
+ description: 'Filter fields by type'
36
+ }
37
+ },
38
+ required: ['table_id']
39
+ };
40
+ }
41
+ /**
42
+ * Run the get_table_fields tool
43
+ * @param params Tool parameters
44
+ * @returns Table field information
45
+ */
46
+ async run(params) {
47
+ const { table_id, include_system, field_type } = params;
48
+ logger.info('Getting fields for Quickbase table', {
49
+ tableId: table_id,
50
+ includeSystem: include_system
51
+ });
52
+ // Prepare query parameters
53
+ const queryParams = {};
54
+ if (include_system !== undefined) {
55
+ queryParams.includeSystem = include_system.toString();
56
+ }
57
+ // Get fields in the table
58
+ const response = await this.client.request({
59
+ method: 'GET',
60
+ path: `/fields?tableId=${table_id}`,
61
+ params: queryParams
62
+ });
63
+ if (!response.success || !response.data) {
64
+ logger.error('Failed to get table fields', {
65
+ error: response.error,
66
+ tableId: table_id
67
+ });
68
+ throw new Error(response.error?.message || 'Failed to get table fields');
69
+ }
70
+ // Cast data to array of fields
71
+ let fields = response.data.map(field => ({
72
+ id: field.id,
73
+ label: field.label,
74
+ fieldType: field.fieldType,
75
+ description: field.description,
76
+ required: field.required,
77
+ unique: field.unique,
78
+ properties: field.properties,
79
+ ...field
80
+ }));
81
+ // Filter fields by type if requested
82
+ if (field_type && field_type.trim() !== '') {
83
+ fields = fields.filter(field => field.fieldType.toLowerCase() === field_type.toLowerCase());
84
+ }
85
+ logger.info(`Found ${fields.length} fields in table`, {
86
+ tableId: table_id,
87
+ fieldTypes: [...new Set(fields.map(f => f.fieldType))].join(', ')
88
+ });
89
+ return {
90
+ fields,
91
+ tableId: table_id
92
+ };
93
+ }
94
+ }
95
+ exports.GetTableFieldsTool = GetTableFieldsTool;
96
+ //# sourceMappingURL=get_table_fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_table_fields.js","sourceRoot":"","sources":["../../../src/tools/tables/get_table_fields.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,oBAAoB,CAAC,CAAC;AAkFlD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,eAAoD;IA0B1F;;;OAGG;IACH,YAAY,MAAuB;QACjC,KAAK,CAAC,MAAM,CAAC,CAAC;QA9BT,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GAAG,4DAA4D,CAAC;QAElF;;WAEG;QACI,gBAAW,GAAG;YACnB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,kCAAkC;iBAChD;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB,CAAC;IAQF,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,GAAG,CAAC,MAA4B;QAC9C,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAExD,MAAM,CAAC,IAAI,CAAC,oCAAoC,EAAE;YAChD,OAAO,EAAE,QAAQ;YACjB,aAAa,EAAE,cAAc;SAC9B,CAAC,CAAC;QAEH,2BAA2B;QAC3B,MAAM,WAAW,G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K,UAAU,CAAC,WAAW,EAAE,CAC3D,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,kBAAkB,EAAE;YACpD,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;SAClE,CAAC,CAAC;QAEH,OAAO;YACL,MAAM;YACN,OAAO,EAAE,QAAQ;SAClB,CAAC;IACJ,CAAC;CACF;AAlGD,gDAkGC"}
@@ -0,0 +1,9 @@
1
+ import { QuickbaseClient } from '../../client/quickbase';
2
+ /**
3
+ * Register all table operation tools with the registry
4
+ * @param client Quickbase client
5
+ */
6
+ export declare function registerTableTools(client: QuickbaseClient): void;
7
+ export * from './create_table';
8
+ export * from './update_table';
9
+ export * from './get_table_fields';
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.registerTableTools = registerTableTools;
18
+ const registry_1 = require("../registry");
19
+ const create_table_1 = require("./create_table");
20
+ const update_table_1 = require("./update_table");
21
+ const get_table_fields_1 = require("./get_table_fields");
22
+ const logger_1 = require("../../utils/logger");
23
+ const logger = (0, logger_1.createLogger)('TableTools');
24
+ /**
25
+ * Register all table operation tools with the registry
26
+ * @param client Quickbase client
27
+ */
28
+ function registerTableTools(client) {
29
+ logger.info('Registering table operation tools');
30
+ // Register individual tools
31
+ registry_1.toolRegistry.registerTool(new create_table_1.CreateTableTool(client));
32
+ registry_1.toolRegistry.registerTool(new update_table_1.UpdateTableTool(client));
33
+ registry_1.toolRegistry.registerTool(new get_table_fields_1.GetTableFieldsTool(client));
34
+ logger.info('Table operation tools registered');
35
+ }
36
+ // Export all tools
37
+ __exportStar(require("./create_table"), exports);
38
+ __exportStar(require("./update_table"), exports);
39
+ __exportStar(require("./get_table_fields"), exports);
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/tables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,gDASC;AArBD,0CAA2C;AAC3C,iDAAiD;AACjD,iDAAiD;AACjD,yDAAwD;AACxD,+CAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,YAAY,CAAC,CAAC;AAE1C;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAuB;IACxD,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAEjD,4BAA4B;IAC5B,uBAAY,CAAC,YAAY,CAAC,IAAI,8BAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,uBAAY,CAAC,YAAY,CAAC,IAAI,8BAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,uBAAY,CAAC,YAAY,CAAC,IAAI,qCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1D,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;AAClD,CAAC;AAED,mBAAmB;AACnB,iDAA+B;AAC/B,iDAA+B;AAC/B,qDAAmC"}