terra-mcp-google 0.1.11
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 +57 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +94 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/constants.d.ts +43 -0
- package/dist/config/constants.js +54 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/core/local-file.d.ts +3 -0
- package/dist/core/local-file.js +50 -0
- package/dist/core/local-file.js.map +1 -0
- package/dist/core/result.d.ts +44 -0
- package/dist/core/result.js +104 -0
- package/dist/core/result.js.map +1 -0
- package/dist/core/tool.d.ts +61 -0
- package/dist/core/tool.js +63 -0
- package/dist/core/tool.js.map +1 -0
- package/dist/google/auth.d.ts +47 -0
- package/dist/google/auth.js +256 -0
- package/dist/google/auth.js.map +1 -0
- package/dist/google/client.d.ts +11 -0
- package/dist/google/client.js +14 -0
- package/dist/google/client.js.map +1 -0
- package/dist/google/generated/oauth-client.d.ts +5 -0
- package/dist/google/generated/oauth-client.js +2 -0
- package/dist/google/generated/oauth-client.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/services/auth/tools.d.ts +2 -0
- package/dist/services/auth/tools.js +34 -0
- package/dist/services/auth/tools.js.map +1 -0
- package/dist/services/drive/adapter.d.ts +56 -0
- package/dist/services/drive/adapter.js +168 -0
- package/dist/services/drive/adapter.js.map +1 -0
- package/dist/services/drive/tools.d.ts +65 -0
- package/dist/services/drive/tools.js +324 -0
- package/dist/services/drive/tools.js.map +1 -0
- package/dist/services/registry.d.ts +24 -0
- package/dist/services/registry.js +57 -0
- package/dist/services/registry.js.map +1 -0
- package/dist/services/sheets/adapter.d.ts +112 -0
- package/dist/services/sheets/adapter.js +174 -0
- package/dist/services/sheets/adapter.js.map +1 -0
- package/dist/services/sheets/tools.d.ts +118 -0
- package/dist/services/sheets/tools.js +547 -0
- package/dist/services/sheets/tools.js.map +1 -0
- package/dist/setup/setup.d.ts +31 -0
- package/dist/setup/setup.js +179 -0
- package/dist/setup/setup.js.map +1 -0
- package/package.json +61 -0
- package/scripts/install.sh +16 -0
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SheetsAdapter } from "./adapter.js";
|
|
3
|
+
import { errorResult, formatResponse, responseFormatSchema, toolResult, } from "../../core/result.js";
|
|
4
|
+
import { sheetsTool } from "../../core/tool.js";
|
|
5
|
+
// ── Shared schema fragments & rendering ───────────────────────────────────────
|
|
6
|
+
const cellSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
7
|
+
const valuesSchema = z
|
|
8
|
+
.array(z.array(cellSchema))
|
|
9
|
+
.describe("2D array of rows, each row an array of cell values");
|
|
10
|
+
const valueRenderOption = z
|
|
11
|
+
.enum(["FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA"])
|
|
12
|
+
.default("FORMATTED_VALUE")
|
|
13
|
+
.describe("How values are rendered (default FORMATTED_VALUE)");
|
|
14
|
+
const valueInputOption = z
|
|
15
|
+
.enum(["USER_ENTERED", "RAW"])
|
|
16
|
+
.default("USER_ENTERED")
|
|
17
|
+
.describe("USER_ENTERED parses formulas/dates like the UI; RAW stores as-is");
|
|
18
|
+
function spreadsheetUrl(id) {
|
|
19
|
+
return `https://docs.google.com/spreadsheets/d/${id}/edit`;
|
|
20
|
+
}
|
|
21
|
+
function cell(v) {
|
|
22
|
+
return v === null || v === undefined ? "" : String(v);
|
|
23
|
+
}
|
|
24
|
+
/** Render a 2D value grid as a markdown table (first row treated as header). */
|
|
25
|
+
function valuesToMarkdown(values) {
|
|
26
|
+
if (!values.length)
|
|
27
|
+
return "(empty range)";
|
|
28
|
+
const cols = Math.max(...values.map((r) => r.length));
|
|
29
|
+
const row = (r) => `| ${Array.from({ length: cols }, (_, i) => cell(r[i])).join(" | ")} |`;
|
|
30
|
+
const [head, ...rest] = values;
|
|
31
|
+
const lines = [row(head), `| ${Array.from({ length: cols }, () => "---").join(" | ")} |`];
|
|
32
|
+
for (const r of rest)
|
|
33
|
+
lines.push(row(r));
|
|
34
|
+
return lines.join("\n");
|
|
35
|
+
}
|
|
36
|
+
// A GridRange targets cells by numeric sheetId + 0-based, end-exclusive indices
|
|
37
|
+
// (how batchUpdate addresses cells, unlike the A1 ranges used for values I/O).
|
|
38
|
+
const gridRangeInput = {
|
|
39
|
+
spreadsheet_id: z.string().min(1),
|
|
40
|
+
sheet_id: z.number().int().describe("Numeric sheetId from sheets_get_spreadsheet"),
|
|
41
|
+
start_row: z.number().int().min(0).describe("0-based, inclusive"),
|
|
42
|
+
end_row: z.number().int().min(0).describe("0-based, exclusive"),
|
|
43
|
+
start_column: z.number().int().min(0).describe("0-based, inclusive"),
|
|
44
|
+
end_column: z.number().int().min(0).describe("0-based, exclusive"),
|
|
45
|
+
};
|
|
46
|
+
function toGridRange(args) {
|
|
47
|
+
return {
|
|
48
|
+
sheetId: args.sheet_id,
|
|
49
|
+
startRowIndex: args.start_row,
|
|
50
|
+
endRowIndex: args.end_row,
|
|
51
|
+
startColumnIndex: args.start_column,
|
|
52
|
+
endColumnIndex: args.end_column,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** "#RRGGBB" → a Sheets Color (0–1 channels). */
|
|
56
|
+
function hexToColor(hex) {
|
|
57
|
+
const h = hex.replace(/^#/, "");
|
|
58
|
+
return {
|
|
59
|
+
red: parseInt(h.slice(0, 2), 16) / 255,
|
|
60
|
+
green: parseInt(h.slice(2, 4), 16) / 255,
|
|
61
|
+
blue: parseInt(h.slice(4, 6), 16) / 255,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// ── Tools ─────────────────────────────────────────────────────────────────────
|
|
65
|
+
// Each tool: input schema → exported pure handler (unit-tested directly) →
|
|
66
|
+
// registration. Google API calls live in SheetsAdapter; handlers only translate
|
|
67
|
+
// args and shape the response.
|
|
68
|
+
const createSpreadsheetInput = {
|
|
69
|
+
title: z.string().min(1),
|
|
70
|
+
sheet_titles: z.array(z.string()).optional(),
|
|
71
|
+
};
|
|
72
|
+
export async function sheetsCreateSpreadsheet(sheets, args) {
|
|
73
|
+
const summary = await new SheetsAdapter(sheets).createSpreadsheet({
|
|
74
|
+
title: args.title,
|
|
75
|
+
sheetTitles: args.sheet_titles,
|
|
76
|
+
});
|
|
77
|
+
const id = summary.spreadsheetId;
|
|
78
|
+
return toolResult(`Created spreadsheet "${summary.title}" (${id})\n${spreadsheetUrl(id)}`, {
|
|
79
|
+
spreadsheet_id: id,
|
|
80
|
+
title: summary.title,
|
|
81
|
+
url: spreadsheetUrl(id),
|
|
82
|
+
sheets: summary.sheets,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const createSpreadsheetTool = sheetsTool({
|
|
86
|
+
name: "sheets_create_spreadsheet",
|
|
87
|
+
title: "Create spreadsheet",
|
|
88
|
+
description: `Create a new Google Spreadsheet.
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
- title (string)
|
|
92
|
+
- sheet_titles (string[], optional): initial tab names (default a single "Sheet1")
|
|
93
|
+
|
|
94
|
+
Returns: { spreadsheet_id, title, url, sheets:[{sheetId,title}] }`,
|
|
95
|
+
inputSchema: createSpreadsheetInput,
|
|
96
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
97
|
+
run: sheetsCreateSpreadsheet,
|
|
98
|
+
});
|
|
99
|
+
const getSpreadsheetInput = {
|
|
100
|
+
spreadsheet_id: z.string().min(1),
|
|
101
|
+
response_format: responseFormatSchema,
|
|
102
|
+
};
|
|
103
|
+
export async function sheetsGetSpreadsheet(sheets, args) {
|
|
104
|
+
const summary = await new SheetsAdapter(sheets).getSpreadsheet(args.spreadsheet_id);
|
|
105
|
+
const output = {
|
|
106
|
+
spreadsheet_id: summary.spreadsheetId,
|
|
107
|
+
title: summary.title,
|
|
108
|
+
url: spreadsheetUrl(args.spreadsheet_id),
|
|
109
|
+
sheets: summary.sheets,
|
|
110
|
+
};
|
|
111
|
+
const text = formatResponse(args.response_format, output, () => [
|
|
112
|
+
`# ${summary.title} (${summary.spreadsheetId})`,
|
|
113
|
+
spreadsheetUrl(args.spreadsheet_id),
|
|
114
|
+
"",
|
|
115
|
+
...summary.sheets.map((t) => `- **${t.title}** (sheetId ${t.sheetId}) — ${t.rows}×${t.columns}`),
|
|
116
|
+
].join("\n"));
|
|
117
|
+
return toolResult(text, output);
|
|
118
|
+
}
|
|
119
|
+
const getSpreadsheetTool = sheetsTool({
|
|
120
|
+
name: "sheets_get_spreadsheet",
|
|
121
|
+
title: "Get spreadsheet metadata",
|
|
122
|
+
description: `Get a spreadsheet's tabs and dimensions (no cell values).
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
- spreadsheet_id (string)
|
|
126
|
+
- response_format ('markdown'|'json', default markdown)
|
|
127
|
+
|
|
128
|
+
Returns: { spreadsheet_id, title, url, sheets:[{sheetId,title,index,rows,columns}] }`,
|
|
129
|
+
inputSchema: getSpreadsheetInput,
|
|
130
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
131
|
+
run: sheetsGetSpreadsheet,
|
|
132
|
+
});
|
|
133
|
+
const readRangeInput = {
|
|
134
|
+
spreadsheet_id: z.string().min(1),
|
|
135
|
+
range: z
|
|
136
|
+
.union([z.string().min(1), z.array(z.string().min(1)).min(1)])
|
|
137
|
+
.describe("A single A1 range (e.g. 'Sheet1!A1:D20'), or an array of A1 ranges to batch-read in one call"),
|
|
138
|
+
value_render_option: valueRenderOption,
|
|
139
|
+
response_format: responseFormatSchema,
|
|
140
|
+
};
|
|
141
|
+
export async function sheetsReadRange(sheets, args) {
|
|
142
|
+
const adapter = new SheetsAdapter(sheets);
|
|
143
|
+
// Array → values.batchGet (multi-range shape); single string → values.get (flat shape).
|
|
144
|
+
if (Array.isArray(args.range)) {
|
|
145
|
+
const ranges = await adapter.readRanges({
|
|
146
|
+
spreadsheetId: args.spreadsheet_id,
|
|
147
|
+
ranges: args.range,
|
|
148
|
+
valueRenderOption: args.value_render_option,
|
|
149
|
+
});
|
|
150
|
+
const output = {
|
|
151
|
+
count: ranges.length,
|
|
152
|
+
ranges: ranges.map((r) => ({ range: r.range, row_count: r.values.length, values: r.values })),
|
|
153
|
+
};
|
|
154
|
+
const text = formatResponse(args.response_format, output, () => ranges.map((r) => `# ${r.range}\n\n${valuesToMarkdown(r.values)}`).join("\n\n") || "(no ranges)");
|
|
155
|
+
return toolResult(text, output);
|
|
156
|
+
}
|
|
157
|
+
const { range, values } = await adapter.readRange({
|
|
158
|
+
spreadsheetId: args.spreadsheet_id,
|
|
159
|
+
range: args.range,
|
|
160
|
+
valueRenderOption: args.value_render_option,
|
|
161
|
+
});
|
|
162
|
+
const output = { range, row_count: values.length, values };
|
|
163
|
+
const text = formatResponse(args.response_format, output, () => `# ${range}\n\n${valuesToMarkdown(values)}`);
|
|
164
|
+
return toolResult(text, output);
|
|
165
|
+
}
|
|
166
|
+
const readRangeTool = sheetsTool({
|
|
167
|
+
name: "sheets_read_range",
|
|
168
|
+
title: "Read one or more cell ranges",
|
|
169
|
+
description: `Read cell values from one A1 range, or several at once (batchGet).
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
- spreadsheet_id (string)
|
|
173
|
+
- range (string | string[]): a single A1 range (e.g. 'Sheet1!A1:D20' or 'Sheet1' for the whole tab),
|
|
174
|
+
or an array of A1 ranges to read together in one call
|
|
175
|
+
- value_render_option ('FORMATTED_VALUE'|'UNFORMATTED_VALUE'|'FORMULA', default FORMATTED_VALUE)
|
|
176
|
+
- response_format ('markdown'|'json', default markdown)
|
|
177
|
+
|
|
178
|
+
Returns: a single range → { range, row_count, values: CellValue[][] };
|
|
179
|
+
an array of ranges → { count, ranges: [{ range, row_count, values }] }`,
|
|
180
|
+
inputSchema: readRangeInput,
|
|
181
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
182
|
+
run: sheetsReadRange,
|
|
183
|
+
});
|
|
184
|
+
const writeRangeInput = {
|
|
185
|
+
spreadsheet_id: z.string().min(1),
|
|
186
|
+
range: z.string().min(1).optional().describe("A1 range for a single-range write; the top-left anchor"),
|
|
187
|
+
values: valuesSchema.optional().describe("Rows of cells to write when using 'range'"),
|
|
188
|
+
data: z
|
|
189
|
+
.array(z.object({ range: z.string().min(1), values: valuesSchema }))
|
|
190
|
+
.min(1)
|
|
191
|
+
.optional()
|
|
192
|
+
.describe("For multi-range writes: list of {range, values} pairs; provide instead of range/values"),
|
|
193
|
+
value_input_option: valueInputOption,
|
|
194
|
+
};
|
|
195
|
+
export async function sheetsWriteRange(sheets, args) {
|
|
196
|
+
const adapter = new SheetsAdapter(sheets);
|
|
197
|
+
// 'data' → values.batchUpdate (multi-range shape); 'range'+'values' → values.update (flat shape).
|
|
198
|
+
if (args.data) {
|
|
199
|
+
const result = await adapter.batchWriteRanges({
|
|
200
|
+
spreadsheetId: args.spreadsheet_id,
|
|
201
|
+
data: args.data,
|
|
202
|
+
valueInputOption: args.value_input_option,
|
|
203
|
+
});
|
|
204
|
+
return toolResult(`Updated ${result.totalUpdatedCells ?? 0} cells across ${result.responses.length} range(s).`, {
|
|
205
|
+
total_updated_rows: result.totalUpdatedRows,
|
|
206
|
+
total_updated_columns: result.totalUpdatedColumns,
|
|
207
|
+
total_updated_cells: result.totalUpdatedCells,
|
|
208
|
+
ranges: result.responses.map((r) => ({
|
|
209
|
+
updated_range: r.updatedRange,
|
|
210
|
+
updated_rows: r.updatedRows,
|
|
211
|
+
updated_columns: r.updatedColumns,
|
|
212
|
+
updated_cells: r.updatedCells,
|
|
213
|
+
})),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (!args.range || args.values === undefined) {
|
|
217
|
+
return errorResult("Error: provide either 'range' + 'values' (single write) or 'data' (multi-range write).");
|
|
218
|
+
}
|
|
219
|
+
const result = await adapter.writeRange({
|
|
220
|
+
spreadsheetId: args.spreadsheet_id,
|
|
221
|
+
range: args.range,
|
|
222
|
+
values: args.values,
|
|
223
|
+
valueInputOption: args.value_input_option,
|
|
224
|
+
});
|
|
225
|
+
return toolResult(`Updated ${result.updatedCells ?? 0} cells in ${result.updatedRange ?? args.range}.`, {
|
|
226
|
+
updated_range: result.updatedRange,
|
|
227
|
+
updated_rows: result.updatedRows,
|
|
228
|
+
updated_columns: result.updatedColumns,
|
|
229
|
+
updated_cells: result.updatedCells,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const writeRangeTool = sheetsTool({
|
|
233
|
+
name: "sheets_write_range",
|
|
234
|
+
title: "Write one or more cell ranges",
|
|
235
|
+
description: `Overwrite cell values in one A1 range, or several at once (values.batchUpdate).
|
|
236
|
+
|
|
237
|
+
Cells store literal data, not formatted text. Write one value per cell — do NOT dump a markdown
|
|
238
|
+
table (or CSV/TSV) into a single cell or row. e.g. the markdown table
|
|
239
|
+
"| Name | Age |\\n| --- | --- |\\n| Ann | 30 |" must become rows
|
|
240
|
+
[["Name","Age"],["Ann",30]], and never include separator rows like ["---","---"]. For visual
|
|
241
|
+
styling (bold headers, colors, alignment) use sheets_format_cells, not markdown syntax in cells.
|
|
242
|
+
|
|
243
|
+
Args:
|
|
244
|
+
- spreadsheet_id (string)
|
|
245
|
+
- range (string, optional): A1 range for a single-range write. Prefer a top-left ANCHOR only
|
|
246
|
+
(e.g. 'Sheet1!A1') — the block auto-sizes to 'values', so you can't mismatch. If you give a
|
|
247
|
+
bounded range (e.g. 'Sheet1!A1:N50'), 'values' must fit exactly within it: more rows/cols than
|
|
248
|
+
the range = Google 400 "tried writing to row [N]". When unsure, pass the anchor.
|
|
249
|
+
- values (CellValue[][], optional): rows of cells (string|number|boolean|null) for 'range'
|
|
250
|
+
- data (array, optional): for multi-range writes, [{ range: A1 string, values: CellValue[][] }, ...]
|
|
251
|
+
- value_input_option ('USER_ENTERED'|'RAW', default USER_ENTERED): applied to every range
|
|
252
|
+
|
|
253
|
+
Provide either range+values (single) OR data (multiple).
|
|
254
|
+
Returns: single write → { updated_range, updated_rows, updated_columns, updated_cells };
|
|
255
|
+
multi-range write → { total_updated_rows, total_updated_columns, total_updated_cells,
|
|
256
|
+
ranges:[{updated_range, updated_rows, updated_columns, updated_cells}] }`,
|
|
257
|
+
inputSchema: writeRangeInput,
|
|
258
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
259
|
+
run: sheetsWriteRange,
|
|
260
|
+
});
|
|
261
|
+
const appendRowsInput = {
|
|
262
|
+
spreadsheet_id: z.string().min(1),
|
|
263
|
+
range: z.string().min(1),
|
|
264
|
+
values: valuesSchema,
|
|
265
|
+
value_input_option: valueInputOption,
|
|
266
|
+
insert_data_option: z.enum(["INSERT_ROWS", "OVERWRITE"]).default("INSERT_ROWS"),
|
|
267
|
+
};
|
|
268
|
+
export async function sheetsAppendRows(sheets, args) {
|
|
269
|
+
const result = await new SheetsAdapter(sheets).appendRows({
|
|
270
|
+
spreadsheetId: args.spreadsheet_id,
|
|
271
|
+
range: args.range,
|
|
272
|
+
values: args.values,
|
|
273
|
+
valueInputOption: args.value_input_option,
|
|
274
|
+
insertDataOption: args.insert_data_option,
|
|
275
|
+
});
|
|
276
|
+
return toolResult(`Appended ${result.updatedRows ?? 0} rows (${result.updatedCells ?? 0} cells) to ${result.tableRange ?? args.range}.`, {
|
|
277
|
+
table_range: result.tableRange,
|
|
278
|
+
updated_range: result.updatedRange,
|
|
279
|
+
updated_rows: result.updatedRows,
|
|
280
|
+
updated_cells: result.updatedCells,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
const appendRowsTool = sheetsTool({
|
|
284
|
+
name: "sheets_append_rows",
|
|
285
|
+
title: "Append rows",
|
|
286
|
+
description: `Append rows after the existing table in a range (values.append).
|
|
287
|
+
|
|
288
|
+
Cells store literal data — one value per cell. Don't pack a markdown/CSV table into a single cell;
|
|
289
|
+
split into rows of cells and drop any "| --- |" separator rows.
|
|
290
|
+
|
|
291
|
+
Args:
|
|
292
|
+
- spreadsheet_id (string)
|
|
293
|
+
- range (string): A1 range identifying the table to append to, e.g. 'Sheet1!A1'
|
|
294
|
+
- values (CellValue[][]): rows to append
|
|
295
|
+
- value_input_option ('USER_ENTERED'|'RAW', default USER_ENTERED)
|
|
296
|
+
- insert_data_option ('INSERT_ROWS'|'OVERWRITE', default INSERT_ROWS)
|
|
297
|
+
|
|
298
|
+
Returns: { table_range, updated_range, updated_rows, updated_cells }`,
|
|
299
|
+
inputSchema: appendRowsInput,
|
|
300
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
301
|
+
run: sheetsAppendRows,
|
|
302
|
+
});
|
|
303
|
+
const clearRangeInput = {
|
|
304
|
+
spreadsheet_id: z.string().min(1),
|
|
305
|
+
range: z.string().min(1),
|
|
306
|
+
};
|
|
307
|
+
export async function sheetsClearRange(sheets, args) {
|
|
308
|
+
const clearedRange = await new SheetsAdapter(sheets).clearRange({
|
|
309
|
+
spreadsheetId: args.spreadsheet_id,
|
|
310
|
+
range: args.range,
|
|
311
|
+
});
|
|
312
|
+
return toolResult(`Cleared ${clearedRange ?? args.range}.`, { cleared_range: clearedRange });
|
|
313
|
+
}
|
|
314
|
+
const clearRangeTool = sheetsTool({
|
|
315
|
+
name: "sheets_clear_range",
|
|
316
|
+
title: "Clear a cell range",
|
|
317
|
+
description: `Clear values from an A1 range (keeps formatting).
|
|
318
|
+
|
|
319
|
+
Args:
|
|
320
|
+
- spreadsheet_id (string)
|
|
321
|
+
- range (string): A1 notation
|
|
322
|
+
|
|
323
|
+
Returns: { cleared_range }`,
|
|
324
|
+
inputSchema: clearRangeInput,
|
|
325
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
326
|
+
run: sheetsClearRange,
|
|
327
|
+
});
|
|
328
|
+
const addSheetInput = {
|
|
329
|
+
spreadsheet_id: z.string().min(1),
|
|
330
|
+
title: z.string().min(1),
|
|
331
|
+
rows: z.number().int().min(1).optional(),
|
|
332
|
+
columns: z.number().int().min(1).optional(),
|
|
333
|
+
};
|
|
334
|
+
export async function sheetsAddSheet(sheets, args) {
|
|
335
|
+
const tab = await new SheetsAdapter(sheets).addSheet({
|
|
336
|
+
spreadsheetId: args.spreadsheet_id,
|
|
337
|
+
title: args.title,
|
|
338
|
+
rows: args.rows,
|
|
339
|
+
columns: args.columns,
|
|
340
|
+
});
|
|
341
|
+
return toolResult(`Added sheet "${tab.title}" (sheetId ${tab.sheetId}).`, {
|
|
342
|
+
sheet_id: tab.sheetId,
|
|
343
|
+
title: tab.title,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
const addSheetTool = sheetsTool({
|
|
347
|
+
name: "sheets_add_sheet",
|
|
348
|
+
title: "Add a sheet (tab)",
|
|
349
|
+
description: `Add a new tab to a spreadsheet.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
- spreadsheet_id (string)
|
|
353
|
+
- title (string): new tab name
|
|
354
|
+
- rows (number, optional): row count (default 1000)
|
|
355
|
+
- columns (number, optional): column count (default 26)
|
|
356
|
+
|
|
357
|
+
Returns: { sheet_id, title }`,
|
|
358
|
+
inputSchema: addSheetInput,
|
|
359
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
360
|
+
run: sheetsAddSheet,
|
|
361
|
+
});
|
|
362
|
+
const deleteSheetInput = {
|
|
363
|
+
spreadsheet_id: z.string().min(1),
|
|
364
|
+
sheet_id: z.number().int().describe("Numeric sheetId (not the tab title)"),
|
|
365
|
+
};
|
|
366
|
+
export async function sheetsDeleteSheet(sheets, args) {
|
|
367
|
+
await new SheetsAdapter(sheets).deleteSheet({
|
|
368
|
+
spreadsheetId: args.spreadsheet_id,
|
|
369
|
+
sheetId: args.sheet_id,
|
|
370
|
+
});
|
|
371
|
+
return toolResult(`Deleted sheet ${args.sheet_id}.`, { sheet_id: args.sheet_id });
|
|
372
|
+
}
|
|
373
|
+
const deleteSheetTool = sheetsTool({
|
|
374
|
+
name: "sheets_delete_sheet",
|
|
375
|
+
title: "Delete a sheet (tab)",
|
|
376
|
+
description: `Delete a tab from a spreadsheet by its numeric sheetId (from sheets_get_spreadsheet).
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
- spreadsheet_id (string)
|
|
380
|
+
- sheet_id (number): the numeric sheetId of the tab to delete
|
|
381
|
+
|
|
382
|
+
Returns: { sheet_id }`,
|
|
383
|
+
inputSchema: deleteSheetInput,
|
|
384
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
385
|
+
run: sheetsDeleteSheet,
|
|
386
|
+
});
|
|
387
|
+
const hexColor = z
|
|
388
|
+
.string()
|
|
389
|
+
.regex(/^#?[0-9a-fA-F]{6}$/, "expected hex color like #4285F4");
|
|
390
|
+
const formatCellsInput = {
|
|
391
|
+
...gridRangeInput,
|
|
392
|
+
background_color: hexColor.optional(),
|
|
393
|
+
text_color: hexColor.optional(),
|
|
394
|
+
bold: z.boolean().optional(),
|
|
395
|
+
italic: z.boolean().optional(),
|
|
396
|
+
font_size: z.number().int().min(1).optional(),
|
|
397
|
+
horizontal_alignment: z.enum(["LEFT", "CENTER", "RIGHT"]).optional(),
|
|
398
|
+
};
|
|
399
|
+
export async function sheetsFormatCells(sheets, args) {
|
|
400
|
+
const format = {};
|
|
401
|
+
const text = {};
|
|
402
|
+
const fields = [];
|
|
403
|
+
if (args.background_color !== undefined) {
|
|
404
|
+
format.backgroundColor = hexToColor(args.background_color);
|
|
405
|
+
fields.push("userEnteredFormat.backgroundColor");
|
|
406
|
+
}
|
|
407
|
+
if (args.horizontal_alignment !== undefined) {
|
|
408
|
+
format.horizontalAlignment = args.horizontal_alignment;
|
|
409
|
+
fields.push("userEnteredFormat.horizontalAlignment");
|
|
410
|
+
}
|
|
411
|
+
if (args.bold !== undefined) {
|
|
412
|
+
text.bold = args.bold;
|
|
413
|
+
fields.push("userEnteredFormat.textFormat.bold");
|
|
414
|
+
}
|
|
415
|
+
if (args.italic !== undefined) {
|
|
416
|
+
text.italic = args.italic;
|
|
417
|
+
fields.push("userEnteredFormat.textFormat.italic");
|
|
418
|
+
}
|
|
419
|
+
if (args.font_size !== undefined) {
|
|
420
|
+
text.fontSize = args.font_size;
|
|
421
|
+
fields.push("userEnteredFormat.textFormat.fontSize");
|
|
422
|
+
}
|
|
423
|
+
if (args.text_color !== undefined) {
|
|
424
|
+
text.foregroundColor = hexToColor(args.text_color);
|
|
425
|
+
fields.push("userEnteredFormat.textFormat.foregroundColor");
|
|
426
|
+
}
|
|
427
|
+
if (!fields.length)
|
|
428
|
+
return toolResult("No formatting options given; nothing to change.", { applied: false });
|
|
429
|
+
if (Object.keys(text).length)
|
|
430
|
+
format.textFormat = text;
|
|
431
|
+
await new SheetsAdapter(sheets).repeatCellFormat({
|
|
432
|
+
spreadsheetId: args.spreadsheet_id,
|
|
433
|
+
range: toGridRange(args),
|
|
434
|
+
format,
|
|
435
|
+
fields: fields.join(","),
|
|
436
|
+
});
|
|
437
|
+
return toolResult(`Formatted cells on sheet ${args.sheet_id}.`, { applied: true, fields });
|
|
438
|
+
}
|
|
439
|
+
const formatCellsTool = sheetsTool({
|
|
440
|
+
name: "sheets_format_cells",
|
|
441
|
+
title: "Format a cell range",
|
|
442
|
+
description: `Apply cell formatting to a grid range (repeatCell). Only the options you pass are changed.
|
|
443
|
+
|
|
444
|
+
Args:
|
|
445
|
+
- spreadsheet_id (string)
|
|
446
|
+
- sheet_id (number): numeric sheetId from sheets_get_spreadsheet
|
|
447
|
+
- start_row, end_row, start_column, end_column (number): 0-based; start inclusive, end exclusive
|
|
448
|
+
- background_color, text_color (hex, optional): e.g. '#4285F4'
|
|
449
|
+
- bold, italic (boolean, optional)
|
|
450
|
+
- font_size (number, optional)
|
|
451
|
+
- horizontal_alignment ('LEFT'|'CENTER'|'RIGHT', optional)
|
|
452
|
+
|
|
453
|
+
For formatting beyond these options (borders, merges, number/date formats, conditional formatting),
|
|
454
|
+
use sheets_batch_update.
|
|
455
|
+
Returns: { applied, fields }`,
|
|
456
|
+
inputSchema: formatCellsInput,
|
|
457
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
458
|
+
run: sheetsFormatCells,
|
|
459
|
+
});
|
|
460
|
+
const setDataValidationInput = {
|
|
461
|
+
...gridRangeInput,
|
|
462
|
+
values: z.array(z.string()).min(1).describe("Dropdown options"),
|
|
463
|
+
strict: z.boolean().default(true).describe("Reject values not in the list"),
|
|
464
|
+
show_dropdown: z.boolean().default(true).describe("Show the dropdown UI arrow"),
|
|
465
|
+
};
|
|
466
|
+
export async function sheetsSetDataValidation(sheets, args) {
|
|
467
|
+
await new SheetsAdapter(sheets).setDataValidation({
|
|
468
|
+
spreadsheetId: args.spreadsheet_id,
|
|
469
|
+
range: toGridRange(args),
|
|
470
|
+
rule: {
|
|
471
|
+
condition: { type: "ONE_OF_LIST", values: args.values.map((v) => ({ userEnteredValue: v })) },
|
|
472
|
+
strict: args.strict,
|
|
473
|
+
showCustomUi: args.show_dropdown,
|
|
474
|
+
},
|
|
475
|
+
});
|
|
476
|
+
return toolResult(`Set a ${args.values.length}-option dropdown on sheet ${args.sheet_id}.`, {
|
|
477
|
+
values: args.values,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
const setDataValidationTool = sheetsTool({
|
|
481
|
+
name: "sheets_set_data_validation",
|
|
482
|
+
title: "Set a dropdown on a range",
|
|
483
|
+
description: `Add a dropdown (list) data-validation rule to a grid range (setDataValidation).
|
|
484
|
+
|
|
485
|
+
Args:
|
|
486
|
+
- spreadsheet_id (string)
|
|
487
|
+
- sheet_id (number): numeric sheetId from sheets_get_spreadsheet
|
|
488
|
+
- start_row, end_row, start_column, end_column (number): 0-based; start inclusive, end exclusive
|
|
489
|
+
- values (string[]): dropdown options
|
|
490
|
+
- strict (boolean, default true): reject entries not in the list
|
|
491
|
+
- show_dropdown (boolean, default true): show the dropdown arrow in the UI
|
|
492
|
+
|
|
493
|
+
For other validation rules (number/date/custom-formula conditions), use sheets_batch_update.
|
|
494
|
+
Returns: { values }`,
|
|
495
|
+
inputSchema: setDataValidationInput,
|
|
496
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
497
|
+
run: sheetsSetDataValidation,
|
|
498
|
+
});
|
|
499
|
+
const batchUpdateInput = {
|
|
500
|
+
spreadsheet_id: z.string().min(1),
|
|
501
|
+
requests: z
|
|
502
|
+
.array(z.record(z.string(), z.unknown()))
|
|
503
|
+
.min(1)
|
|
504
|
+
.describe("Raw Sheets API Request objects, each passed straight to batchUpdate"),
|
|
505
|
+
response_format: responseFormatSchema,
|
|
506
|
+
};
|
|
507
|
+
export async function sheetsBatchUpdate(sheets, args) {
|
|
508
|
+
const replies = await new SheetsAdapter(sheets).batchUpdate({
|
|
509
|
+
spreadsheetId: args.spreadsheet_id,
|
|
510
|
+
requests: args.requests,
|
|
511
|
+
});
|
|
512
|
+
const output = { reply_count: replies.length, replies };
|
|
513
|
+
const text = formatResponse(args.response_format, output, () => `Applied ${args.requests.length} request(s); received ${replies.length} repl${replies.length === 1 ? "y" : "ies"}.`);
|
|
514
|
+
return toolResult(text, output);
|
|
515
|
+
}
|
|
516
|
+
const batchUpdateTool = sheetsTool({
|
|
517
|
+
name: "sheets_batch_update",
|
|
518
|
+
title: "Run raw batchUpdate requests",
|
|
519
|
+
description: `Escape hatch: send raw Sheets API requests to spreadsheets.batchUpdate. Use for operations
|
|
520
|
+
without a dedicated tool (mergeCells, updateBorders, sortRange, addConditionalFormatRule, freezing
|
|
521
|
+
rows, etc.). Powerful and potentially destructive — a malformed request returns a Google 400.
|
|
522
|
+
|
|
523
|
+
Args:
|
|
524
|
+
- spreadsheet_id (string)
|
|
525
|
+
- requests (object[]): raw Request objects, e.g. [{ "mergeCells": { "range": {...}, "mergeType": "MERGE_ALL" } }]
|
|
526
|
+
- response_format ('markdown'|'json', default markdown): 'json' to read the raw replies (e.g. a new sheetId)
|
|
527
|
+
|
|
528
|
+
Returns: { reply_count, replies: [...] }`,
|
|
529
|
+
inputSchema: batchUpdateInput,
|
|
530
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
531
|
+
run: sheetsBatchUpdate,
|
|
532
|
+
});
|
|
533
|
+
// ── Registration ────────────────────────────────────────────────────────────
|
|
534
|
+
export const sheetsTools = [
|
|
535
|
+
createSpreadsheetTool,
|
|
536
|
+
getSpreadsheetTool,
|
|
537
|
+
readRangeTool,
|
|
538
|
+
writeRangeTool,
|
|
539
|
+
appendRowsTool,
|
|
540
|
+
clearRangeTool,
|
|
541
|
+
addSheetTool,
|
|
542
|
+
deleteSheetTool,
|
|
543
|
+
formatCellsTool,
|
|
544
|
+
setDataValidationTool,
|
|
545
|
+
batchUpdateTool,
|
|
546
|
+
];
|
|
547
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/services/sheets/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,cAAc,EACd,oBAAoB,EAEpB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,UAAU,EAAyB,MAAM,oBAAoB,CAAC;AAEpF,iFAAiF;AAEjF,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5E,MAAM,YAAY,GAAG,CAAC;KACnB,KAAK,CAAC,CAAC,CAAC,K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,CAAC;AAED,MAAM,eAAe,GAAG,UAAU,CAAC;IACjC,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE;;;;;;;;;yCAS0B;IACvC,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE;IACvG,GAAG,EAAE,iBAAiB;CACvB,CAAC,CAAC;AAEH,+EAA+E;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAgC;IACtD,qBAAqB;IACrB,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,eAAe;IACf,eAAe;IACf,qBAAqB;IACrB,eAAe;CAChB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type ClientName = "codex" | "claude" | "copilot" | "kiro" | "all";
|
|
2
|
+
interface SetupOptions {
|
|
3
|
+
client?: ClientName;
|
|
4
|
+
yes?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface McpSnippetOptions {
|
|
7
|
+
client: ClientName;
|
|
8
|
+
command?: string;
|
|
9
|
+
args?: string[];
|
|
10
|
+
credentialsPath?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* When true, the emitted config disables the dangerous (mutating) tools using
|
|
13
|
+
* each client's own mechanism, leaving only the read-only tools enabled.
|
|
14
|
+
*/
|
|
15
|
+
safeMode?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function mcpConfigSnippet({ client, command, args, credentialsPath, safeMode, }: McpSnippetOptions): string;
|
|
18
|
+
interface ConfigReportOptions {
|
|
19
|
+
client: ClientName;
|
|
20
|
+
/** Disable dangerous (destructive) tools in the emitted config. Default true. */
|
|
21
|
+
safeMode?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The full text printed by the `config` command: the MCP snippet plus, in safe
|
|
25
|
+
* mode, a note listing the read-only tools that stay enabled and the dangerous
|
|
26
|
+
* tools that are disabled.
|
|
27
|
+
*/
|
|
28
|
+
export declare function configReport({ client, safeMode }: ConfigReportOptions): string;
|
|
29
|
+
export type { ClientName, SetupOptions };
|
|
30
|
+
export declare function parseClient(value: string | undefined): ClientName | undefined;
|
|
31
|
+
export declare function runSetup(options?: SetupOptions): Promise<void>;
|