@grid-is/agent-tools 0.1.0
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 +73 -0
- package/dist/index.d.ts +1576 -0
- package/dist/index.js +2 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +6 -0
- package/dist/src-Dzffbe0i.js +18827 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @grid-is/agent-tools
|
|
2
|
+
|
|
3
|
+
GRID's spreadsheet tools for AI agents: load, read, edit, and recalculate
|
|
4
|
+
`.xlsx` workbooks headlessly. Use the tools directly from your own agent SDK, or
|
|
5
|
+
run them as an MCP server over stdio.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @grid-is/agent-tools
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The engine installs automatically as a dependency — nothing else to add, and no
|
|
14
|
+
GRID registry token required. See [The engine](#the-engine) to run on a licensed
|
|
15
|
+
Apiary build instead.
|
|
16
|
+
|
|
17
|
+
## Getting started
|
|
18
|
+
|
|
19
|
+
`createGridTools()` returns the full set of tools, each
|
|
20
|
+
`{ name, description, inputSchema, run }`. Wire them into your own agent SDK:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { createGridTools } from "@grid-is/agent-tools";
|
|
24
|
+
|
|
25
|
+
const tools = createGridTools();
|
|
26
|
+
const load = tools.find((t) => t.name === "loadWorkbook");
|
|
27
|
+
await load.run({ path: "budget.xlsx" });
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`inputSchema` is a zod raw shape; `z.toJSONSchema(z.object(tool.inputSchema))`
|
|
31
|
+
produces the JSON Schema most SDKs expect.
|
|
32
|
+
|
|
33
|
+
Or run the tools as an MCP server over stdio, for any MCP-capable runtime:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import { serveStdio, createGridTools } from "@grid-is/agent-tools";
|
|
37
|
+
|
|
38
|
+
await serveStdio({ tools: createGridTools() });
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Tools
|
|
42
|
+
|
|
43
|
+
| Group | Tools |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| Lifecycle | `loadWorkbook` `saveWorkbook` `listWorkbooks` `selectWorkbook` |
|
|
46
|
+
| Understand | `describeStructure` `generateWorkbookContext` `symbols` `viewRange` `captureRange` `inspect` `findCells` |
|
|
47
|
+
| Audit | `precedents` `dependents` `listErrors` `getStyles` `getComments` `getComment` |
|
|
48
|
+
| Edit | `editCells` `fillCells` `editCellStyles` `manageSheets` `manageRowsAndColumns` |
|
|
49
|
+
| Model | `readCalculatedValues` `runFormula` `goalSeek` `whatIf` |
|
|
50
|
+
| Escape hatch | `executeOfficeJs` *(optional — needs `@grid-is/apiary-officejs`)* |
|
|
51
|
+
|
|
52
|
+
Each tool operates on the active workbook (the last one loaded or selected). The
|
|
53
|
+
per-tool reference lives in [`docs/`](docs/) (`cd docs && npm ci && npm run dev`).
|
|
54
|
+
|
|
55
|
+
## The engine
|
|
56
|
+
|
|
57
|
+
The tools run on the engine installed under the `@grid-is/apiary` name — by
|
|
58
|
+
default the free [`@grid-is/spreadsheet-engine`](https://www.npmjs.com/package/@grid-is/spreadsheet-engine).
|
|
59
|
+
To run on a licensed Apiary build, override the name:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
"overrides": { "@grid-is/apiary": "17.0.0-beta.1" }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Development
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm install
|
|
69
|
+
npm run build # tsdown → dist/
|
|
70
|
+
npm test # smoke test against test/fixtures/sample.xlsx
|
|
71
|
+
npm run typecheck
|
|
72
|
+
npm run gen:docs # regenerate the per-tool reference under docs/src/content/docs/tools/
|
|
73
|
+
```
|