@levitating/tensor-mcp 1.0.0 → 4.4.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 +281 -23
- package/dist/index.js +1222 -53
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,15 +1,154 @@
|
|
|
1
1
|
# Tensor MCP
|
|
2
2
|
|
|
3
|
-
Model Context Protocol server that exposes the
|
|
3
|
+
Model Context Protocol server that exposes the Tensor API as tools for AI assistants. Same Clerk API key, same scopes, same deny-by-default rules as the REST API — an MCP client can never reach anything the REST API would not hand the same key.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Tensor is a private family office workbench: a ledger of entities, accounts, assets, positions and transactions, plus the work around it — todos, an idea capture inbox, encrypted files. **Since 2.1.0 the work surfaces are part of this API too**, each under its own scopes: what you get is the ledger, the reference catalogs, the dry-run/apply pipeline, price/quote lookups, files (upload, browse, folders, download URLs, export manifest), todos, and ideas. The boundary that remains is deliberate — **no unrecoverable destruction, and no self-widening**: every Trash purge (todos, ideas, files), comment deletion, decryption-device enrollment, the file access logs, links/tags, site-wide search, FX and loan terms all stay session-only, and Tensor's smoke tests assert those denials in the negative. The reasoning lives in `docs/contract/MCP.md` in the Tensor repo.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Published as [`@levitating/tensor-mcp`](https://www.npmjs.com/package/@levitating/tensor-mcp). The full inventory is the tables below; nothing here needs a clone of the Tensor repo.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
See the full docs at [tensor.levitating.org/docs/mcp](https://tensor.levitating.org/docs/mcp). The contract behind these tools — scope mapping, access boundaries, and the version policy — is `docs/contract/MCP.md` in the Tensor repo.
|
|
10
|
+
|
|
11
|
+
## 2.0.0 — breaking change
|
|
12
|
+
|
|
13
|
+
Tensor's **Documents** feature was renamed to **Files** (2026-08), all the way down: tables, routes, scope and tool names. For an MCP client that means:
|
|
14
|
+
|
|
15
|
+
| What | Was | Now |
|
|
16
|
+
| ---- | --- | --- |
|
|
17
|
+
| Tool name | `list_documents` | `list_files` |
|
|
18
|
+
| Scope on the key | `tensor:documents:read` | `tensor:files:read` |
|
|
19
|
+
| Endpoint behind it | `GET /api/documents/manifest` | `GET /api/files/manifest` |
|
|
20
|
+
|
|
21
|
+
There is no alias and no deprecation window — the old names are gone. **Existing API keys carrying `tensor:documents:read` must be re-issued with `tensor:files:read`**, and any prompt, script or saved workflow that calls `list_documents` by name has to be updated. Everything else in the tool set is unchanged.
|
|
22
|
+
|
|
23
|
+
## 4.4.0 — `browse_files` can say what order it wants
|
|
24
|
+
|
|
25
|
+
Additive, one optional input. `browse_files` takes **`sort`**, one of
|
|
26
|
+
`modified_desc` / `modified_asc` / `added_desc` / `added_asc` / `name_asc` /
|
|
27
|
+
`name_desc` / `size_desc` / `size_asc`. The default is `added_desc` — newest
|
|
28
|
+
first, exactly what every previous release returned. Nothing is renamed, nothing
|
|
29
|
+
is removed, no scope changes, and a call that omits it behaves as before.
|
|
30
|
+
|
|
31
|
+
It closes the last gap where Tensor's Files page could do something an agent
|
|
32
|
+
could not. The four columns are the page's own — `modified` is `updated_at`,
|
|
33
|
+
`added` is `created_at`, `name` is the display title and `size` is the
|
|
34
|
+
**plaintext** length, so an encrypted file sorts by what it is rather than by
|
|
35
|
+
its envelope's overhead. One name carries both the column and the direction
|
|
36
|
+
because the server looks the value up in a closed map of `ORDER BY` fragments;
|
|
37
|
+
a direction sent separately would only be composed back into that key.
|
|
38
|
+
|
|
39
|
+
**It is a server-side order, and that is the point.** The listing is capped
|
|
40
|
+
(default 500), so re-sorting a page in the client orders the window rather than
|
|
41
|
+
the library — "the ten biggest files" computed that way is the ten biggest of
|
|
42
|
+
the five hundred most recent. Every order also ends in the file id, so paging
|
|
43
|
+
with `limit`/`offset` cannot show one row twice and skip another.
|
|
44
|
+
|
|
45
|
+
Two things worth knowing before you trust an ordering: names sort by the
|
|
46
|
+
database's collation rather than a natural sort, so `Q10` comes before `Q9`; and
|
|
47
|
+
an unrecognised value is ignored rather than refused — ordering is not a filter,
|
|
48
|
+
so a bad one costs the default order and never an error.
|
|
49
|
+
|
|
50
|
+
## 4.3.0 — `list_ideas` can say what order it wants
|
|
51
|
+
|
|
52
|
+
Additive, one optional input. `list_ideas` takes **`sort`**: `newest` (the
|
|
53
|
+
default, and what every previous release did), `oldest`, `updated` (recently
|
|
54
|
+
edited first) or `title` (A-Z). Nothing is renamed, nothing is removed, no scope
|
|
55
|
+
changes, and a call that omits it behaves exactly as before.
|
|
56
|
+
|
|
57
|
+
It closes a gap rather than adding a capability: Tensor's own Ideas stream has
|
|
58
|
+
offered these four orders for as long as the arrangement work has been in, and
|
|
59
|
+
`GET /api/ideas?sort=` has parsed them the whole time — the tool simply had no
|
|
60
|
+
way to ask, so anything an agent wanted in a different order had to be paged out
|
|
61
|
+
in full and re-sorted locally, which for a capped listing quietly answers the
|
|
62
|
+
wrong question. `list_todos` has had its own `sort` since it shipped; this is
|
|
63
|
+
that shape one noun over.
|
|
64
|
+
|
|
65
|
+
**There is deliberately no `manual`.** A todo carries a fractional rank key and
|
|
66
|
+
can be hand-placed; an idea has no such column, and an inbox is not something
|
|
67
|
+
anyone arranges by hand. An unrecognised value is ignored rather than refused —
|
|
68
|
+
ordering is not a filter, so a bad one costs you the default order and never an
|
|
69
|
+
error.
|
|
70
|
+
|
|
71
|
+
## 4.2.0 — an idea's body is a document
|
|
72
|
+
|
|
73
|
+
Additive, and the wire did not change shape. An idea's body used to be a plain
|
|
74
|
+
`TEXT` column; it is a TipTap document now, the same as a memo's body and the
|
|
75
|
+
same as an idea's own comments, so an idea can hold an **inline image**.
|
|
76
|
+
|
|
77
|
+
`body` still goes in as plain text and still comes back as plain text — Tensor
|
|
78
|
+
wraps what you send into a document (one paragraph per line) and derives `body`
|
|
79
|
+
back out of it for search and previews. Reads gain `bodyJson`, the document
|
|
80
|
+
itself; it is `null` on a capture written before this release that has not been
|
|
81
|
+
edited since, which means "`body` is the whole of it". Nothing is renamed,
|
|
82
|
+
nothing is removed and no scope changes, so no installed client and no issued
|
|
83
|
+
key is affected.
|
|
84
|
+
|
|
85
|
+
**An agent cannot put an image INSIDE the prose, and that is deliberate.** These
|
|
86
|
+
tools take `body` as text and there is no `bodyJson` input: publishing the
|
|
87
|
+
editor's node shape as a tool input would freeze an internal name into a
|
|
88
|
+
permanent major-bump obligation, and hand-built ProseMirror JSON is the most
|
|
89
|
+
likely thing to arrive unopenable. The capability you actually want — "give this
|
|
90
|
+
idea a picture" — is the **gallery**, and it is the same file row an inline
|
|
91
|
+
image points at: `create_idea_upload_url` → PUT the bytes → confirm the
|
|
92
|
+
`storageKey` in `media`. A URL or a markdown image typed into `body` is stored
|
|
93
|
+
as the literal text you typed.
|
|
94
|
+
|
|
95
|
+
**Two things to know before you write one.** Sending `body` REPLACES the whole
|
|
96
|
+
document, inline images included — that is the honest reading of "set the body
|
|
97
|
+
to this text", and it is worth a read of the idea first if you did not write it.
|
|
98
|
+
The image is not destroyed: an inline image *is* a file row in the idea's
|
|
99
|
+
gallery, so it survives there and only stops appearing in the prose. And `body`
|
|
100
|
+
is now capped at 256000 characters, the ceiling todos, memos and comments have
|
|
101
|
+
always had; a longer body is refused at the edge rather than stored and then
|
|
102
|
+
failing to open.
|
|
103
|
+
|
|
104
|
+
## 4.1.0 — an idea's record links
|
|
105
|
+
|
|
106
|
+
Additive. Three new tools — **`list_idea_links`**, **`attach_idea_link`**,
|
|
107
|
+
**`detach_idea_link`** — plus a `targetType`/`targetId` filter on `list_ideas`.
|
|
108
|
+
Nothing is renamed, nothing is removed and no scope changes, so every installed
|
|
109
|
+
client keeps working and no key needs re-issuing.
|
|
110
|
+
|
|
111
|
+
What it closes is an asymmetry rather than a gap in Tensor: `links` is
|
|
112
|
+
undirected and a todo could already be linked to an idea through
|
|
113
|
+
`attach_todo_link`, so an agent could file work against an idea and had no way
|
|
114
|
+
to file an idea against anything. Tensor's own web app made those links through
|
|
115
|
+
a session-only route, which is why nothing was broken and why no key could do
|
|
116
|
+
it.
|
|
117
|
+
|
|
118
|
+
They carry the same two-scope rule as their todo and file counterparts — the
|
|
119
|
+
surface's own scope plus the link target's read scope, reads narrowing silently
|
|
120
|
+
and writes answering `403` — and the same one-door rule about attachments: an
|
|
121
|
+
idea's files are its **gallery** (`get_idea` → `media`), `attach_idea_link` will
|
|
122
|
+
not take `file`, and `detach_idea_link` refuses a gallery link id with a `409`
|
|
123
|
+
instead of quietly removing a photo.
|
|
124
|
+
|
|
125
|
+
## 4.0.0 — Archive removed from Ideas
|
|
126
|
+
|
|
127
|
+
Ideas follows Todos. **`list_ideas` loses `archived`** and **`update_idea` loses
|
|
128
|
+
the `archived` field**; Delete is the only way to take a capture out of the
|
|
129
|
+
stream, it is soft, and the row lands in a Trash that empties itself 60 days
|
|
130
|
+
later. `delete_idea` and `restore_idea` are unchanged and already did exactly
|
|
131
|
+
this.
|
|
132
|
+
|
|
133
|
+
No tool was renamed and no scope changed, so **no key needs re-issuing** — but a
|
|
134
|
+
saved prompt or script that passes `archived` to either tool stops archiving,
|
|
135
|
+
and that is what makes it major. Both were REMOVED rather than accepted and
|
|
136
|
+
ignored: a read filter that quietly stops filtering only widens a result set,
|
|
137
|
+
while a write that quietly does nothing reports success for work it did not do.
|
|
138
|
+
|
|
139
|
+
Tensor's HTTP API keeps `?archived` on `GET /api/ideas` as an inert parameter
|
|
140
|
+
for the same read-side reason, so a raw HTTP caller sees the whole stream rather
|
|
141
|
+
than an error. `PATCH /api/ideas/:id` refuses an `archived` field outright.
|
|
142
|
+
|
|
143
|
+
## 3.0.0 — Archive removed from Todos
|
|
144
|
+
|
|
145
|
+
`archive_todo` is gone; **`delete_todo`** replaces it. The rename carries a real change: the old tool archived a todo (a permanent resting place, no expiry), and the new one soft-deletes it to a Trash that **empties itself 60 days after deletion**. `restore_todo` still undoes it, and now takes `withAncestors` for the case where an ancestor is also in Trash. `list_todos` loses `includeArchived` / `archivedOnly` and gains `trash`.
|
|
146
|
+
|
|
147
|
+
No scope changed and **no key needs re-issuing** — `tensor:todos:write` covers both — but a saved prompt or script that calls `archive_todo` by name stops resolving, which is what makes this major. There is deliberately no purge tool and no empty-Trash tool: those are session-only in Tensor, and a tool whose every call returns 403 would be a promise this server cannot keep.
|
|
148
|
+
|
|
149
|
+
## 2.1.0 — todos, ideas, and full files access
|
|
150
|
+
|
|
151
|
+
Tensor opened its work surfaces to API keys (2026-08), and this server grew tools for all three: todos (with workflow states and labels), the ideas capture inbox, and full file management alongside the existing export manifest. Additive only — every existing tool, name and scope is untouched, so installed clients keep working. The new tools need the new scopes (`tensor:todos:read/write`, `tensor:ideas:read/write`, `tensor:files:write` — see the table below) attached to your key when it is issued or re-issued.
|
|
13
152
|
|
|
14
153
|
## Configuration
|
|
15
154
|
|
|
@@ -17,15 +156,15 @@ Set two environment variables:
|
|
|
17
156
|
|
|
18
157
|
| Variable | Description |
|
|
19
158
|
|----------|-------------|
|
|
20
|
-
| `TENSOR_API_KEY` | Your
|
|
21
|
-
| `TENSOR_BASE_URL` | Tensor instance URL (default: `http://localhost:5000`) |
|
|
159
|
+
| `TENSOR_API_KEY` | Your Tensor API key — shape `ak_live_…` (or `ak_test_…`). Create one at **Developer → API Keys** inside your Tensor instance and attach the scopes listed below. Shown once at creation. |
|
|
160
|
+
| `TENSOR_BASE_URL` | Tensor instance URL, e.g. `https://tensor.levitating.org` (default: `http://localhost:5000`) |
|
|
22
161
|
|
|
23
162
|
## Running standalone
|
|
24
163
|
|
|
25
164
|
```bash
|
|
26
165
|
TENSOR_API_KEY=ak_live_xxxxxxxxxxxx \
|
|
27
166
|
TENSOR_BASE_URL=https://tensor.levitating.org \
|
|
28
|
-
npx
|
|
167
|
+
npx -y @levitating/tensor-mcp
|
|
29
168
|
```
|
|
30
169
|
|
|
31
170
|
## Claude Code integration
|
|
@@ -38,9 +177,9 @@ Add to your `~/.claude.json` or project `.claude.json`:
|
|
|
38
177
|
"tensor": {
|
|
39
178
|
"type": "stdio",
|
|
40
179
|
"command": "npx",
|
|
41
|
-
"args": ["
|
|
180
|
+
"args": ["-y", "@levitating/tensor-mcp"],
|
|
42
181
|
"env": {
|
|
43
|
-
"TENSOR_API_KEY": "
|
|
182
|
+
"TENSOR_API_KEY": "ak_live_your_key_here",
|
|
44
183
|
"TENSOR_BASE_URL": "https://your-instance.example.com"
|
|
45
184
|
}
|
|
46
185
|
}
|
|
@@ -57,9 +196,9 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
57
196
|
"mcpServers": {
|
|
58
197
|
"tensor": {
|
|
59
198
|
"command": "npx",
|
|
60
|
-
"args": ["
|
|
199
|
+
"args": ["-y", "@levitating/tensor-mcp"],
|
|
61
200
|
"env": {
|
|
62
|
-
"TENSOR_API_KEY": "
|
|
201
|
+
"TENSOR_API_KEY": "ak_live_your_key_here",
|
|
63
202
|
"TENSOR_BASE_URL": "https://your-instance.example.com"
|
|
64
203
|
}
|
|
65
204
|
}
|
|
@@ -67,8 +206,32 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
67
206
|
}
|
|
68
207
|
```
|
|
69
208
|
|
|
209
|
+
## Writes are permanent
|
|
210
|
+
|
|
211
|
+
Three tools have consequences an MCP client cannot undo, and they are worth confirming with the user before calling:
|
|
212
|
+
|
|
213
|
+
- **`create_transaction`** — the ledger is append-only. There is no update or delete for a transaction, because position state (quantity, average cost, cost basis, realized gain) is a non-invertible fold over it. A mistake is corrected by posting a *compensating* entry of the opposite type, never by editing.
|
|
214
|
+
- **`delete_position`** — hard-deletes the position together with its entire transaction ledger, valuation-event history, loan/fund terms, relations and attachments. To record an exit, use `sell_all_position` instead; that keeps the history.
|
|
215
|
+
- **`data_apply`** — writes a whole batch. Always `data_dry_run` first and read the preview.
|
|
216
|
+
|
|
217
|
+
Deletes on entities, accounts, assets and reference data are likewise immediate and unrecoverable. The work surfaces are deliberately softer: `delete_file`, `delete_idea` and `delete_todo` all move a row to a restorable Trash, and every permanent purge is UI-only. `delete_todo` replaced `archive_todo` in 2026-08, when Archive was removed from Todos — a rename with a real change behind it, and therefore a MAJOR bump. All three Trashes are the same in one way worth knowing: each empties itself 60 days after deletion, on one shared window and one sweeper. (This sentence used to name that as a difference between Todos and the other two; Files and Ideas joined the same sweep in 2026-08.) Still immediate: `delete_todo_state`, `delete_todo_label` and `delete_file_folder` — each refuses while in use, but once through, there is no undo.
|
|
218
|
+
|
|
70
219
|
## Available Tools
|
|
71
220
|
|
|
221
|
+
The tables below are the complete list. For the authoritative inventory at runtime — names, descriptions and full input schemas — send a `tools/list` JSON-RPC request after `initialize`. (Inside this repo, `listRegisteredToolNames()` in `tools.ts` derives the same list; prefer either over copying a count into prose, which is how this document once came to advertise six tools that did not match the registry.)
|
|
222
|
+
|
|
223
|
+
### Rollups, quotes, sync & search
|
|
224
|
+
|
|
225
|
+
| Tool | Description |
|
|
226
|
+
|------|-------------|
|
|
227
|
+
| `get_portfolio_summary` | Net worth, cost basis, unrealized P/L — computed server-side, optionally grouped |
|
|
228
|
+
| `search_market_quotes` | Find market-quote candidates for an asset |
|
|
229
|
+
| `verify_market_quote` | Resolve one symbol to a live price without writing |
|
|
230
|
+
| `sync_prices` | Reprice every linked asset (or a subset) |
|
|
231
|
+
| `sync_asset_price` | Reprice one asset |
|
|
232
|
+
| `list_changes` | Creates, updates and deletes since a timestamp |
|
|
233
|
+
| `search_records` | Site-wide ranked search across every record type; lanes are gated per read scope, so the key sees exactly its slice. Memos are the one lane no scope opens — they are session-only |
|
|
234
|
+
|
|
72
235
|
### Portfolio
|
|
73
236
|
|
|
74
237
|
| Tool | Description |
|
|
@@ -93,15 +256,17 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
93
256
|
| `list_asset_prices` | List historical prices |
|
|
94
257
|
| `update_asset_price` | Record a new price |
|
|
95
258
|
| `list_positions` | List all positions |
|
|
96
|
-
| `create_position` | Open a new position |
|
|
259
|
+
| `create_position` | Open a new position. Pass `costBasis` instead of `quantity`/`averageCost` to open a fund capital account |
|
|
97
260
|
| `update_position` | Update a position |
|
|
98
|
-
| `delete_position` |
|
|
99
|
-
| `sell_all_position` | Close/sell a position |
|
|
261
|
+
| `delete_position` | **Destructive.** Hard-deletes the position *and* its whole ledger and history — see above |
|
|
262
|
+
| `sell_all_position` | Close/sell a position, keeping its history |
|
|
100
263
|
| `list_position_relations` | List position relations |
|
|
101
264
|
| `create_position_relation` | Link positions |
|
|
102
265
|
| `delete_position_relation` | Remove a relation |
|
|
266
|
+
| `list_position_events` | Valuation-event history for one position |
|
|
267
|
+
| `list_events` | Valuation-event history across all positions |
|
|
103
268
|
| `list_transactions` | List all transactions |
|
|
104
|
-
| `create_transaction` |
|
|
269
|
+
| `create_transaction` | Append to the ledger. **Permanent** — no edit, no delete; `amount`/`quantity` are positive magnitudes and direction comes from the type |
|
|
105
270
|
|
|
106
271
|
### Reference Data
|
|
107
272
|
|
|
@@ -132,18 +297,111 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
132
297
|
|
|
133
298
|
| Tool | Description |
|
|
134
299
|
|------|-------------|
|
|
135
|
-
| `data_dry_run` |
|
|
136
|
-
| `data_apply` |
|
|
300
|
+
| `data_dry_run` | Step 1: validate a typed batch (`batchId` + ops) and get a persisted preview with a `requestHash` |
|
|
301
|
+
| `data_apply` | Step 2: execute the persisted dry-run by `batchId` + `requestHash` + confirm sentinel (never takes fresh ops) |
|
|
302
|
+
|
|
303
|
+
### Files
|
|
304
|
+
|
|
305
|
+
The full feature: browse, upload (presign → PUT → confirm), organize, link, soft-delete. Deletion is a restorable Trash; the permanent purge and decryption-device enrollment are deliberately not here.
|
|
306
|
+
|
|
307
|
+
| Tool | Scope | Description |
|
|
308
|
+
|------|-------|-------------|
|
|
309
|
+
| `list_files` | `tensor:files:read` | Export manifest for backup/mirroring: human folder/filename paths, checksums, and — with `urls` — short-lived presigned download URLs. Encrypted files also release a per-file key when a registered `deviceId` is passed |
|
|
310
|
+
| `browse_files` | `tensor:files:read` (+ the target's read scope for `targetType`, and per row for `links`) | Folder/Trash-aware listing the way the Files page reads: by folder, attached record, or title/filename search, in any of the page's eight orders (`sort`). `targetType` reads the `links` table since the 2026-08 fold, so a todo, idea or memo target is a question it can answer. Links to records your key cannot read are omitted |
|
|
311
|
+
| `get_file` | `tensor:files:read` | One file's metadata and attachment links. Links to records your key cannot read are omitted |
|
|
312
|
+
| `create_file_upload_url` | `tensor:files:write` | Step 1 of the upload: presigned PUT URL + storage key (obey the echoed encryption terms) |
|
|
313
|
+
| `confirm_file_upload` | `tensor:files:write` (+ each `links` target's read scope) | Step 3: confirm the object landed and create the file row (+ links) in one transaction. The optional `links` array takes the same target types as `attach_file_link` — the six ledger records plus todo, idea and memo, never `file` — and since 2026-08 a target your key cannot read fails the confirm with a `403` rather than being attached quietly |
|
|
314
|
+
| `update_file` | `tensor:files:write` | Rename / move / annotate (title, folder, notes) |
|
|
315
|
+
| `delete_file` | `tensor:files:write` | Move to Trash. Soft — restorable; the purge is UI-only |
|
|
316
|
+
| `restore_file` | `tensor:files:write` | Restore from Trash |
|
|
317
|
+
| `get_file_download_url` | `tensor:files:read` | Presigned URL for one file's bytes (plus the key release for an encrypted file). Unauthenticated bearer access — every issuance is access-logged |
|
|
318
|
+
| `list_file_links` | `tensor:files:read` + the target's read scope | A file's attachments — the six ledger records plus a todo, an idea or a memo since the 2026-08 fold. Each row carries `label`, the target's resolved name, and an `id` that is the EDGE's id rather than the target record's. Rows your key cannot read are omitted, memos for every key |
|
|
319
|
+
| `attach_file_link` | `tensor:files:write` + the target's read scope | Attach a file to a record — the six ledger records plus todo, idea and memo, never `file` (idempotent). A target you cannot read is a `403`, not a silent drop |
|
|
320
|
+
| `detach_file_link` | `tensor:files:write` + the linked target's read scope | Remove one attachment; the file is untouched |
|
|
321
|
+
| `list_file_folders` | `tensor:files:read` | List folders (nesting + optional record pin) |
|
|
322
|
+
| `create_file_folder` | `tensor:files:write` | Create a folder |
|
|
323
|
+
| `update_file_folder` | `tensor:files:write` | Rename / move / re-pin a folder |
|
|
324
|
+
| `delete_file_folder` | `tensor:files:write` | Delete an **empty** folder — refuses one still holding files or sub-folders |
|
|
325
|
+
|
|
326
|
+
### Todos
|
|
327
|
+
|
|
328
|
+
Bodies and comments are TipTap JSON, never HTML — the write tools take plain text and wrap it. `delete_todo` is a soft delete to Trash and `restore_todo` undoes it; the permanent delete, emptying Trash and comment deletion are session-only.
|
|
329
|
+
|
|
330
|
+
| Tool | Scope | Description |
|
|
331
|
+
|------|-------|-------------|
|
|
332
|
+
| `list_todos` | `tensor:todos:read` | List todos with server-side filters (state, category, assignee, priority, label, parent, linked record, search, `trash`) and sort. `assigneeId` and `labelId` take one id or several |
|
|
333
|
+
| `get_todo` | `tensor:todos:read` | One todo: body, state, labels, links, sub-task counts. Links to records your key cannot read are omitted |
|
|
334
|
+
| `get_todo_subtree` | `tensor:todos:read` | The branch under a todo — counts and depth, for naming what a delete or a re-parent takes with it |
|
|
335
|
+
| `get_todo_activity` | `tensor:todos:read` | Activity feed, folded from the mutation audit log — a rolling 90-day window, not permanent history |
|
|
336
|
+
| `create_todo` | `tensor:todos:write` + each `links` target's read scope | Create a todo (plain-text `body`, wrapped to TipTap JSON; `stateId` from `list_todo_states`). The optional `links` array takes the same target types as `attach_todo_link` — the six ledger records plus todo, idea and memo, never `file` — and a target your key cannot read fails the create with a `403` rather than being dropped |
|
|
337
|
+
| `update_todo` | `tensor:todos:write` | Partial update; optional stale-write guard via `expectedUpdatedAt` |
|
|
338
|
+
| `delete_todo` | `tensor:todos:write` | Move the todo **and its whole branch** to Trash, atomically. Soft; `restore_todo` undoes it, and Trash self-empties after 60 days |
|
|
339
|
+
| `restore_todo` | `tensor:todos:write` | Take a todo out of Trash; `cascade` restores its deleted branch, `withAncestors` the chain above (409 without it) |
|
|
340
|
+
| `set_todo_parent` | `tensor:todos:write` | Re-parent (or promote to top level); cycles and over-depth are refused |
|
|
341
|
+
| `reorder_todo` | `tensor:todos:write` | Move within the manual order, optionally changing state |
|
|
342
|
+
| `set_todo_labels` | `tensor:todos:write` | Replace the todo's whole label set |
|
|
343
|
+
| `list_todo_comments` | `tensor:todos:read` | The comment thread |
|
|
344
|
+
| `create_todo_comment` | `tensor:todos:write` | Comment (plain text, stored as TipTap JSON) |
|
|
345
|
+
| `update_todo_comment` | `tensor:todos:write` | Edit your own comment — comments are never deletable here |
|
|
346
|
+
| `list_todo_states` | `tensor:todos:read` | Workflow states with categories and usage counts |
|
|
347
|
+
| `create_todo_state` | `tensor:todos:write` | Create a workflow state |
|
|
348
|
+
| `update_todo_state` | `tensor:todos:write` | Update a state; category change refuses while in use |
|
|
349
|
+
| `delete_todo_state` | `tensor:todos:write` | Delete a state; refuses while todos hold it |
|
|
350
|
+
| `list_todo_labels` | `tensor:todos:read` | Labels with usage counts |
|
|
351
|
+
| `create_todo_label` | `tensor:todos:write` | Create a label |
|
|
352
|
+
| `update_todo_label` | `tensor:todos:write` | Rename / recolor a label |
|
|
353
|
+
| `delete_todo_label` | `tensor:todos:write` | Delete a label (removed from every todo) |
|
|
354
|
+
| `list_todo_files` | `tensor:todos:read` **+ `tensor:files:read`** | Files attached to a todo. The rows are file rows, so the files read scope is required too |
|
|
355
|
+
| `attach_todo_file` | `tensor:todos:write` **+ `tensor:files:read`** | Attach an existing file (upload via the files tools first) |
|
|
356
|
+
| `detach_todo_file` | `tensor:todos:write` **+ `tensor:files:read`** | Detach a file; the file itself is untouched |
|
|
357
|
+
| `list_todo_links` | `tensor:todos:read` + the target's read scope | Records the todo is linked to — the six ledger records plus another todo, an idea or a memo (a file too, if a `related` edge exists; attachments are `list_todo_files`). Rows your key cannot read are omitted rather than refused, memos for every key |
|
|
358
|
+
| `attach_todo_link` | `tensor:todos:write` + the target's read scope | Link the todo to a record — the six ledger records plus todo, idea and memo; files go through `attach_todo_file` (idempotent) |
|
|
359
|
+
| `detach_todo_link` | `tensor:todos:write` + the linked record's read scope | Remove one of the todo's links |
|
|
360
|
+
|
|
361
|
+
### Ideas
|
|
362
|
+
|
|
363
|
+
The capture inbox. An idea's body is a TipTap document since 4.2.0 — plain text in via `body`, plain text back out, with `bodyJson` alongside on reads; its comments are the same; its media are file rows behind the same upload machinery as Files. Delete is a restorable Trash; the purge and comment deletion are session-only. Since 4.1.0 an idea's record links are here too, the same three verbs the todo and file surfaces already had.
|
|
364
|
+
|
|
365
|
+
| Tool | Scope | Description |
|
|
366
|
+
|------|-------|-------------|
|
|
367
|
+
| `list_ideas` | `tensor:ideas:read` (+ the target's read scope for `targetType`) | The stream — filter by kind, tag, site, search, linked record; order it with `sort` (4.3.0); or, with `trash`, the deleted rows |
|
|
368
|
+
| `get_idea` | `tensor:ideas:read` | One idea with tags and media gallery |
|
|
369
|
+
| `create_idea` | `tensor:ideas:write` | Capture (needs a url, some text, or media; duplicate URLs are flagged, not refused). `body` is plain text in, document stored |
|
|
370
|
+
| `update_idea` | `tensor:ideas:write` | Partial update; `tags` replaces, `media` appends, `body` REPLACES the whole body document |
|
|
371
|
+
| `delete_idea` | `tensor:ideas:write` | Move to Trash. Soft — restorable; the purge is UI-only |
|
|
372
|
+
| `restore_idea` | `tensor:ideas:write` | Restore from Trash |
|
|
373
|
+
| `list_idea_comments` | `tensor:ideas:read` | The comment thread |
|
|
374
|
+
| `create_idea_comment` | `tensor:ideas:write` | Comment (plain text, stored as TipTap JSON) |
|
|
375
|
+
| `update_idea_comment` | `tensor:ideas:write` | Edit your own comment — comments are never deletable here |
|
|
376
|
+
| `list_idea_tags` | `tensor:ideas:read` | Every tag in use, with counts |
|
|
377
|
+
| `list_idea_sites` | `tensor:ideas:read` | Every source site, with counts |
|
|
378
|
+
| `get_idea_media_url` | `tensor:ideas:read` **+ `tensor:files:read`** | Presigned URL (+ key release for encrypted media) for one gallery object; access-logged. An idea's media IS a file row, and the key release is permanent, so the files read scope is required too |
|
|
379
|
+
| `create_idea_upload_url` | `tensor:ideas:write` | Presign a media upload; confirm it via `create_idea` / `update_idea` `media` |
|
|
380
|
+
| `list_idea_links` | `tensor:ideas:read` + the target's read scope | Records the idea is linked to — the six ledger records plus a todo, another idea or a memo (a file too, if a `related` edge exists; the gallery is `get_idea` → `media`). Each row's `kind` says whether a person made it (`related`) or the reconciler did (`mention`). Rows your key cannot read are omitted rather than refused, memos for every key |
|
|
381
|
+
| `attach_idea_link` | `tensor:ideas:write` + the target's read scope | Link the idea to a record — the six ledger records plus todo, idea and memo; files are the gallery, not a link (idempotent) |
|
|
382
|
+
| `detach_idea_link` | `tensor:ideas:write` + the linked record's read scope | Remove one of the idea's links. Two kinds refuse with a `409` instead of being removed: a gallery attachment (wrong door for a photo) and a `mention` (the reconciler owns it — edit the prose) |
|
|
137
383
|
|
|
138
384
|
## Scopes
|
|
139
385
|
|
|
140
|
-
Your API key needs the following
|
|
386
|
+
Your API key needs the following Tensor scopes, attached when the key is created. Deny-by-default: a key with no scopes reaches nothing.
|
|
141
387
|
|
|
142
388
|
| Scope | Grants |
|
|
143
389
|
|-------|--------|
|
|
144
|
-
| `tensor:portfolio:read` | Read entities, accounts, assets, positions, transactions |
|
|
145
|
-
| `tensor:portfolio:write` | Create/update/delete portfolio resources |
|
|
390
|
+
| `tensor:portfolio:read` | Read entities, accounts, assets, positions, transactions, events, relations — plus the portfolio summary, change feed, and market-quote lookups |
|
|
391
|
+
| `tensor:portfolio:write` | Create/update/delete portfolio resources, sell-all, record a price, trigger a price sync |
|
|
146
392
|
| `tensor:reference:read` | Read institutions, entity types, role types, account types, asset classes |
|
|
147
393
|
| `tensor:reference:write` | Create/update/delete reference data |
|
|
394
|
+
| `tensor:files:read` | Browse files and folders, read metadata and links, mint download URLs, and the export manifest |
|
|
395
|
+
| `tensor:files:write` | Upload (presign + confirm), rename/move, folders, record links, soft-delete/restore |
|
|
396
|
+
| `tensor:todos:read` | Read todos, subtrees, activity, comments, workflow states, labels and record links. A link row also needs its target type's own read scope; the attached-files list needs `tensor:files:read` outright |
|
|
397
|
+
| `tensor:todos:write` | Create/update todos, soft-delete to Trash and restore, reorder/re-parent, comments, labels, states, attachments. Attaching or linking also needs the other end's read scope; the Trash purge and comment deletion are not reachable at all |
|
|
398
|
+
| `tensor:ideas:read` | Read the ideas stream, tag/site rails, comments and record links. **Not media URLs on their own** — an idea's media is a file row and that route releases its decryption key, so `get_idea_media_url` needs `tensor:files:read` as well |
|
|
399
|
+
| `tensor:ideas:write` | Capture/update ideas, soft-delete to Trash and restore, comments, media uploads and record links. A link write also needs the target's read scope; the Trash purge and comment deletion are not reachable at all |
|
|
400
|
+
| `tensor:data:read` | Retrieve a persisted dry-run batch |
|
|
148
401
|
| `tensor:data:dry_run` | Run data pipeline dry-runs |
|
|
149
402
|
| `tensor:data:apply` | Apply data pipeline operations |
|
|
403
|
+
| `tensor:data:admin` | Reserved; no endpoint requires it today |
|
|
404
|
+
|
|
405
|
+
`search_records` needs no scope of its own — each result lane requires that domain's read scope, lanes the key does not cover are silently omitted, and a key covering no lane gets 403.
|
|
406
|
+
|
|
407
|
+
The Tensor user who issued the key is the ceiling: a key can never do more than that user could do in the browser.
|