@rashidazarang/airtable-mcp 3.1.0 → 3.2.8

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 (106) hide show
  1. package/README.md +209 -334
  2. package/bin/airtable-mcp.js +12 -32
  3. package/dist/typescript/airtable-mcp-server.js +77 -0
  4. package/dist/typescript/airtable-mcp-server.js.map +1 -0
  5. package/dist/typescript/app/airtable-client.js +327 -0
  6. package/dist/typescript/app/airtable-client.js.map +1 -0
  7. package/dist/typescript/app/config.js +151 -0
  8. package/dist/typescript/app/config.js.map +1 -0
  9. package/dist/typescript/app/context.js +3 -0
  10. package/dist/typescript/app/context.js.map +1 -0
  11. package/dist/typescript/app/exceptions.js +85 -0
  12. package/dist/typescript/app/exceptions.js.map +1 -0
  13. package/dist/typescript/app/governance.js +58 -0
  14. package/dist/typescript/app/governance.js.map +1 -0
  15. package/dist/typescript/app/logger.js +47 -0
  16. package/dist/typescript/app/logger.js.map +1 -0
  17. package/dist/typescript/app/rateLimiter.js +37 -0
  18. package/dist/typescript/app/rateLimiter.js.map +1 -0
  19. package/dist/typescript/app/sanitize.js +95 -0
  20. package/dist/typescript/app/sanitize.js.map +1 -0
  21. package/dist/typescript/app/tools/create.js +55 -0
  22. package/dist/typescript/app/tools/create.js.map +1 -0
  23. package/dist/typescript/app/tools/describe.js +190 -0
  24. package/dist/typescript/app/tools/describe.js.map +1 -0
  25. package/dist/typescript/app/tools/handleError.js +205 -0
  26. package/dist/typescript/app/tools/handleError.js.map +1 -0
  27. package/dist/typescript/app/tools/index.js +24 -0
  28. package/dist/typescript/app/tools/index.js.map +1 -0
  29. package/dist/typescript/app/tools/listBases.js +47 -0
  30. package/dist/typescript/app/tools/listBases.js.map +1 -0
  31. package/dist/typescript/app/tools/listExceptions.js +16 -0
  32. package/dist/typescript/app/tools/listExceptions.js.map +1 -0
  33. package/dist/typescript/app/tools/listGovernance.js +15 -0
  34. package/dist/typescript/app/tools/listGovernance.js.map +1 -0
  35. package/dist/typescript/app/tools/query.js +133 -0
  36. package/dist/typescript/app/tools/query.js.map +1 -0
  37. package/dist/typescript/app/tools/response.js +21 -0
  38. package/dist/typescript/app/tools/response.js.map +1 -0
  39. package/dist/typescript/app/tools/update.js +57 -0
  40. package/dist/typescript/app/tools/update.js.map +1 -0
  41. package/dist/typescript/app/tools/upsert.js +66 -0
  42. package/dist/typescript/app/tools/upsert.js.map +1 -0
  43. package/dist/typescript/app/tools/webhooks.js +45 -0
  44. package/dist/typescript/app/tools/webhooks.js.map +1 -0
  45. package/dist/typescript/app/types.js +291 -0
  46. package/dist/typescript/app/types.js.map +1 -0
  47. package/dist/typescript/app/validateApiKey.js +75 -0
  48. package/dist/typescript/app/validateApiKey.js.map +1 -0
  49. package/dist/typescript/errors.js +75 -0
  50. package/dist/typescript/errors.js.map +1 -0
  51. package/dist/typescript/index.js +27 -0
  52. package/dist/typescript/index.js.map +1 -0
  53. package/package.json +49 -31
  54. package/tsconfig.json +10 -4
  55. package/types/typescript/airtable-mcp-server.d.ts +2 -0
  56. package/types/typescript/app/airtable-client.d.ts +50 -0
  57. package/types/typescript/app/config.d.ts +17 -0
  58. package/types/typescript/app/context.d.ts +12 -0
  59. package/types/typescript/app/exceptions.d.ts +12 -0
  60. package/types/typescript/app/governance.d.ts +18 -0
  61. package/types/typescript/app/logger.d.ts +13 -0
  62. package/types/typescript/app/rateLimiter.d.ts +13 -0
  63. package/types/typescript/app/sanitize.d.ts +50 -0
  64. package/types/typescript/app/tools/create.d.ts +3 -0
  65. package/types/typescript/app/tools/describe.d.ts +3 -0
  66. package/types/typescript/app/tools/handleError.d.ts +8 -0
  67. package/types/typescript/app/tools/index.d.ts +3 -0
  68. package/types/typescript/app/tools/listBases.d.ts +13 -0
  69. package/types/typescript/app/tools/listExceptions.d.ts +3 -0
  70. package/types/typescript/app/tools/listGovernance.d.ts +3 -0
  71. package/types/typescript/app/tools/query.d.ts +3 -0
  72. package/types/typescript/app/tools/response.d.ts +20 -0
  73. package/types/typescript/app/tools/update.d.ts +3 -0
  74. package/types/typescript/app/tools/upsert.d.ts +3 -0
  75. package/types/typescript/app/tools/webhooks.d.ts +3 -0
  76. package/types/typescript/app/types.d.ts +318 -0
  77. package/types/typescript/app/validateApiKey.d.ts +25 -0
  78. package/types/typescript/errors.d.ts +57 -0
  79. package/types/typescript/index.d.ts +10 -0
  80. package/types/typescript/prompt-templates.d.ts +5 -0
  81. package/types/typescript/tools-schemas.d.ts +5 -0
  82. package/airtable_simple.js +0 -1561
  83. package/airtable_simple_production.js +0 -1564
  84. package/dist/airtable-mcp-server.js +0 -660
  85. package/dist/airtable-mcp-server.js.map +0 -1
  86. package/dist/test-suite.js +0 -421
  87. package/dist/test-suite.js.map +0 -1
  88. package/examples/airtable-crud-example.js +0 -203
  89. package/examples/building-mcp.md +0 -6666
  90. package/examples/claude_config.json +0 -4
  91. package/examples/claude_simple_config.json +0 -7
  92. package/examples/env-demo.js +0 -172
  93. package/examples/example-tasks-update.json +0 -23
  94. package/examples/example-tasks.json +0 -26
  95. package/examples/example_usage.md +0 -124
  96. package/examples/python_debug_patch.txt +0 -27
  97. package/examples/sample-transform.js +0 -76
  98. package/examples/typescript/advanced-ai-prompts.ts +0 -447
  99. package/examples/typescript/basic-usage.ts +0 -174
  100. package/examples/typescript/claude-desktop-config.json +0 -29
  101. package/examples/windsurf_mcp_config.json +0 -17
  102. package/types/ai-prompts.d.ts +0 -321
  103. package/types/airtable-mcp-server.d.ts +0 -52
  104. package/types/index.d.ts +0 -357
  105. package/types/tools.d.ts +0 -514
  106. /package/types/{test-suite.d.ts → typescript/test-suite.d.ts} +0 -0
