{"_id":"@ai-path/lattica-mcp","_rev":"2-34afa27a04904d5b859392cd3988e0fb","name":"@ai-path/lattica-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ai-path/lattica-mcp","version":"0.1.0","license":"MIT","_id":"@ai-path/lattica-mcp@0.1.0","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"dist":{"shasum":"14f46aec370fdc83b7738c77f623903a06ca5dc3","tarball":"https://registry.npmjs.org/@ai-path/lattica-mcp/-/lattica-mcp-0.1.0.tgz","fileCount":9,"integrity":"sha512-08N2xPYMzmiMJdtatiBRBxPGg1ZI/PtkTc0NIQmdvSwfOrgVBxCnmXv9c+r+y069YgHNUDFKh2BwBJv1Mv96Mg==","signatures":[{"sig":"MEQCIDdFX21Q74lwGyOSc+I0iQYq7dhFX8ZjLbR/0DkAPNXcAiBqrI60Lp/MtC8ZMmKHck9tf+wzD5vJvEAOYE2CHGtYpA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56505},"main":"./dist/index.cjs","type":"module","_from":"file:ai-path-lattica-mcp-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"fsakurai","email":"f-sakurai@ai-path.jp"},"_resolved":"/private/var/folders/tf/0c43660d4k1dg4ssxq0n63ww0000gn/T/ba99d41699f3d28e1c5964b977319891/ai-path-lattica-mcp-0.1.0.tgz","_integrity":"sha512-08N2xPYMzmiMJdtatiBRBxPGg1ZI/PtkTc0NIQmdvSwfOrgVBxCnmXv9c+r+y069YgHNUDFKh2BwBJv1Mv96Mg==","_npmVersion":"10.9.3","description":"Expose a Lattica grid to AI agents: a transport-agnostic tool registry (get_cell/set_cell/get_range/evaluate/define_name) with handler-validated inputs and a result-enveloped dispatcher.","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"@ai-path/lattica-formula":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/lattica-mcp_0.1.0_1783177112346_0.39705011662298295","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @ai-path/tb-mcp (product: Taible). Install @ai-path/tb-mcp instead."}},"time":{"created":"2026-07-04T14:58:32.219Z","modified":"2026-07-04T16:08:51.518Z","0.1.0":"2026-07-04T14:58:32.468Z"},"license":"MIT","description":"Expose a Lattica grid to AI agents: a transport-agnostic tool registry (get_cell/set_cell/get_range/evaluate/define_name) with handler-validated inputs and a result-enveloped dispatcher.","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"readme":"# @ai-path/lattica-mcp\n\nExposes a Lattica grid to AI agents as a transport-agnostic tool registry. Each\n`GridTool` bundles a stable name, a description, a JSON-schema input definition,\nand a synchronous handler over a `@ai-path/lattica-formula` `SheetEngine` — the handlers\nknow nothing about MCP wire framing or networking. The `ToolDispatcher` wraps a\ntool list with name lookup and a uniform `{ ok, output | error }` result, so a\nthin MCP server (or any agent loop) can marshal calls without bespoke glue.\n\n## Install\n\n```sh\npnpm add @ai-path/lattica-mcp\n```\n\n## API overview\n\n### createGridTools + ToolDispatcher\n\n`createGridTools(engine)` returns the standard tool set bound to one engine:\n`get_cell`, `set_cell`, `get_range`, `evaluate`, and `define_name`. Feed it to a\n`ToolDispatcher` to list and call tools safely.\n\n```ts\nimport { SheetEngine } from '@ai-path/lattica-formula';\nimport { createGridTools, ToolDispatcher } from '@ai-path/lattica-mcp';\n\nconst engine = new SheetEngine();\nconst dispatcher = new ToolDispatcher(createGridTools(engine));\n\ndispatcher.list();                 // [{ name, description, inputSchema }, …]\ndispatcher.has('set_cell');        // true\n```\n\n### Calling tools\n\n`call` never throws: a bad input or unknown tool comes back as\n`{ ok: false, error }`, success as `{ ok: true, output }`.\n\n```ts\ndispatcher.call('set_cell', { row: 0, col: 0, content: 42 });\ndispatcher.call('set_cell', { row: 1, col: 0, content: '=A1*2' });\n\nconst read = dispatcher.call('get_cell', { row: 1, col: 0 });\n// { ok: true, output: { value: '84' } }\n\ndispatcher.call('evaluate', { formula: 'SUM(A1:A2)' });\ndispatcher.call('get_range', { startRow: 0, startCol: 0, endRow: 1, endCol: 0 });\n\nconst bad = dispatcher.call('get_cell', {});\n// { ok: false, error: '\"row\" must be a non-negative integer' }\n```\n\n### Constants & types\n\n- `MAX_RANGE_CELLS` — upper bound a single `get_range` may materialize.\n- `formatValue` — formats any cell value (numbers, booleans, `null`, `FormulaError`) to its display string.\n- `GridTool`, `ToolCallResult` — the tool and result shapes.\n","readmeFilename":"README.md"}