{"slug": "d2b-spreadsheets-for-ai-agents", "title": "D2B – Spreadsheets for AI Agents", "summary": "D2B launched a spreadsheet platform that gives AI agents typed, row-identified, versioned tables and returns results to humans as Excel in the original formatting, with every number traceable to its source. The service exposes an MCP endpoint at https://d2b.dev/mcp/ and Python and CLI clients, storing transforms content-addressed with a queryable DAG, snapshots, named versions, an op log, undo, and diffs between any two versions. Billing is metered in ops (one op = one write-side data operation such as row writes, transform runs, commits or version operations) and GB-months, with reads currently not billed and no LLM charge when calling from your own agent with your own LLM.", "body_md": "Take spreadsheets made for people in at the door, hand your agent typed, row-identified, versioned, governed tables, and return the result to humans as Excel in its original formatting. Not just answers — every number traceable to where it came from.\n\n```\nclaude mcp add d2b --transport http https://d2b.dev/mcp/ \\\n  --header \"Authorization: Bearer $D2B_PAT\"\n\n# Codex / Cursor / VS Code / Claude Desktop → docs.d2b.dev/ja/mcp\n```\n\nLetting an LLM write and run Python in a sandbox gets you an answer, but not how it got there — you can't trace it or run it again. D2B records the same work as transforms with lineage, so a changed input recomputes and every version can be restored.\n\n``` python\nfrom d2b import D2BClient\n\nclient = D2BClient(api_key=\"d2b_pat_...\", base_url=\"https://d2b.dev\")\nwb = client.workbooks.create(title=\"monthly-sales\")[\"id\"]\n\n# 1) a spreadsheet made for people in → typed tables (raw kept, lineage from day one)\nclient.sources.upload(wb, \"sales_2026-06.xlsx\", wait=True)\n\n# 2) logic as a transform — {{ arg }} bindings keep lineage\nclient.transforms.create(\n    wb, name=\"agg/monthly\", kind=\"sql\", artifact_name=\"product_sales\",\n    template='CREATE TABLE \"{{ artifact_name }}\" AS '\n             'SELECT product, sum(amount) AS revenue FROM \"{{ src }}\" GROUP BY 1',\n    args={\"src\": \"sales\"},\n)\n\n# 3) back to humans as Excel, 4) a named, revertible version\nxlsx = client.export.tables(wb, tables=[\"product_sales\"])\nclient.versions.commit(wb, \"2026-06\")\n```\n\nA foundation that survives an agent's mistakes: concurrent writes are caught, any number can be traced and rolled back, permissions hold at the data layer, and results go back to people as Excel.\n\nTransforms are stored content-addressed; the DAG is queryable upstream and down. Snapshots, named versions, an op log and undo — plus a diff between any two versions: unified diffs of the transforms, rows touched, and every artifact the change reaches. An agent can find out why a number moved, fix it, and compare.\n\nEvery table is typed with row ids; writes require expected_version, so concurrent edits are never silently overwritten. A per-table row JSON Schema is available at runtime for constrained decoding.\n\nmask / deny are enforced in the data layer — the same policy applies to SQL, export and MCP, with no side door. Audited.\n\nxlsx / csv, write-back into the original workbook's formatting, live per-row Excel formulas, export = branch → re-import = 3-way merge. Round trips on Excel users' own terms.\n\nPull transforms (SQL / Python), sheets, charts and opted-in base tables as CSV into a repository, review them in a pull request, push them back. Reviewing the SQL an AI wrote before it counts becomes an ordinary workflow.\n\ntransforms/ sheets/ charts/ data/ plus d2b.json (the merge-base hashes).\n\ngit diff / PR. Transforms the chat agent wrote show up in the same place.\n\nOnly what changed: re-run, PUT, 3-way merge. Refused when both sides moved (--force overrides). The git sha becomes a named version.\n\n```\nd2b pull --workbook WB --data customers     # transforms/ sheets/ charts/ data/ + d2b.json\ngit add -A && git commit -m \"pull from D2B\"\nd2b push --dry-run\nd2b push --commit \"$(git rev-parse --short HEAD)\"\nd2b github-workflow > .github/workflows/d2b.yml  # push on merge, scheduled pull → PR\n```\n\nBilling is metered in ops (data operations) and GB-months. Calls from your own agent with your own LLM carry no LLM charge — LLM usage is added only when you use D2B's built-in agent. Capability is identical on every plan.\n\n1 op = one write-side data operation (row writes, transform runs, commits, version operations). Reads are currently not billed.\n\nMint a PAT and run one claude mcp add. Five minutes with the CLI or an SDK.", "url": "https://wpnews.pro/news/d2b-spreadsheets-for-ai-agents", "canonical_source": "https://d2b.dev/developers", "published_at": "2026-10-01 02:08:01+00:00", "updated_at": "2026-10-01 02:18:26.078344+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "ai-products"], "entities": ["D2B", "D2BClient", "Claude", "Codex", "Cursor", "VS Code", "Claude Desktop", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/d2b-spreadsheets-for-ai-agents", "markdown": "https://wpnews.pro/news/d2b-spreadsheets-for-ai-agents.md", "text": "https://wpnews.pro/news/d2b-spreadsheets-for-ai-agents.txt", "jsonld": "https://wpnews.pro/news/d2b-spreadsheets-for-ai-agents.jsonld"}}