@@ -0,0 +1,318 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Shared Zod schemas and TypeScript types for Airtable Brain tools.
4
+ * Keep these aligned with the JSON Schemas under docs/prd/schemas.
5
+ */
6
+ /**
7
+ * Detail level for schema operations to optimize LLM context usage.
8
+ * - tableIdentifiersOnly: Only table IDs and names
9
+ * - identifiersOnly: Table, field, and view IDs and names
10
+ * - full: Complete details including field types, options, descriptions
11
+ */
12
+ export declare const detailLevelSchema: z.ZodEnum<{
13
+ tableIdentifiersOnly: "tableIdentifiersOnly";
14
+ identifiersOnly: "identifiersOnly";
15
+ full: "full";
16
+ }>;
17
+ export type DetailLevel = z.infer<typeof detailLevelSchema>;
18
+ export declare const describeInputSchema: z.ZodObject<{
19
+ scope: z.ZodEnum<{
20
+ base: "base";
21
+ table: "table";
22
+ }>;
23
+ baseId: z.ZodString;
24
+ table: z.ZodOptional<z.ZodString>;
25
+ detailLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
26
+ tableIdentifiersOnly: "tableIdentifiersOnly";
27
+ identifiersOnly: "identifiersOnly";
28
+ full: "full";
29
+ }>>>;
30
+ includeFields: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
31
+ includeViews: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
32
+ }, z.core.$strict>;
33
+ export declare const describeInputShape: {
34
+ scope: z.ZodEnum<{
35
+ base: "base";
36
+ table: "table";
37
+ }>;
38
+ baseId: z.ZodString;
39
+ table: z.ZodOptional<z.ZodString>;
40
+ detailLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
41
+ tableIdentifiersOnly: "tableIdentifiersOnly";
42
+ identifiersOnly: "identifiersOnly";
43
+ full: "full";
44
+ }>>>;
45
+ includeFields: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
46
+ includeViews: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
+ };
48
+ export declare const describeOutputSchema: z.ZodObject<{
49
+ base: z.ZodObject<{
50
+ id: z.ZodString;
51
+ name: z.ZodString;
52
+ }, z.core.$loose>;
53
+ tables: z.ZodOptional<z.ZodArray<z.ZodObject<{
54
+ id: z.ZodString;
55
+ name: z.ZodString;
56
+ description: z.ZodOptional<z.ZodString>;
57
+ primaryFieldId: z.ZodOptional<z.ZodString>;
58
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
+ id: z.ZodString;
60
+ name: z.ZodString;
61
+ type: z.ZodString;
62
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
63
+ }, z.core.$loose>>>;
64
+ views: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
65
+ }, z.core.$loose>>>;
66
+ views: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
67
+ }, z.core.$strict>;
68
+ export declare const queryInputSchema: z.ZodObject<{
69
+ baseId: z.ZodString;
70
+ table: z.ZodString;
71
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ filterByFormula: z.ZodOptional<z.ZodString>;
73
+ view: z.ZodOptional<z.ZodString>;
74
+ sorts: z.ZodOptional<z.ZodArray<z.ZodObject<{
75
+ field: z.ZodString;
76
+ direction: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
77
+ asc: "asc";
78
+ desc: "desc";
79
+ }>>>;
80
+ }, z.core.$strict>>>;
81
+ pageSize: z.ZodOptional<z.ZodNumber>;
82
+ maxRecords: z.ZodOptional<z.ZodNumber>;
83
+ offset: z.ZodOptional<z.ZodString>;
84
+ returnFieldsByFieldId: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
85
+ }, z.core.$strict>;
86
+ export declare const queryInputShape: {
87
+ baseId: z.ZodString;
88
+ table: z.ZodString;
89
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ filterByFormula: z.ZodOptional<z.ZodString>;
91
+ view: z.ZodOptional<z.ZodString>;
92
+ sorts: z.ZodOptional<z.ZodArray<z.ZodObject<{
93
+ field: z.ZodString;
94
+ direction: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
95
+ asc: "asc";
96
+ desc: "desc";
97
+ }>>>;
98
+ }, z.core.$strict>>>;
99
+ pageSize: z.ZodOptional<z.ZodNumber>;
100
+ maxRecords: z.ZodOptional<z.ZodNumber>;
101
+ offset: z.ZodOptional<z.ZodString>;
102
+ returnFieldsByFieldId: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
103
+ };
104
+ export declare const queryOutputSchema: z.ZodObject<{
105
+ records: z.ZodArray<z.ZodObject<{
106
+ id: z.ZodString;
107
+ createdTime: z.ZodOptional<z.ZodString>;
108
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
109
+ }, z.core.$strict>>;
110
+ offset: z.ZodOptional<z.ZodString>;
111
+ summary: z.ZodOptional<z.ZodObject<{
112
+ returned: z.ZodNumber;
113
+ hasMore: z.ZodBoolean;
114
+ }, z.core.$strict>>;
115
+ }, z.core.$strict>;
116
+ export declare const createInputSchema: z.ZodObject<{
117
+ baseId: z.ZodString;
118
+ table: z.ZodString;
119
+ records: z.ZodArray<z.ZodObject<{
120
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
121
+ }, z.core.$strict>>;
122
+ typecast: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
123
+ idempotencyKey: z.ZodOptional<z.ZodString>;
124
+ dryRun: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
125
+ }, z.core.$strict>;
126
+ export declare const createOutputSchema: z.ZodObject<{
127
+ diff: z.ZodObject<{
128
+ added: z.ZodNumber;
129
+ updated: z.ZodNumber;
130
+ unchanged: z.ZodNumber;
131
+ }, z.core.$strict>;
132
+ records: z.ZodOptional<z.ZodArray<z.ZodObject<{
133
+ id: z.ZodString;
134
+ createdTime: z.ZodOptional<z.ZodString>;
135
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
136
+ }, z.core.$strict>>>;
137
+ dryRun: z.ZodBoolean;
138
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
+ }, z.core.$strict>;
140
+ export declare const updateOutputSchema: z.ZodObject<{
141
+ diff: z.ZodObject<{
142
+ added: z.ZodNumber;
143
+ updated: z.ZodNumber;
144
+ unchanged: z.ZodNumber;
145
+ conflicts: z.ZodNumber;
146
+ }, z.core.$strict>;
147
+ records: z.ZodOptional<z.ZodArray<z.ZodObject<{
148
+ id: z.ZodString;
149
+ createdTime: z.ZodOptional<z.ZodString>;
150
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
151
+ }, z.core.$strict>>>;
152
+ dryRun: z.ZodBoolean;
153
+ conflicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
154
+ id: z.ZodString;
155
+ field: z.ZodString;
156
+ before: z.ZodOptional<z.ZodUnknown>;
157
+ after: z.ZodOptional<z.ZodUnknown>;
158
+ current: z.ZodUnknown;
159
+ }, z.core.$strict>>>;
160
+ }, z.core.$strict>;
161
+ export declare const updateInputSchema: z.ZodObject<{
162
+ baseId: z.ZodString;
163
+ table: z.ZodString;
164
+ records: z.ZodArray<z.ZodObject<{
165
+ id: z.ZodString;
166
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
167
+ }, z.core.$strict>>;
168
+ typecast: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
169
+ idempotencyKey: z.ZodOptional<z.ZodString>;
170
+ dryRun: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
171
+ conflictStrategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
172
+ fail_on_conflict: "fail_on_conflict";
173
+ server_merge: "server_merge";
174
+ client_merge: "client_merge";
175
+ }>>>;
176
+ ifUnchangedHash: z.ZodOptional<z.ZodString>;
177
+ }, z.core.$strict>;
178
+ export declare const upsertInputSchema: z.ZodObject<{
179
+ baseId: z.ZodString;
180
+ table: z.ZodString;
181
+ records: z.ZodArray<z.ZodObject<{
182
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
183
+ }, z.core.$strict>>;
184
+ performUpsert: z.ZodObject<{
185
+ fieldsToMergeOn: z.ZodArray<z.ZodString>;
186
+ }, z.core.$strict>;
187
+ typecast: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
188
+ idempotencyKey: z.ZodOptional<z.ZodString>;
189
+ dryRun: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
190
+ conflictStrategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
191
+ fail_on_conflict: "fail_on_conflict";
192
+ server_merge: "server_merge";
193
+ client_merge: "client_merge";
194
+ }>>>;
195
+ }, z.core.$strict>;
196
+ export declare const upsertOutputSchema: z.ZodObject<{
197
+ diff: z.ZodObject<{
198
+ added: z.ZodNumber;
199
+ updated: z.ZodNumber;
200
+ unchanged: z.ZodNumber;
201
+ conflicts: z.ZodNumber;
202
+ }, z.core.$strict>;
203
+ records: z.ZodOptional<z.ZodArray<z.ZodObject<{
204
+ id: z.ZodString;
205
+ createdTime: z.ZodOptional<z.ZodString>;
206
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
207
+ }, z.core.$strict>>>;
208
+ dryRun: z.ZodBoolean;
209
+ conflicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
210
+ id: z.ZodString;
211
+ field: z.ZodString;
212
+ before: z.ZodOptional<z.ZodUnknown>;
213
+ after: z.ZodOptional<z.ZodUnknown>;
214
+ current: z.ZodUnknown;
215
+ }, z.core.$strict>>>;
216
+ }, z.core.$strict>;
217
+ export declare const listExceptionsInputSchema: z.ZodObject<{
218
+ since: z.ZodOptional<z.ZodString>;
219
+ severity: z.ZodOptional<z.ZodEnum<{
220
+ error: "error";
221
+ info: "info";
222
+ warning: "warning";
223
+ }>>;
224
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
225
+ cursor: z.ZodOptional<z.ZodString>;
226
+ }, z.core.$strict>;
227
+ export declare const exceptionItemSchema: z.ZodObject<{
228
+ id: z.ZodString;
229
+ timestamp: z.ZodString;
230
+ severity: z.ZodEnum<{
231
+ error: "error";
232
+ info: "info";
233
+ warning: "warning";
234
+ }>;
235
+ category: z.ZodEnum<{
236
+ rate_limit: "rate_limit";
237
+ validation: "validation";
238
+ auth: "auth";
239
+ conflict: "conflict";
240
+ schema_drift: "schema_drift";
241
+ other: "other";
242
+ }>;
243
+ summary: z.ZodString;
244
+ details: z.ZodOptional<z.ZodString>;
245
+ proposedFix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ }, z.core.$strict>;
247
+ export declare const listExceptionsOutputSchema: z.ZodObject<{
248
+ items: z.ZodArray<z.ZodObject<{
249
+ id: z.ZodString;
250
+ timestamp: z.ZodString;
251
+ severity: z.ZodEnum<{
252
+ error: "error";
253
+ info: "info";
254
+ warning: "warning";
255
+ }>;
256
+ category: z.ZodEnum<{
257
+ rate_limit: "rate_limit";
258
+ validation: "validation";
259
+ auth: "auth";
260
+ conflict: "conflict";
261
+ schema_drift: "schema_drift";
262
+ other: "other";
263
+ }>;
264
+ summary: z.ZodString;
265
+ details: z.ZodOptional<z.ZodString>;
266
+ proposedFix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
267
+ }, z.core.$strict>>;
268
+ cursor: z.ZodOptional<z.ZodString>;
269
+ }, z.core.$strict>;
270
+ export declare const governanceOutputSchema: z.ZodObject<{
271
+ allowedBases: z.ZodArray<z.ZodString>;
272
+ allowedTables: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
273
+ baseId: z.ZodString;
274
+ table: z.ZodString;
275
+ }, z.core.$strict>>>>;
276
+ allowedOperations: z.ZodDefault<z.ZodArray<z.ZodEnum<{
277
+ describe: "describe";
278
+ query: "query";
279
+ create: "create";
280
+ update: "update";
281
+ upsert: "upsert";
282
+ }>>>;
283
+ piiFields: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
284
+ baseId: z.ZodString;
285
+ table: z.ZodString;
286
+ field: z.ZodString;
287
+ policy: z.ZodEnum<{
288
+ mask: "mask";
289
+ hash: "hash";
290
+ drop: "drop";
291
+ }>;
292
+ }, z.core.$strict>>>>;
293
+ redactionPolicy: z.ZodDefault<z.ZodEnum<{
294
+ mask_all_pii: "mask_all_pii";
295
+ mask_on_inline: "mask_on_inline";
296
+ none: "none";
297
+ }>>;
298
+ loggingPolicy: z.ZodDefault<z.ZodEnum<{
299
+ errors_only: "errors_only";
300
+ minimal: "minimal";
301
+ verbose: "verbose";
302
+ }>>;
303
+ retentionDays: z.ZodDefault<z.ZodNumber>;
304
+ }, z.core.$strict>;
305
+ export type DescribeInput = z.infer<typeof describeInputSchema>;
306
+ export type DescribeOutput = z.infer<typeof describeOutputSchema>;
307
+ export type QueryInput = z.infer<typeof queryInputSchema>;
308
+ export type QueryOutput = z.infer<typeof queryOutputSchema>;
309
+ export type CreateInput = z.infer<typeof createInputSchema>;
310
+ export type CreateOutput = z.infer<typeof createOutputSchema>;
311
+ export type UpdateInput = z.infer<typeof updateInputSchema>;
312
+ export type UpdateOutput = z.infer<typeof updateOutputSchema>;
313
+ export type UpsertInput = z.infer<typeof upsertInputSchema>;
314
+ export type UpsertOutput = z.infer<typeof upsertOutputSchema>;
315
+ export type ListExceptionsInput = z.infer<typeof listExceptionsInputSchema>;
316
+ export type ExceptionItem = z.infer<typeof exceptionItemSchema>;
317
+ export type ListExceptionsOutput = z.infer<typeof listExceptionsOutputSchema>;
318
+ export type GovernanceSnapshot = z.infer<typeof governanceOutputSchema>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * API key format validation for Airtable Personal Access Tokens.
3
+ *
4
+ * Provides helpful warnings when token format appears incorrect,
5
+ * without blocking startup (token might still work in edge cases).
6
+ */
7
+ export interface TokenValidationResult {
8
+ isValid: boolean;
9
+ warnings: string[];
10
+ }
11
+ /**
12
+ * Validates Airtable API key format and returns warnings for common issues.
13
+ *
14
+ * @param apiKey - The API key to validate
15
+ * @returns Validation result with warnings array
16
+ */
17
+ export declare function validateApiKey(apiKey: string): TokenValidationResult;
18
+ /**
19
+ * Get token format warnings for inclusion in error messages.
20
+ * Only returns warnings if issues are detected.
21
+ *
22
+ * @param apiKey - The API key to check
23
+ * @returns Array of warning strings, empty if token format looks valid
24
+ */
25
+ export declare function getTokenFormatWarnings(apiKey: string): string[];
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Error taxonomy aligned with Airtable Brain guardrails.
3
+ *
4
+ * All tool errors should use these types so the LLM can reason about
5
+ * retry behaviour and user messaging. Avoid leaking raw Airtable payloads
6
+ * through error messages.
7
+ */
8
+ export type AirtableErrorCode = 'RateLimited' | 'ValidationError' | 'AuthError' | 'ConflictError' | 'NotFound' | 'InternalError' | 'GovernanceError';
9
+ export interface ErrorContext {
10
+ baseId?: string;
11
+ table?: string;
12
+ retryAfterMs?: number;
13
+ attempt?: number;
14
+ totalAttempts?: number;
15
+ upstreamErrorType?: string;
16
+ upstreamErrorMessage?: string;
17
+ upstreamRequestId?: string;
18
+ governanceRule?: string;
19
+ endpoint?: string;
20
+ tokenFormatWarnings?: string[];
21
+ }
22
+ interface AirtableErrorOptions {
23
+ status?: number;
24
+ retryAfterMs?: number;
25
+ context?: ErrorContext;
26
+ cause?: unknown;
27
+ }
28
+ export declare class AirtableBrainError extends Error {
29
+ readonly code: AirtableErrorCode;
30
+ readonly status?: number;
31
+ readonly retryAfterMs?: number;
32
+ readonly context: ErrorContext;
33
+ constructor(code: AirtableErrorCode, message: string, options?: AirtableErrorOptions);
34
+ withContext(context: Partial<ErrorContext>): this;
35
+ }
36
+ export declare class RateLimitError extends AirtableBrainError {
37
+ constructor(message: string, options?: AirtableErrorOptions);
38
+ }
39
+ export declare class AirtableValidationError extends AirtableBrainError {
40
+ constructor(message: string, options?: AirtableErrorOptions);
41
+ }
42
+ export declare class AuthError extends AirtableBrainError {
43
+ constructor(message: string, options?: AirtableErrorOptions);
44
+ }
45
+ export declare class ConflictError extends AirtableBrainError {
46
+ constructor(message: string, options?: AirtableErrorOptions);
47
+ }
48
+ export declare class NotFoundError extends AirtableBrainError {
49
+ constructor(message: string, options?: AirtableErrorOptions);
50
+ }
51
+ export declare class InternalServerError extends AirtableBrainError {
52
+ constructor(message: string, options?: AirtableErrorOptions);
53
+ }
54
+ export declare class GovernanceError extends AirtableBrainError {
55
+ constructor(message: string, options?: AirtableErrorOptions);
56
+ }
57
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Airtable MCP Server - Main Export
3
+ *
4
+ * This module exports the main server functionality for programmatic use.
5
+ * For CLI usage, use the bin/airtable-mcp.js executable.
6
+ */
7
+ export { start } from './airtable-mcp-server';
8
+ export * from './errors';
9
+ export type { AppConfig, AirtableAuthConfig, LogLevel } from './app/config';
10
+ export type { AppContext } from './app/context';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Runtime AI prompt templates for Airtable MCP Server
3
+ */
4
+ import type { PromptSchema } from './index';
5
+ export declare const AI_PROMPT_TEMPLATES: Record<string, PromptSchema>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Runtime tool schemas for Airtable MCP Server
3
+ */
4
+ import type { ToolSchema } from './index';
5
+ export declare const COMPLETE_TOOL_SCHEMAS: ToolSchema[];