@levitating/tensor-mcp 5.0.0 → 5.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 +88 -12
- package/dist/index.js +285 -60
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
1
1
|
# Tensor MCP
|
|
2
2
|
|
|
3
|
-
Model Context Protocol server that exposes the Tensor API as tools for AI assistants.
|
|
3
|
+
Model Context Protocol server that exposes the Tensor API as tools for AI assistants. Hosted MCP prefers OAuth discovery and browser consent; it also accepts a scoped Clerk API key where applicable. Both credentials obey the same deny-by-default REST scopes and allowlist — an MCP client can never reach anything its credential could not reach over REST.
|
|
4
4
|
|
|
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
|
|
5
|
+
Tensor is a private family office workbench: a ledger of entities, accounts, assets, positions and transactions, plus the work around it — todos with canonical tags, 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, scope-aware site-wide search, files (upload, browse, folders, download URLs, export manifest), todos, ideas, and Web — bookmarks with their folder tree, and tab groups synced from a browser. The boundary that remains is deliberate — **no unrecoverable destruction, and no self-widening**: every Trash purge (todos, ideas, files, bookmarks, tab groups), comment deletion, decryption-device enrollment, file access logs, generic cross-surface `/api/links*` and `/api/tags*`, FX, and loan terms stay session-only. Resource-specific File/Todo/Idea link tools and `search_records` are public only through their underlying scoped surfaces, and Tensor's smoke tests assert those boundaries in both directions. The reasoning lives in `docs/contract/MCP.md` in the Tensor repo.
|
|
6
6
|
|
|
7
|
-
Published as [`@levitating/tensor-mcp`](https://www.npmjs.com/package/@levitating/tensor-mcp). The
|
|
7
|
+
Published as [`@levitating/tensor-mcp@^5.1.0`](https://www.npmjs.com/package/@levitating/tensor-mcp). The complete inventory is the tables below — every tool, nothing needing a clone of the Tensor repo. CI derives and checks every listed name against `mcp-server/tools.ts`, in both directions.
|
|
8
8
|
|
|
9
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
10
|
|
|
11
|
+
## 5.1.0 — Web: bookmarks and tab groups
|
|
12
|
+
|
|
13
|
+
Seventeen new tools, no breaking change. The Web surface — bookmarks filed into
|
|
14
|
+
a folder tree, and tab groups parked from the browser extension — has had
|
|
15
|
+
tables, REST routes, scopes and an OpenAPI contract since it shipped, and had
|
|
16
|
+
none of them here.
|
|
17
|
+
|
|
18
|
+
Bookmarks: `list_bookmarks`, `get_bookmark`, `create_bookmark`,
|
|
19
|
+
`update_bookmark`, `delete_bookmark`, `restore_bookmark`, and the folder tree
|
|
20
|
+
with `list_bookmark_folders`, `create_bookmark_folder`,
|
|
21
|
+
`update_bookmark_folder`, `delete_bookmark_folder`.
|
|
22
|
+
|
|
23
|
+
Tab groups: `list_tab_groups`, `get_tab_group`, `create_tab_group`,
|
|
24
|
+
`update_tab_group`, `delete_tab`, `delete_tab_group`, `restore_tab_group`.
|
|
25
|
+
|
|
26
|
+
Two new scopes, and they are separate on purpose: `tensor:bookmarks:read` /
|
|
27
|
+
`:write` and `tensor:tabs:read` / `:write`. A synced tab group is in effect a
|
|
28
|
+
partial browsing history, so a key issued to read the pages you deliberately
|
|
29
|
+
filed must not also read every page you merely parked. Existing keys carry
|
|
30
|
+
neither and reach neither — attach them when you create the key.
|
|
31
|
+
|
|
32
|
+
Both deletes are soft and both restores are here. Neither permanent purge is,
|
|
33
|
+
on the rule every work surface shares: a key may fill a Trash and only a person
|
|
34
|
+
may empty one.
|
|
35
|
+
|
|
11
36
|
## 5.0.0 — Todo labels are Todo tags
|
|
12
37
|
|
|
13
38
|
Breaking tool-name change. Todos and Ideas now use Tensor's canonical tag
|
|
@@ -171,7 +196,7 @@ No scope changed and **no key needs re-issuing** — `tensor:todos:write` covers
|
|
|
171
196
|
|
|
172
197
|
## 2.1.0 — todos, ideas, and full files access
|
|
173
198
|
|
|
174
|
-
Tensor opened its work surfaces to API keys (2026-08), and this server grew tools for all three: todos (with workflow states and
|
|
199
|
+
Tensor opened its work surfaces to API keys (2026-08), and this server grew tools for all three: todos (with workflow states and canonical tags), 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.
|
|
175
200
|
|
|
176
201
|
## Do you need this package at all?
|
|
177
202
|
|
|
@@ -202,6 +227,21 @@ register from the same file.
|
|
|
202
227
|
| Good for | anything interactive | headless / CI |
|
|
203
228
|
| Tools | identical | identical |
|
|
204
229
|
|
|
230
|
+
|
|
231
|
+
### Hosted client setup: Perplexity and Cursor
|
|
232
|
+
|
|
233
|
+
For **Perplexity**, add a custom **remote MCP/connector** with
|
|
234
|
+
`https://tensor.levitating.org/mcp`. Choose **OAuth/Connect** when the client
|
|
235
|
+
offers it and complete Tensor's browser consent. For **Cursor**, add a **remote
|
|
236
|
+
MCP server** in Settings → Tools & Integrations / MCP using the same URL, then
|
|
237
|
+
choose Connect and complete consent. These are hosted configurations: do not
|
|
238
|
+
put `npx` or `TENSOR_API_KEY` in them.
|
|
239
|
+
|
|
240
|
+
An API key is an intentional fallback for a hosted client that cannot complete
|
|
241
|
+
OAuth: configure the scoped Tensor key as its Bearer/API-key credential. For a
|
|
242
|
+
local stdio client, use the configuration below; stdio is API-key-only and does
|
|
243
|
+
not participate in the hosted OAuth redirect flow.
|
|
244
|
+
|
|
205
245
|
## Configuration
|
|
206
246
|
|
|
207
247
|
Set two environment variables:
|
|
@@ -216,7 +256,7 @@ Set two environment variables:
|
|
|
216
256
|
```bash
|
|
217
257
|
TENSOR_API_KEY=ak_live_xxxxxxxxxxxx \
|
|
218
258
|
TENSOR_BASE_URL=https://tensor.levitating.org \
|
|
219
|
-
npx -y @levitating/tensor-mcp
|
|
259
|
+
npx -y @levitating/tensor-mcp@^5.0.0
|
|
220
260
|
```
|
|
221
261
|
|
|
222
262
|
## Claude Code integration
|
|
@@ -229,7 +269,7 @@ Add to your `~/.claude.json` or project `.claude.json`:
|
|
|
229
269
|
"tensor": {
|
|
230
270
|
"type": "stdio",
|
|
231
271
|
"command": "npx",
|
|
232
|
-
"args": ["-y", "@levitating/tensor-mcp"],
|
|
272
|
+
"args": ["-y", "@levitating/tensor-mcp@^5.0.0"],
|
|
233
273
|
"env": {
|
|
234
274
|
"TENSOR_API_KEY": "ak_live_your_key_here",
|
|
235
275
|
"TENSOR_BASE_URL": "https://your-instance.example.com"
|
|
@@ -248,7 +288,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
248
288
|
"mcpServers": {
|
|
249
289
|
"tensor": {
|
|
250
290
|
"command": "npx",
|
|
251
|
-
"args": ["-y", "@levitating/tensor-mcp"],
|
|
291
|
+
"args": ["-y", "@levitating/tensor-mcp@^5.0.0"],
|
|
252
292
|
"env": {
|
|
253
293
|
"TENSOR_API_KEY": "ak_live_your_key_here",
|
|
254
294
|
"TENSOR_BASE_URL": "https://your-instance.example.com"
|
|
@@ -260,13 +300,14 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
260
300
|
|
|
261
301
|
## Writes are permanent
|
|
262
302
|
|
|
263
|
-
|
|
303
|
+
Four tools have consequences an MCP client cannot undo, and they are worth confirming with the user before calling:
|
|
264
304
|
|
|
265
305
|
- **`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.
|
|
266
306
|
- **`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.
|
|
307
|
+
- **`delete_bookmark_folder`** — destroys the folder row outright, and it is the one irreversible thing `tensor:bookmarks:write` grants. Nothing filed under it is lost (its bookmarks are unfiled, its sub-folders promoted, in one transaction) but the folder and the filing decision it recorded are gone: there is no Trash behind it and no restore. Note it is the opposite of `delete_file_folder`, which refuses a non-empty folder — this one accepts one, so its reach is larger than the sibling it resembles.
|
|
267
308
|
- **`data_apply`** — writes a whole batch. Always `data_dry_run` first and read the preview.
|
|
268
309
|
|
|
269
|
-
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.
|
|
310
|
+
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. Bookmarks and tab groups joined them in the same shape: `delete_bookmark` and `delete_tab_group` are soft and restorable, and neither purge is a tool. Every Trash is 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, then as three surfaces; the registry owns the count, which is why one is not written here.) Still immediate: `delete_todo_state`, `delete_todo_tag`, `delete_file_folder` and `delete_tab` (one tab out of a live group — the GROUP is the recoverable unit, so a tab has no soft state of its own). The first three refuse while in use; once through, there is no undo.
|
|
270
311
|
|
|
271
312
|
## Available Tools
|
|
272
313
|
|
|
@@ -382,7 +423,7 @@ Bodies and comments are TipTap JSON, never HTML — the write tools take plain t
|
|
|
382
423
|
| Tool | Scope | Description |
|
|
383
424
|
|------|-------|-------------|
|
|
384
425
|
| `list_todos` | `tensor:todos:read` | List todos with server-side filters (state, category, assignee, priority, tag, parent, linked record, search, `trash`) and sort. `assigneeId` and `tagId` take one id or several |
|
|
385
|
-
| `get_todo` | `tensor:todos:read` | One todo: body, state,
|
|
426
|
+
| `get_todo` | `tensor:todos:read` | One todo: body, state, canonical tags, links, sub-task counts. Links to records your key cannot read are omitted |
|
|
386
427
|
| `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 |
|
|
387
428
|
| `get_todo_activity` | `tensor:todos:read` | Activity feed, folded from the mutation audit log — a rolling 90-day window, not permanent history |
|
|
388
429
|
| `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 |
|
|
@@ -433,6 +474,37 @@ The capture inbox. An idea's body is a TipTap document since 4.2.0 — plain tex
|
|
|
433
474
|
| `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) |
|
|
434
475
|
| `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) |
|
|
435
476
|
|
|
477
|
+
### Bookmarks
|
|
478
|
+
|
|
479
|
+
The filed half of Web: pages somebody decided to keep, in a folder tree. `/api/bookmark-folders` is a SIBLING resource rather than a sub-path — one scope opens both. Delete is a restorable Trash; the purge is session-only. A duplicate URL is flagged (`duplicateOf`), never refused.
|
|
480
|
+
|
|
481
|
+
| Tool | Scope | Description |
|
|
482
|
+
|------|-------|-------------|
|
|
483
|
+
| `list_bookmarks` | `tensor:bookmarks:read` | The library, newest first. `folderId` is three-valued — an id, `'none'` for the unfiled, or omitted for everything — and `trash` gives the deleted rows |
|
|
484
|
+
| `get_bookmark` | `tensor:bookmarks:read` | One bookmark, with the `normalizedUrl` duplicate detection compares |
|
|
485
|
+
| `create_bookmark` | `tensor:bookmarks:write` | File a page. Only `url` is required; no folder means unfiled, which is a resting state |
|
|
486
|
+
| `update_bookmark` | `tensor:bookmarks:write` | Partial update — title, url, folder, excerpt, favicon. `folderId: null` unfiles |
|
|
487
|
+
| `delete_bookmark` | `tensor:bookmarks:write` | Move to Trash. Soft — restorable; the purge is UI-only |
|
|
488
|
+
| `restore_bookmark` | `tensor:bookmarks:write` | Restore, back into the folder it was filed in |
|
|
489
|
+
| `list_bookmark_folders` | `tensor:bookmarks:read` | The folder tree |
|
|
490
|
+
| `create_bookmark_folder` | `tensor:bookmarks:write` | Create a folder, optionally nested |
|
|
491
|
+
| `update_bookmark_folder` | `tensor:bookmarks:write` | Rename or re-parent. A cycle or a depth ceiling refuses with `409` saying which |
|
|
492
|
+
| `delete_bookmark_folder` | `tensor:bookmarks:write` | Destroy the folder and nothing else: its bookmarks are unfiled, its sub-folders promoted. No undo — a folder is a filing decision, not a Trash surface |
|
|
493
|
+
|
|
494
|
+
### Tab groups
|
|
495
|
+
|
|
496
|
+
Tabs parked from the browser extension, kept together and in order. Scoped SEPARATELY from bookmarks on purpose: a synced group is in effect a partial browsing history. The GROUP is the unit — there is no per-tab read, and no tab has a Trash of its own.
|
|
497
|
+
|
|
498
|
+
| Tool | Scope | Description |
|
|
499
|
+
|------|-------|-------------|
|
|
500
|
+
| `list_tab_groups` | `tensor:tabs:read` | Every group, hydrated with its tabs. Starred first. `limit`/`offset` page the groups; a group's tabs are never truncated |
|
|
501
|
+
| `get_tab_group` | `tensor:tabs:read` | One group with its tabs in order |
|
|
502
|
+
| `create_tab_group` | `tensor:tabs:write` | Park 1–500 tabs as one group. One call carries the whole group — the rate limit makes per-tab posting unworkable |
|
|
503
|
+
| `update_tab_group` | `tensor:tabs:write` | `name`, `locked`, `starred` — and deliberately not the tabs, so "which tabs did I have" stays answerable from the audit trail |
|
|
504
|
+
| `delete_tab` | `tensor:tabs:write` | Remove one tab from a live group. Immediate; the group is the recoverable unit |
|
|
505
|
+
| `delete_tab_group` | `tensor:tabs:write` | Move the whole group to Trash. Soft — restorable; the purge is UI-only |
|
|
506
|
+
| `restore_tab_group` | `tensor:tabs:write` | Restore the group, tabs and all |
|
|
507
|
+
|
|
436
508
|
## Scopes
|
|
437
509
|
|
|
438
510
|
Your API key needs the following Tensor scopes, attached when the key is created. Deny-by-default: a key with no scopes reaches nothing.
|
|
@@ -445,10 +517,14 @@ Your API key needs the following Tensor scopes, attached when the key is created
|
|
|
445
517
|
| `tensor:reference:write` | Create/update/delete reference data |
|
|
446
518
|
| `tensor:files:read` | Browse files and folders, read metadata and links, mint download URLs, and the export manifest |
|
|
447
519
|
| `tensor:files:write` | Upload (presign + confirm), rename/move, folders, record links, soft-delete/restore |
|
|
448
|
-
| `tensor:todos:read` | Read todos, subtrees, activity, comments, workflow states,
|
|
449
|
-
| `tensor:todos:write` | Create/update todos, soft-delete to Trash and restore, reorder/re-parent, comments,
|
|
520
|
+
| `tensor:todos:read` | Read todos, subtrees, activity, comments, workflow states, canonical tags and record links. A link row also needs its target type's own read scope; the attached-files list needs `tensor:files:read` outright |
|
|
521
|
+
| `tensor:todos:write` | Create/update todos, soft-delete to Trash and restore, reorder/re-parent, comments, canonical tags, states, attachments. Attaching or linking also needs the other end's read scope; the Trash purge and comment deletion are not reachable at all |
|
|
450
522
|
| `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 |
|
|
451
523
|
| `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 |
|
|
524
|
+
| `tensor:bookmarks:read` | Read filed bookmarks and the bookmark folder tree. The tree is a sibling resource of `/api/bookmarks`, not a sub-path, and this one scope opens both |
|
|
525
|
+
| `tensor:bookmarks:write` | Create/update bookmarks, move them between folders, folder create/rename/re-parent/delete, soft-delete to Trash and restore. The purge is not reachable at all |
|
|
526
|
+
| `tensor:tabs:read` | Read tab groups and the tabs inside them. **Separate from `tensor:bookmarks:read` on purpose** — a synced group is in effect a partial browsing history, so a key issued to read the pages you filed does not also read every page you parked |
|
|
527
|
+
| `tensor:tabs:write` | Create a group with its tabs, rename/lock/star, remove a tab, soft-delete a group to Trash and restore it. The purge is not reachable at all |
|
|
452
528
|
| `tensor:data:read` | Retrieve a persisted dry-run batch |
|
|
453
529
|
| `tensor:data:dry_run` | Run data pipeline dry-runs |
|
|
454
530
|
| `tensor:data:apply` | Apply data pipeline operations |
|
package/dist/index.js
CHANGED
|
@@ -61,7 +61,15 @@ var SEARCH_RECORD_TYPES_MIRROR = [
|
|
|
61
61
|
"file",
|
|
62
62
|
"todo",
|
|
63
63
|
"idea",
|
|
64
|
-
"memo"
|
|
64
|
+
"memo",
|
|
65
|
+
// WEB. A bookmark and a TAB — the searchable unit is a tab, not a group
|
|
66
|
+
// (you search a title; you delete a session), which is why this is `tab`
|
|
67
|
+
// while the Trash surface key is `tab_group`. Missing them here did not
|
|
68
|
+
// widen anything — the route intersects lanes with the key's scopes before
|
|
69
|
+
// it generates SQL — it made two real lanes UNASKABLE, since a value this
|
|
70
|
+
// z.enum refuses never reaches the server at all.
|
|
71
|
+
"bookmark",
|
|
72
|
+
"tab"
|
|
65
73
|
];
|
|
66
74
|
var IDEA_KINDS = ["link", "note", "image", "video"];
|
|
67
75
|
function tiptapDocJson(text) {
|
|
@@ -78,7 +86,7 @@ function numListParam(value) {
|
|
|
78
86
|
function registerAllTools(server2, api) {
|
|
79
87
|
server2.tool(
|
|
80
88
|
"list_entities",
|
|
81
|
-
"List all entities (people, trusts, companies) in the organization",
|
|
89
|
+
"List all entities (people, trusts, companies) in the organization. Requires the tensor:portfolio:read scope.",
|
|
82
90
|
{ limit: z.number().optional().describe("Max results to return"), offset: z.number().optional().describe("Pagination offset") },
|
|
83
91
|
async ({ limit, offset }) => {
|
|
84
92
|
const params = new URLSearchParams();
|
|
@@ -91,7 +99,7 @@ function registerAllTools(server2, api) {
|
|
|
91
99
|
);
|
|
92
100
|
server2.tool(
|
|
93
101
|
"create_entity",
|
|
94
|
-
"Create a new entity (person, trust, or company)",
|
|
102
|
+
"Create a new entity (person, trust, or company). Requires the tensor:portfolio:write scope.",
|
|
95
103
|
{
|
|
96
104
|
name: z.string().describe("Entity name"),
|
|
97
105
|
type: z.string().describe("Entity type key (e.g. 'Individual', 'Trust', 'LLC'). Must match an existing entity-types row."),
|
|
@@ -108,7 +116,7 @@ function registerAllTools(server2, api) {
|
|
|
108
116
|
);
|
|
109
117
|
server2.tool(
|
|
110
118
|
"update_entity",
|
|
111
|
-
"Update an existing entity (partial update)",
|
|
119
|
+
"Update an existing entity (partial update). Requires the tensor:portfolio:write scope.",
|
|
112
120
|
{
|
|
113
121
|
id: z.number().describe("Entity ID to update"),
|
|
114
122
|
name: z.string().optional().describe("New entity name"),
|
|
@@ -126,7 +134,7 @@ function registerAllTools(server2, api) {
|
|
|
126
134
|
);
|
|
127
135
|
server2.tool(
|
|
128
136
|
"delete_entity",
|
|
129
|
-
"Delete an entity by ID",
|
|
137
|
+
"Delete an entity by ID. Requires the tensor:portfolio:write scope.",
|
|
130
138
|
{ id: z.number().describe("Entity ID to delete") },
|
|
131
139
|
async ({ id }) => {
|
|
132
140
|
const data = await api("DELETE", `/api/entities/${id}`);
|
|
@@ -135,7 +143,7 @@ function registerAllTools(server2, api) {
|
|
|
135
143
|
);
|
|
136
144
|
server2.tool(
|
|
137
145
|
"list_entity_relationships",
|
|
138
|
-
"List all entity relationships (ownership, beneficiary, etc.)",
|
|
146
|
+
"List all entity relationships (ownership, beneficiary, etc.). Requires the tensor:portfolio:read scope.",
|
|
139
147
|
{ limit: z.number().optional(), offset: z.number().optional() },
|
|
140
148
|
async ({ limit, offset }) => {
|
|
141
149
|
const params = new URLSearchParams();
|
|
@@ -148,7 +156,7 @@ function registerAllTools(server2, api) {
|
|
|
148
156
|
);
|
|
149
157
|
server2.tool(
|
|
150
158
|
"create_entity_relationship",
|
|
151
|
-
"Create a relationship between two entities (ownership, beneficiary, trustee, etc.)",
|
|
159
|
+
"Create a relationship between two entities (ownership, beneficiary, trustee, etc.). Requires the tensor:portfolio:write scope.",
|
|
152
160
|
{
|
|
153
161
|
sourceEntityId: z.number().describe("Source entity ID (the parent/owner)"),
|
|
154
162
|
targetEntityId: z.number().describe("Target entity ID (the child/owned)"),
|
|
@@ -167,7 +175,7 @@ function registerAllTools(server2, api) {
|
|
|
167
175
|
);
|
|
168
176
|
server2.tool(
|
|
169
177
|
"update_entity_relationship",
|
|
170
|
-
"Update an entity relationship (partial update)",
|
|
178
|
+
"Update an entity relationship (partial update). Requires the tensor:portfolio:write scope.",
|
|
171
179
|
{
|
|
172
180
|
id: z.number().describe("Relationship ID"),
|
|
173
181
|
sourceEntityId: z.number().optional(),
|
|
@@ -187,7 +195,7 @@ function registerAllTools(server2, api) {
|
|
|
187
195
|
);
|
|
188
196
|
server2.tool(
|
|
189
197
|
"delete_entity_relationship",
|
|
190
|
-
"Delete an entity relationship",
|
|
198
|
+
"Delete an entity relationship. Requires the tensor:portfolio:write scope.",
|
|
191
199
|
{ id: z.number().describe("Relationship ID to delete") },
|
|
192
200
|
async ({ id }) => {
|
|
193
201
|
const data = await api("DELETE", `/api/entity-relationships/${id}`);
|
|
@@ -196,7 +204,7 @@ function registerAllTools(server2, api) {
|
|
|
196
204
|
);
|
|
197
205
|
server2.tool(
|
|
198
206
|
"list_accounts",
|
|
199
|
-
"List all accounts (brokerage, bank, retirement, etc.) in the organization",
|
|
207
|
+
"List all accounts (brokerage, bank, retirement, etc.) in the organization. Requires the tensor:portfolio:read scope.",
|
|
200
208
|
{ limit: z.number().optional(), offset: z.number().optional() },
|
|
201
209
|
async ({ limit, offset }) => {
|
|
202
210
|
const params = new URLSearchParams();
|
|
@@ -209,7 +217,7 @@ function registerAllTools(server2, api) {
|
|
|
209
217
|
);
|
|
210
218
|
server2.tool(
|
|
211
219
|
"create_account",
|
|
212
|
-
"Create a new account (brokerage, bank, retirement, etc.)",
|
|
220
|
+
"Create a new account (brokerage, bank, retirement, etc.). Requires the tensor:portfolio:write scope.",
|
|
213
221
|
{
|
|
214
222
|
name: z.string().describe("Account name"),
|
|
215
223
|
entityId: z.number().describe("Owner entity ID"),
|
|
@@ -225,7 +233,7 @@ function registerAllTools(server2, api) {
|
|
|
225
233
|
);
|
|
226
234
|
server2.tool(
|
|
227
235
|
"update_account",
|
|
228
|
-
"Update an existing account (partial update)",
|
|
236
|
+
"Update an existing account (partial update). Requires the tensor:portfolio:write scope.",
|
|
229
237
|
{
|
|
230
238
|
id: z.number().describe("Account ID to update"),
|
|
231
239
|
name: z.string().optional(),
|
|
@@ -242,7 +250,7 @@ function registerAllTools(server2, api) {
|
|
|
242
250
|
);
|
|
243
251
|
server2.tool(
|
|
244
252
|
"delete_account",
|
|
245
|
-
"Delete an account by ID",
|
|
253
|
+
"Delete an account by ID. Requires the tensor:portfolio:write scope.",
|
|
246
254
|
{ id: z.number().describe("Account ID to delete") },
|
|
247
255
|
async ({ id }) => {
|
|
248
256
|
const data = await api("DELETE", `/api/accounts/${id}`);
|
|
@@ -251,7 +259,7 @@ function registerAllTools(server2, api) {
|
|
|
251
259
|
);
|
|
252
260
|
server2.tool(
|
|
253
261
|
"list_assets",
|
|
254
|
-
"List assets (stocks, bonds, crypto, real estate, etc.). Filter server-side rather than pulling the whole catalog.",
|
|
262
|
+
"List assets (stocks, bonds, crypto, real estate, etc.). Filter server-side rather than pulling the whole catalog. Requires the tensor:portfolio:read scope.",
|
|
255
263
|
{
|
|
256
264
|
limit: z.number().optional(),
|
|
257
265
|
offset: z.number().optional(),
|
|
@@ -275,7 +283,7 @@ function registerAllTools(server2, api) {
|
|
|
275
283
|
);
|
|
276
284
|
server2.tool(
|
|
277
285
|
"get_asset",
|
|
278
|
-
"Get a single asset by ID",
|
|
286
|
+
"Get a single asset by ID. Requires the tensor:portfolio:read scope.",
|
|
279
287
|
{ id: z.number().describe("Asset ID") },
|
|
280
288
|
async ({ id }) => {
|
|
281
289
|
const data = await api("GET", `/api/assets/${id}`);
|
|
@@ -284,7 +292,7 @@ function registerAllTools(server2, api) {
|
|
|
284
292
|
);
|
|
285
293
|
server2.tool(
|
|
286
294
|
"create_asset",
|
|
287
|
-
"Create a new asset (stock, bond, crypto, real estate, etc.). To make an asset price itself automatically, set tickerSymbol to a market quote symbol \u2014 find one first with search_market_quotes, and pass verifyQuote+syncPrice so a bad symbol fails here instead of becoming an asset that silently never prices.",
|
|
295
|
+
"Create a new asset (stock, bond, crypto, real estate, etc.). To make an asset price itself automatically, set tickerSymbol to a market quote symbol \u2014 find one first with search_market_quotes, and pass verifyQuote+syncPrice so a bad symbol fails here instead of becoming an asset that silently never prices. Requires the tensor:portfolio:write scope.",
|
|
288
296
|
{
|
|
289
297
|
name: z.string().describe("Asset name"),
|
|
290
298
|
assetClass: z.string().describe("Asset class key (e.g. 'Equity', 'Bond', 'Crypto', 'Real Estate'). Must match an existing asset-classes row."),
|
|
@@ -307,7 +315,7 @@ function registerAllTools(server2, api) {
|
|
|
307
315
|
);
|
|
308
316
|
server2.tool(
|
|
309
317
|
"update_asset",
|
|
310
|
-
"Update an existing asset (partial update). Set tickerSymbol to link or relink the asset to a market quote.",
|
|
318
|
+
"Update an existing asset (partial update). Set tickerSymbol to link or relink the asset to a market quote. Requires the tensor:portfolio:write scope.",
|
|
311
319
|
{
|
|
312
320
|
id: z.number().describe("Asset ID to update"),
|
|
313
321
|
name: z.string().optional(),
|
|
@@ -331,7 +339,7 @@ function registerAllTools(server2, api) {
|
|
|
331
339
|
);
|
|
332
340
|
server2.tool(
|
|
333
341
|
"delete_asset",
|
|
334
|
-
"Delete an asset by ID",
|
|
342
|
+
"Delete an asset by ID. Requires the tensor:portfolio:write scope.",
|
|
335
343
|
{ id: z.number().describe("Asset ID to delete") },
|
|
336
344
|
async ({ id }) => {
|
|
337
345
|
const data = await api("DELETE", `/api/assets/${id}`);
|
|
@@ -340,7 +348,7 @@ function registerAllTools(server2, api) {
|
|
|
340
348
|
);
|
|
341
349
|
server2.tool(
|
|
342
350
|
"list_asset_prices",
|
|
343
|
-
"List historical prices for an asset",
|
|
351
|
+
"List historical prices for an asset. Requires the tensor:portfolio:read scope.",
|
|
344
352
|
{
|
|
345
353
|
id: z.number().describe("Asset ID"),
|
|
346
354
|
limit: z.number().optional(),
|
|
@@ -357,7 +365,7 @@ function registerAllTools(server2, api) {
|
|
|
357
365
|
);
|
|
358
366
|
server2.tool(
|
|
359
367
|
"update_asset_price",
|
|
360
|
-
"Record a new price for an asset",
|
|
368
|
+
"Record a new price for an asset. Requires the tensor:portfolio:write scope.",
|
|
361
369
|
{
|
|
362
370
|
id: z.number().describe("Asset ID"),
|
|
363
371
|
price: z.number().describe("New price value"),
|
|
@@ -372,7 +380,7 @@ function registerAllTools(server2, api) {
|
|
|
372
380
|
);
|
|
373
381
|
server2.tool(
|
|
374
382
|
"list_positions",
|
|
375
|
-
"List positions (holdings) across accounts. Filter server-side instead of pulling every row \u2014 and for totals like net worth use get_portfolio_summary rather than summing these yourself.",
|
|
383
|
+
"List positions (holdings) across accounts. Filter server-side instead of pulling every row \u2014 and for totals like net worth use get_portfolio_summary rather than summing these yourself. Requires the tensor:portfolio:read scope.",
|
|
376
384
|
{
|
|
377
385
|
limit: z.number().optional(),
|
|
378
386
|
offset: z.number().optional(),
|
|
@@ -402,7 +410,7 @@ function registerAllTools(server2, api) {
|
|
|
402
410
|
);
|
|
403
411
|
server2.tool(
|
|
404
412
|
"create_position",
|
|
405
|
-
"Create a new position (a holding of an asset, owned by an entity, optionally in an account). Two shapes: a UNITIZED holding (shares/units \u2014 send quantity + averageCost) or a fund CAPITAL ACCOUNT (a fund LP interest, which has no units because the GP reports a balance \u2014 send costBasis instead). `costBasis` is the ONLY switch that makes a capital account; there is no inference from a missing quantity. Get the shape right at open: create_transaction refuses unitized types on a capital account, and the fund performance figures (paid-in, DPI/TVPI, IRR) exist only for one.",
|
|
413
|
+
"Create a new position (a holding of an asset, owned by an entity, optionally in an account). Two shapes: a UNITIZED holding (shares/units \u2014 send quantity + averageCost) or a fund CAPITAL ACCOUNT (a fund LP interest, which has no units because the GP reports a balance \u2014 send costBasis instead). `costBasis` is the ONLY switch that makes a capital account; there is no inference from a missing quantity. Get the shape right at open: create_transaction refuses unitized types on a capital account, and the fund performance figures (paid-in, DPI/TVPI, IRR) exist only for one. Requires the tensor:portfolio:write scope.",
|
|
406
414
|
{
|
|
407
415
|
entityId: z.number().describe("Owner entity ID"),
|
|
408
416
|
label: z.string().describe("Display label for this position (e.g. 'AAPL @ Schwab', 'Brooklyn rental')"),
|
|
@@ -429,7 +437,7 @@ function registerAllTools(server2, api) {
|
|
|
429
437
|
);
|
|
430
438
|
server2.tool(
|
|
431
439
|
"update_position",
|
|
432
|
-
"Update an existing position (partial update)",
|
|
440
|
+
"Update an existing position (partial update). Requires the tensor:portfolio:write scope.",
|
|
433
441
|
{
|
|
434
442
|
id: z.number().describe("Position ID to update"),
|
|
435
443
|
entityId: z.number().optional(),
|
|
@@ -454,7 +462,7 @@ function registerAllTools(server2, api) {
|
|
|
454
462
|
);
|
|
455
463
|
server2.tool(
|
|
456
464
|
"delete_position",
|
|
457
|
-
"PERMANENTLY delete a position and everything hanging off it, in one transaction and with no undo: its ENTIRE transaction ledger, its whole valuation-event history, its loan or fund terms, its relations to other positions, and its file/todo attachments. There is no soft delete and no restore. Deleting is NOT how you record an exit \u2014 a sold-out holding should be closed with sell_all_position, which keeps the history and the realized gain. Reach for this only to remove a position that should never have existed, and confirm with the user first.",
|
|
465
|
+
"PERMANENTLY delete a position and everything hanging off it, in one transaction and with no undo: its ENTIRE transaction ledger, its whole valuation-event history, its loan or fund terms, its relations to other positions, and its file/todo attachments. There is no soft delete and no restore. Deleting is NOT how you record an exit \u2014 a sold-out holding should be closed with sell_all_position, which keeps the history and the realized gain. Reach for this only to remove a position that should never have existed, and confirm with the user first. Requires the tensor:portfolio:write scope.",
|
|
458
466
|
{ id: z.number().describe("Position ID to delete") },
|
|
459
467
|
async ({ id }) => {
|
|
460
468
|
const data = await api("DELETE", `/api/positions/${id}`);
|
|
@@ -463,7 +471,7 @@ function registerAllTools(server2, api) {
|
|
|
463
471
|
);
|
|
464
472
|
server2.tool(
|
|
465
473
|
"sell_all_position",
|
|
466
|
-
"Close/sell all of a position (creates a sell transaction)",
|
|
474
|
+
"Close/sell all of a position (creates a sell transaction). Requires the tensor:portfolio:write scope.",
|
|
467
475
|
{
|
|
468
476
|
id: z.number().describe("Position ID to sell"),
|
|
469
477
|
price: z.number().optional().describe("Sale price per unit"),
|
|
@@ -480,7 +488,7 @@ function registerAllTools(server2, api) {
|
|
|
480
488
|
);
|
|
481
489
|
server2.tool(
|
|
482
490
|
"list_position_events",
|
|
483
|
-
"List valuation events for a specific position (append-only history)",
|
|
491
|
+
"List valuation events for a specific position (append-only history). Requires the tensor:portfolio:read scope.",
|
|
484
492
|
{
|
|
485
493
|
id: z.number().describe("Position ID"),
|
|
486
494
|
limit: z.number().optional(),
|
|
@@ -497,7 +505,7 @@ function registerAllTools(server2, api) {
|
|
|
497
505
|
);
|
|
498
506
|
server2.tool(
|
|
499
507
|
"list_events",
|
|
500
|
-
"List valuation events across all positions in the organization",
|
|
508
|
+
"List valuation events across all positions in the organization. Requires the tensor:portfolio:read scope.",
|
|
501
509
|
{ limit: z.number().optional(), offset: z.number().optional() },
|
|
502
510
|
async ({ limit, offset }) => {
|
|
503
511
|
const params = new URLSearchParams();
|
|
@@ -510,7 +518,7 @@ function registerAllTools(server2, api) {
|
|
|
510
518
|
);
|
|
511
519
|
server2.tool(
|
|
512
520
|
"list_position_relations",
|
|
513
|
-
"List all position relations (linked/related positions)",
|
|
521
|
+
"List all position relations (linked/related positions). Requires the tensor:portfolio:read scope.",
|
|
514
522
|
{ limit: z.number().optional(), offset: z.number().optional() },
|
|
515
523
|
async ({ limit, offset }) => {
|
|
516
524
|
const params = new URLSearchParams();
|
|
@@ -523,7 +531,7 @@ function registerAllTools(server2, api) {
|
|
|
523
531
|
);
|
|
524
532
|
server2.tool(
|
|
525
533
|
"create_position_relation",
|
|
526
|
-
"Link two positions together",
|
|
534
|
+
"Link two positions together. Requires the tensor:portfolio:write scope.",
|
|
527
535
|
{
|
|
528
536
|
positionId: z.number().describe("First position ID"),
|
|
529
537
|
relatedPositionId: z.number().describe("Related position ID")
|
|
@@ -535,7 +543,7 @@ function registerAllTools(server2, api) {
|
|
|
535
543
|
);
|
|
536
544
|
server2.tool(
|
|
537
545
|
"delete_position_relation",
|
|
538
|
-
"Remove a position relation",
|
|
546
|
+
"Remove a position relation. Requires the tensor:portfolio:write scope.",
|
|
539
547
|
{ id: z.number().describe("Position relation ID to delete") },
|
|
540
548
|
async ({ id }) => {
|
|
541
549
|
const data = await api("DELETE", `/api/position-relations/${id}`);
|
|
@@ -544,7 +552,7 @@ function registerAllTools(server2, api) {
|
|
|
544
552
|
);
|
|
545
553
|
server2.tool(
|
|
546
554
|
"list_transactions",
|
|
547
|
-
"List transactions (buys, sells, dividends, fees, etc.). Filter by position or date range server-side.",
|
|
555
|
+
"List transactions (buys, sells, dividends, fees, etc.). Filter by position or date range server-side. Requires the tensor:portfolio:read scope.",
|
|
548
556
|
{
|
|
549
557
|
limit: z.number().optional(),
|
|
550
558
|
offset: z.number().optional(),
|
|
@@ -568,7 +576,7 @@ function registerAllTools(server2, api) {
|
|
|
568
576
|
);
|
|
569
577
|
server2.tool(
|
|
570
578
|
"create_transaction",
|
|
571
|
-
"Append a transaction to a position's ledger (buy, sell, dividend, fee, etc.). THE LEDGER IS APPEND-ONLY AND THIS WRITE IS PERMANENT. There is no way to edit or delete a transaction \u2014 position state is a non-invertible fold over the ledger, so a destructive edit would corrupt cost basis. A mistake is corrected by posting a COMPENSATING entry of the opposite type (a wrong buy is offset by a sell, a wrong capital_call by a return_of_capital), which leaves both rows visible in history. Get it right the first time, and confirm anything you are unsure of with the user before posting.",
|
|
579
|
+
"Append a transaction to a position's ledger (buy, sell, dividend, fee, etc.). THE LEDGER IS APPEND-ONLY AND THIS WRITE IS PERMANENT. There is no way to edit or delete a transaction \u2014 position state is a non-invertible fold over the ledger, so a destructive edit would corrupt cost basis. A mistake is corrected by posting a COMPENSATING entry of the opposite type (a wrong buy is offset by a sell, a wrong capital_call by a return_of_capital), which leaves both rows visible in history. Get it right the first time, and confirm anything you are unsure of with the user before posting. Requires the tensor:portfolio:write scope.",
|
|
572
580
|
{
|
|
573
581
|
positionId: z.number().describe("Position ID this transaction belongs to"),
|
|
574
582
|
// This string is what an LLM reads to pick a type. When the loan types
|
|
@@ -598,7 +606,7 @@ function registerAllTools(server2, api) {
|
|
|
598
606
|
);
|
|
599
607
|
server2.tool(
|
|
600
608
|
"list_institutions",
|
|
601
|
-
"List all institutions (banks, brokers, custodians)",
|
|
609
|
+
"List all institutions (banks, brokers, custodians). Requires the tensor:reference:read scope.",
|
|
602
610
|
{},
|
|
603
611
|
async () => {
|
|
604
612
|
const data = await api("GET", "/api/institutions");
|
|
@@ -607,7 +615,7 @@ function registerAllTools(server2, api) {
|
|
|
607
615
|
);
|
|
608
616
|
server2.tool(
|
|
609
617
|
"create_institution",
|
|
610
|
-
"Create a new institution",
|
|
618
|
+
"Create a new institution. Requires the tensor:reference:write scope.",
|
|
611
619
|
{
|
|
612
620
|
name: z.string().describe("Institution name"),
|
|
613
621
|
notes: z.string().optional()
|
|
@@ -619,7 +627,7 @@ function registerAllTools(server2, api) {
|
|
|
619
627
|
);
|
|
620
628
|
server2.tool(
|
|
621
629
|
"update_institution",
|
|
622
|
-
"Update an institution",
|
|
630
|
+
"Update an institution. Requires the tensor:reference:write scope.",
|
|
623
631
|
{
|
|
624
632
|
id: z.number().describe("Institution ID"),
|
|
625
633
|
name: z.string().optional(),
|
|
@@ -632,7 +640,7 @@ function registerAllTools(server2, api) {
|
|
|
632
640
|
);
|
|
633
641
|
server2.tool(
|
|
634
642
|
"delete_institution",
|
|
635
|
-
"Delete an institution",
|
|
643
|
+
"Delete an institution. Requires the tensor:reference:write scope.",
|
|
636
644
|
{ id: z.number().describe("Institution ID to delete") },
|
|
637
645
|
async ({ id }) => {
|
|
638
646
|
const data = await api("DELETE", `/api/institutions/${id}`);
|
|
@@ -641,7 +649,7 @@ function registerAllTools(server2, api) {
|
|
|
641
649
|
);
|
|
642
650
|
server2.tool(
|
|
643
651
|
"list_entity_types",
|
|
644
|
-
"List all entity types (Individual, Trust, Corporation, etc.)",
|
|
652
|
+
"List all entity types (Individual, Trust, Corporation, etc.). Requires the tensor:reference:read scope.",
|
|
645
653
|
{},
|
|
646
654
|
async () => {
|
|
647
655
|
const data = await api("GET", "/api/entity-types");
|
|
@@ -650,7 +658,7 @@ function registerAllTools(server2, api) {
|
|
|
650
658
|
);
|
|
651
659
|
server2.tool(
|
|
652
660
|
"create_entity_type",
|
|
653
|
-
"Create a new entity type catalog entry",
|
|
661
|
+
"Create a new entity type catalog entry. Requires the tensor:reference:write scope.",
|
|
654
662
|
{
|
|
655
663
|
key: z.string().describe("Stable key referenced by entities.type (e.g. 'Individual', 'Trust')"),
|
|
656
664
|
label: z.string().describe("Human-readable display label"),
|
|
@@ -663,7 +671,7 @@ function registerAllTools(server2, api) {
|
|
|
663
671
|
);
|
|
664
672
|
server2.tool(
|
|
665
673
|
"update_entity_type",
|
|
666
|
-
"Update an entity type catalog entry (partial update)",
|
|
674
|
+
"Update an entity type catalog entry (partial update). Requires the tensor:reference:write scope.",
|
|
667
675
|
{
|
|
668
676
|
id: z.number().describe("Entity type ID"),
|
|
669
677
|
key: z.string().optional(),
|
|
@@ -677,7 +685,7 @@ function registerAllTools(server2, api) {
|
|
|
677
685
|
);
|
|
678
686
|
server2.tool(
|
|
679
687
|
"delete_entity_type",
|
|
680
|
-
"Delete an entity type",
|
|
688
|
+
"Delete an entity type. Requires the tensor:reference:write scope.",
|
|
681
689
|
{ id: z.number().describe("Entity type ID to delete") },
|
|
682
690
|
async ({ id }) => {
|
|
683
691
|
const data = await api("DELETE", `/api/entity-types/${id}`);
|
|
@@ -686,7 +694,7 @@ function registerAllTools(server2, api) {
|
|
|
686
694
|
);
|
|
687
695
|
server2.tool(
|
|
688
696
|
"list_role_types",
|
|
689
|
-
"List all role types (Owner, Beneficiary, Trustee, etc.)",
|
|
697
|
+
"List all role types (Owner, Beneficiary, Trustee, etc.). Requires the tensor:reference:read scope.",
|
|
690
698
|
{},
|
|
691
699
|
async () => {
|
|
692
700
|
const data = await api("GET", "/api/role-types");
|
|
@@ -695,7 +703,7 @@ function registerAllTools(server2, api) {
|
|
|
695
703
|
);
|
|
696
704
|
server2.tool(
|
|
697
705
|
"create_role_type",
|
|
698
|
-
"Create a new role type catalog entry",
|
|
706
|
+
"Create a new role type catalog entry. Requires the tensor:reference:write scope.",
|
|
699
707
|
{
|
|
700
708
|
key: z.string().describe("Stable key (e.g. 'Owner', 'Trustee', 'Beneficiary')"),
|
|
701
709
|
label: z.string().describe("Human-readable display label"),
|
|
@@ -708,7 +716,7 @@ function registerAllTools(server2, api) {
|
|
|
708
716
|
);
|
|
709
717
|
server2.tool(
|
|
710
718
|
"update_role_type",
|
|
711
|
-
"Update a role type catalog entry (partial update)",
|
|
719
|
+
"Update a role type catalog entry (partial update). Requires the tensor:reference:write scope.",
|
|
712
720
|
{
|
|
713
721
|
id: z.number().describe("Role type ID"),
|
|
714
722
|
key: z.string().optional(),
|
|
@@ -722,7 +730,7 @@ function registerAllTools(server2, api) {
|
|
|
722
730
|
);
|
|
723
731
|
server2.tool(
|
|
724
732
|
"delete_role_type",
|
|
725
|
-
"Delete a role type",
|
|
733
|
+
"Delete a role type. Requires the tensor:reference:write scope.",
|
|
726
734
|
{ id: z.number().describe("Role type ID to delete") },
|
|
727
735
|
async ({ id }) => {
|
|
728
736
|
const data = await api("DELETE", `/api/role-types/${id}`);
|
|
@@ -731,7 +739,7 @@ function registerAllTools(server2, api) {
|
|
|
731
739
|
);
|
|
732
740
|
server2.tool(
|
|
733
741
|
"list_account_types",
|
|
734
|
-
"List all account types (Brokerage, Checking, IRA, 401k, etc.)",
|
|
742
|
+
"List all account types (Brokerage, Checking, IRA, 401k, etc.). Requires the tensor:reference:read scope.",
|
|
735
743
|
{},
|
|
736
744
|
async () => {
|
|
737
745
|
const data = await api("GET", "/api/account-types");
|
|
@@ -740,7 +748,7 @@ function registerAllTools(server2, api) {
|
|
|
740
748
|
);
|
|
741
749
|
server2.tool(
|
|
742
750
|
"create_account_type",
|
|
743
|
-
"Create a new account type catalog entry",
|
|
751
|
+
"Create a new account type catalog entry. Requires the tensor:reference:write scope.",
|
|
744
752
|
{
|
|
745
753
|
key: z.string().describe("Stable key referenced by accounts.accountType (e.g. 'Brokerage', 'Bank')"),
|
|
746
754
|
label: z.string().describe("Human-readable display label"),
|
|
@@ -753,7 +761,7 @@ function registerAllTools(server2, api) {
|
|
|
753
761
|
);
|
|
754
762
|
server2.tool(
|
|
755
763
|
"update_account_type",
|
|
756
|
-
"Update an account type catalog entry (partial update)",
|
|
764
|
+
"Update an account type catalog entry (partial update). Requires the tensor:reference:write scope.",
|
|
757
765
|
{
|
|
758
766
|
id: z.number().describe("Account type ID"),
|
|
759
767
|
key: z.string().optional(),
|
|
@@ -767,7 +775,7 @@ function registerAllTools(server2, api) {
|
|
|
767
775
|
);
|
|
768
776
|
server2.tool(
|
|
769
777
|
"delete_account_type",
|
|
770
|
-
"Delete an account type",
|
|
778
|
+
"Delete an account type. Requires the tensor:reference:write scope.",
|
|
771
779
|
{ id: z.number().describe("Account type ID to delete") },
|
|
772
780
|
async ({ id }) => {
|
|
773
781
|
const data = await api("DELETE", `/api/account-types/${id}`);
|
|
@@ -776,7 +784,7 @@ function registerAllTools(server2, api) {
|
|
|
776
784
|
);
|
|
777
785
|
server2.tool(
|
|
778
786
|
"list_asset_classes",
|
|
779
|
-
"List all asset classes (Equities, Fixed Income, Real Estate, etc.)",
|
|
787
|
+
"List all asset classes (Equities, Fixed Income, Real Estate, etc.). Requires the tensor:reference:read scope.",
|
|
780
788
|
{},
|
|
781
789
|
async () => {
|
|
782
790
|
const data = await api("GET", "/api/asset-classes");
|
|
@@ -785,7 +793,7 @@ function registerAllTools(server2, api) {
|
|
|
785
793
|
);
|
|
786
794
|
server2.tool(
|
|
787
795
|
"create_asset_class",
|
|
788
|
-
"Create a new asset class catalog entry",
|
|
796
|
+
"Create a new asset class catalog entry. Requires the tensor:reference:write scope.",
|
|
789
797
|
{
|
|
790
798
|
key: z.string().describe("Stable key referenced by assets.assetClass (e.g. 'Equity', 'Real Estate')"),
|
|
791
799
|
label: z.string().describe("Human-readable display label"),
|
|
@@ -799,7 +807,7 @@ function registerAllTools(server2, api) {
|
|
|
799
807
|
);
|
|
800
808
|
server2.tool(
|
|
801
809
|
"update_asset_class",
|
|
802
|
-
"Update an asset class catalog entry (partial update)",
|
|
810
|
+
"Update an asset class catalog entry (partial update). Requires the tensor:reference:write scope.",
|
|
803
811
|
{
|
|
804
812
|
id: z.number().describe("Asset class ID"),
|
|
805
813
|
key: z.string().optional(),
|
|
@@ -814,7 +822,7 @@ function registerAllTools(server2, api) {
|
|
|
814
822
|
);
|
|
815
823
|
server2.tool(
|
|
816
824
|
"delete_asset_class",
|
|
817
|
-
"Delete an asset class",
|
|
825
|
+
"Delete an asset class. Requires the tensor:reference:write scope.",
|
|
818
826
|
{ id: z.number().describe("Asset class ID to delete") },
|
|
819
827
|
async ({ id }) => {
|
|
820
828
|
const data = await api("DELETE", `/api/asset-classes/${id}`);
|
|
@@ -874,7 +882,7 @@ function registerAllTools(server2, api) {
|
|
|
874
882
|
);
|
|
875
883
|
server2.tool(
|
|
876
884
|
"get_portfolio_summary",
|
|
877
|
-
"Net worth, total assets, total liabilities, cost basis and unrealized P/L for the organization, computed server-side in USD \u2014 optionally broken down by entity, account, asset class or currency. USE THIS instead of listing positions and adding them up: the underlying math has real subtleties (a position's stored value is a snapshot rather than a market value, liabilities are sign-mirrored, cost basis has a fallback that must not apply to priced positions) and this endpoint folds exactly the same chain the Tensor dashboard shows. The `coverage` field reports how much of the portfolio the numbers actually cover \u2014 check it before quoting a total as exact.",
|
|
885
|
+
"Net worth, total assets, total liabilities, cost basis and unrealized P/L for the organization, computed server-side in USD \u2014 optionally broken down by entity, account, asset class or currency. USE THIS instead of listing positions and adding them up: the underlying math has real subtleties (a position's stored value is a snapshot rather than a market value, liabilities are sign-mirrored, cost basis has a fallback that must not apply to priced positions) and this endpoint folds exactly the same chain the Tensor dashboard shows. The `coverage` field reports how much of the portfolio the numbers actually cover \u2014 check it before quoting a total as exact. Requires the tensor:portfolio:read scope.",
|
|
878
886
|
{
|
|
879
887
|
groupBy: z.string().optional().describe("Comma-separated breakdowns: entity, account, assetClass, currency. Omit for headline totals only."),
|
|
880
888
|
scope: z.enum(["dashboard", "all"]).optional().describe("'dashboard' (default) counts only entities marked for portfolio display, matching the Tensor dashboard. 'all' counts every entity."),
|
|
@@ -898,7 +906,7 @@ function registerAllTools(server2, api) {
|
|
|
898
906
|
);
|
|
899
907
|
server2.tool(
|
|
900
908
|
"search_market_quotes",
|
|
901
|
-
"Search the price providers (Yahoo Finance for listed instruments, CoinGecko for crypto) for market quotes matching a free-text query. Returns candidate symbols with their name and exchange. The `symbol` of the result you pick is what goes into an asset's tickerSymbol field (returned as both tickerSymbol and fmpSymbol) to make it price automatically. Always search rather than guessing a ticker \u2014 exchange suffixes and crypto ids are not predictable.",
|
|
909
|
+
"Search the price providers (Yahoo Finance for listed instruments, CoinGecko for crypto) for market quotes matching a free-text query. Returns candidate symbols with their name and exchange. The `symbol` of the result you pick is what goes into an asset's tickerSymbol field (returned as both tickerSymbol and fmpSymbol) to make it price automatically. Always search rather than guessing a ticker \u2014 exchange suffixes and crypto ids are not predictable. Requires the tensor:portfolio:read scope.",
|
|
902
910
|
{
|
|
903
911
|
q: z.string().describe("Free-text query \u2014 a company name, ticker, or coin name"),
|
|
904
912
|
limit: z.number().optional().describe("Max candidates to return. Default 10, max 25.")
|
|
@@ -912,7 +920,7 @@ function registerAllTools(server2, api) {
|
|
|
912
920
|
);
|
|
913
921
|
server2.tool(
|
|
914
922
|
"verify_market_quote",
|
|
915
|
-
"Resolve a single market-quote symbol to a live price WITHOUT writing anything. Use this to confirm a symbol is real before linking it to an asset. Returns `corrected: true` when the provider answered on a different spelling than the one asked for \u2014 store the returned `symbol`, not the one you sent.",
|
|
923
|
+
"Resolve a single market-quote symbol to a live price WITHOUT writing anything. Use this to confirm a symbol is real before linking it to an asset. Returns `corrected: true` when the provider answered on a different spelling than the one asked for \u2014 store the returned `symbol`, not the one you sent. Requires the tensor:portfolio:read scope.",
|
|
916
924
|
{ symbol: z.string().describe("Provider symbol to check, e.g. 'BRK-B', 'BTC-USD', or 'CG:official-trump'") },
|
|
917
925
|
async ({ symbol }) => {
|
|
918
926
|
const data = await api("GET", `/api/v1/prices/quote?symbol=${encodeURIComponent(symbol)}`);
|
|
@@ -921,7 +929,7 @@ function registerAllTools(server2, api) {
|
|
|
921
929
|
);
|
|
922
930
|
server2.tool(
|
|
923
931
|
"sync_prices",
|
|
924
|
-
"Trigger a price sync: fetch current quotes for the organization's linked assets and record them, revaluing every position that holds them. Omit assetIds to sync the whole catalog, or pass a subset. This WRITES \u2014 each synced asset gets a price-history row and its positions are repriced. The result reports what synced, what was skipped for having no symbol, and per-symbol failure reasons.",
|
|
932
|
+
"Trigger a price sync: fetch current quotes for the organization's linked assets and record them, revaluing every position that holds them. Omit assetIds to sync the whole catalog, or pass a subset. This WRITES \u2014 each synced asset gets a price-history row and its positions are repriced. The result reports what synced, what was skipped for having no symbol, and per-symbol failure reasons. Requires the tensor:portfolio:write scope.",
|
|
925
933
|
{
|
|
926
934
|
assetIds: z.array(z.number()).optional().describe("Only sync these asset IDs. Omit to sync every linked asset in the organization.")
|
|
927
935
|
},
|
|
@@ -932,7 +940,7 @@ function registerAllTools(server2, api) {
|
|
|
932
940
|
);
|
|
933
941
|
server2.tool(
|
|
934
942
|
"sync_asset_price",
|
|
935
|
-
"Trigger a price sync for one asset by ID. Fails if the asset has no price-provider symbol linked. Use sync_prices for bulk.",
|
|
943
|
+
"Trigger a price sync for one asset by ID. Fails if the asset has no price-provider symbol linked. Use sync_prices for bulk. Requires the tensor:portfolio:write scope.",
|
|
936
944
|
{ id: z.number().describe("Asset ID to reprice") },
|
|
937
945
|
async ({ id }) => {
|
|
938
946
|
const data = await api("POST", `/api/v1/prices/sync/${id}`);
|
|
@@ -941,7 +949,7 @@ function registerAllTools(server2, api) {
|
|
|
941
949
|
);
|
|
942
950
|
server2.tool(
|
|
943
951
|
"list_changes",
|
|
944
|
-
"What changed in this organization's data since a timestamp \u2014 creates, updates AND deletes, across both the CRUD routes and applied data batches. Use this to catch up incrementally instead of re-listing every table. Check `coverage.complete`: when false, the requested `since` predates the audit history and the delta cannot be trusted \u2014 do a full read instead. Resume the next poll from the returned `until`.",
|
|
952
|
+
"What changed in this organization's data since a timestamp \u2014 creates, updates AND deletes, across both the CRUD routes and applied data batches. Use this to catch up incrementally instead of re-listing every table. Check `coverage.complete`: when false, the requested `since` predates the audit history and the delta cannot be trusted \u2014 do a full read instead. Resume the next poll from the returned `until`. Requires the tensor:portfolio:read scope.",
|
|
945
953
|
{
|
|
946
954
|
since: z.number().optional().describe("Epoch-ms lower bound (exclusive). Omit or 0 for everything on record."),
|
|
947
955
|
limit: z.number().optional().describe("Max changes per page. Default 500."),
|
|
@@ -959,7 +967,7 @@ function registerAllTools(server2, api) {
|
|
|
959
967
|
);
|
|
960
968
|
server2.tool(
|
|
961
969
|
"search_records",
|
|
962
|
-
"Site-wide ranked search across every record type at once \u2014 entities, institutions, accounts, positions, assets, transactions, files, todos and
|
|
970
|
+
"Site-wide ranked search across every record type at once \u2014 entities, institutions, accounts, positions, assets, transactions, files, todos, ideas, bookmarks and parked tabs. Reference ids resolve directly: 'TSK-12' (todo), 'AS002' (asset), 'T042' (transaction), 'BMK-9' (bookmark). Lanes are scope-gated per key: each record type requires that domain's read scope (tensor:portfolio:read for the five ledger types, reference:read for institutions, files/todos/ideas/bookmarks/tabs:read for theirs). THE TAB LANE'S UNIT IS A TAB, NOT A GROUP \u2014 you search a title and get the parked page, though the thing you can restore or delete is its group. Memos are the one record type NO key reaches: the lane exists and no scope opens it, because memos are session-only. Lanes the key does not cover are silently omitted \u2014 the result is your slice of the org, not evidence the rest is empty \u2014 and a key covering no lane at all gets 403. Empty q returns no hits. Not for market tickers: that is search_market_quotes.",
|
|
963
971
|
{
|
|
964
972
|
q: z.string().describe("The query. Title, body and reference-id lanes, one ranking; short and literal works best."),
|
|
965
973
|
types: z.array(z.enum(SEARCH_RECORD_TYPES_MIRROR)).optional().describe("Restrict to these record types. Omit for all \u2014 transactions are excluded from the default set unless the query is a T-ref or you name them here explicitly. 'memo' is spelled here because it is one of Tensor's record types, not because a key can search it: naming it adds nothing, and naming it alone is the no-lane 403."),
|
|
@@ -1825,6 +1833,223 @@ function registerAllTools(server2, api) {
|
|
|
1825
1833
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1826
1834
|
}
|
|
1827
1835
|
);
|
|
1836
|
+
server2.tool(
|
|
1837
|
+
"list_bookmarks",
|
|
1838
|
+
"List filed bookmarks, newest first. `folderId` is THREE-VALUED and the third value is the one that is easy to lose: a positive integer asks for one folder, the string 'none' asks for the UNFILED (folderId is null \u2014 a resting state, not an error), and omitting it asks for everything. Sending 'none' as absent turns an Unfiled view into the whole library. The response is FLAT \u2014 no folder is hydrated into a row \u2014 so read the tree with list_bookmark_folders and join on each row's folderId. Requires the tensor:bookmarks:read scope.",
|
|
1839
|
+
{
|
|
1840
|
+
limit: z.number().optional().describe("Max results. Default 500."),
|
|
1841
|
+
offset: z.number().optional().describe("Pagination offset"),
|
|
1842
|
+
folderId: z.union([z.number(), z.literal("none")]).optional().describe("One folder by id, or 'none' for the unfiled. Omit for every bookmark."),
|
|
1843
|
+
q: z.string().optional().describe("Case-insensitive substring over title, url and site name"),
|
|
1844
|
+
trash: z.boolean().optional().describe("true = the Trash instead of the live library")
|
|
1845
|
+
},
|
|
1846
|
+
async ({ limit, offset, folderId, q, trash }) => {
|
|
1847
|
+
const params = new URLSearchParams();
|
|
1848
|
+
if (limit) params.set("limit", String(limit));
|
|
1849
|
+
if (offset) params.set("offset", String(offset));
|
|
1850
|
+
if (folderId !== void 0) params.set("folderId", String(folderId));
|
|
1851
|
+
if (q) params.set("q", q);
|
|
1852
|
+
if (trash) params.set("trash", "1");
|
|
1853
|
+
const qs = params.toString();
|
|
1854
|
+
const data = await api("GET", `/api/bookmarks${qs ? `?${qs}` : ""}`);
|
|
1855
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1856
|
+
}
|
|
1857
|
+
);
|
|
1858
|
+
server2.tool(
|
|
1859
|
+
"get_bookmark",
|
|
1860
|
+
"Get one bookmark. `normalizedUrl` beside the raw url is what duplicate detection compares \u2014 it is derived server-side and cannot be written. Requires the tensor:bookmarks:read scope.",
|
|
1861
|
+
{ id: z.number().describe("Bookmark ID") },
|
|
1862
|
+
async ({ id }) => {
|
|
1863
|
+
const data = await api("GET", `/api/bookmarks/${id}`);
|
|
1864
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1865
|
+
}
|
|
1866
|
+
);
|
|
1867
|
+
server2.tool(
|
|
1868
|
+
"create_bookmark",
|
|
1869
|
+
"File a bookmark. Only `url` is required; leaving `folderId` off files it as UNFILED, which is a resting state rather than an incomplete one \u2014 do not invent a folder to put it in. A DUPLICATE IS FLAGGED, NOT REFUSED: if the same page was saved before, the row is still created and the response carries `duplicateOf` naming the earlier one, so you can offer to open that instead. Requires the tensor:bookmarks:write scope.",
|
|
1870
|
+
{
|
|
1871
|
+
url: z.string().describe("The page URL (max 2048 chars)"),
|
|
1872
|
+
title: z.string().optional().describe("Title (max 1024 chars)"),
|
|
1873
|
+
folderId: z.number().optional().describe("File it into this folder. Omit for unfiled."),
|
|
1874
|
+
excerpt: z.string().optional().describe("Page excerpt (og:description), max 4096"),
|
|
1875
|
+
siteName: z.string().optional().describe("Site display name (og:site_name)"),
|
|
1876
|
+
faviconUrl: z.string().optional().describe("Favicon URL \u2014 kept remote, never mirrored into storage"),
|
|
1877
|
+
thumbnailUrl: z.string().optional().describe("Preview image URL \u2014 kept remote")
|
|
1878
|
+
},
|
|
1879
|
+
async (params) => {
|
|
1880
|
+
const data = await api("POST", "/api/bookmarks", params);
|
|
1881
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1882
|
+
}
|
|
1883
|
+
);
|
|
1884
|
+
server2.tool(
|
|
1885
|
+
"update_bookmark",
|
|
1886
|
+
"Edit a bookmark. Every field is optional and only what you send changes. Pass folderId as null to UNFILE it \u2014 omitting the field leaves it where it is. Requires the tensor:bookmarks:write scope.",
|
|
1887
|
+
{
|
|
1888
|
+
id: z.number().describe("Bookmark ID"),
|
|
1889
|
+
url: z.string().optional().describe("Replacement URL"),
|
|
1890
|
+
title: z.string().nullable().optional().describe("Replacement title"),
|
|
1891
|
+
folderId: z.number().nullable().optional().describe("Move to this folder, or null to unfile"),
|
|
1892
|
+
excerpt: z.string().nullable().optional().describe("Replacement excerpt"),
|
|
1893
|
+
siteName: z.string().nullable().optional().describe("Replacement site name"),
|
|
1894
|
+
faviconUrl: z.string().nullable().optional().describe("Replacement favicon URL"),
|
|
1895
|
+
thumbnailUrl: z.string().nullable().optional().describe("Replacement preview image URL")
|
|
1896
|
+
},
|
|
1897
|
+
async ({ id, ...body }) => {
|
|
1898
|
+
const data = await api("PATCH", `/api/bookmarks/${id}`, body);
|
|
1899
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1900
|
+
}
|
|
1901
|
+
);
|
|
1902
|
+
server2.tool(
|
|
1903
|
+
"delete_bookmark",
|
|
1904
|
+
"Move a bookmark to the Trash (soft delete). Restorable with restore_bookmark, and it goes back to the folder it was filed in. The Trash empties itself sixty days after deletion; the permanent purge is deliberately not reachable with an API key, so a key cannot unrecoverably delete a bookmark. Returns the trashed row rather than an ok flag, so you can read the deletedAt it just earned. Requires the tensor:bookmarks:write scope.",
|
|
1905
|
+
{ id: z.number().describe("Bookmark ID") },
|
|
1906
|
+
async ({ id }) => {
|
|
1907
|
+
const data = await api("DELETE", `/api/bookmarks/${id}`);
|
|
1908
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1909
|
+
}
|
|
1910
|
+
);
|
|
1911
|
+
server2.tool(
|
|
1912
|
+
"restore_bookmark",
|
|
1913
|
+
"Restore a bookmark from the Trash, back into the folder it was filed in. 404 when it is not in the Trash. Requires the tensor:bookmarks:write scope.",
|
|
1914
|
+
{ id: z.number().describe("Bookmark ID") },
|
|
1915
|
+
async ({ id }) => {
|
|
1916
|
+
const data = await api("POST", `/api/bookmarks/${id}/restore`);
|
|
1917
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
server2.tool(
|
|
1921
|
+
"list_bookmark_folders",
|
|
1922
|
+
"The bookmark folder tree \u2014 every folder in the organization, each with its parentId. Folders nest. This is a SIBLING resource of /api/bookmarks rather than a sub-path of it, but one scope opens both. Requires the tensor:bookmarks:read scope.",
|
|
1923
|
+
{},
|
|
1924
|
+
async () => {
|
|
1925
|
+
const data = await api("GET", "/api/bookmark-folders");
|
|
1926
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1927
|
+
}
|
|
1928
|
+
);
|
|
1929
|
+
server2.tool(
|
|
1930
|
+
"create_bookmark_folder",
|
|
1931
|
+
"Create a bookmark folder, optionally inside another. Requires the tensor:bookmarks:write scope.",
|
|
1932
|
+
{
|
|
1933
|
+
name: z.string().describe("Folder name (1-256 chars)"),
|
|
1934
|
+
parentId: z.number().optional().describe("Nest it inside this folder. Omit for a root folder.")
|
|
1935
|
+
},
|
|
1936
|
+
async (params) => {
|
|
1937
|
+
const data = await api("POST", "/api/bookmark-folders", params);
|
|
1938
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1939
|
+
}
|
|
1940
|
+
);
|
|
1941
|
+
server2.tool(
|
|
1942
|
+
"update_bookmark_folder",
|
|
1943
|
+
"Rename a folder or move it to a different parent. Pass parentId as null to make it a root folder. A move that would put a folder inside itself, or push the tree past its depth ceiling, is refused with 409 and a message saying which \u2014 branch on the message rather than retrying. Requires the tensor:bookmarks:write scope.",
|
|
1944
|
+
{
|
|
1945
|
+
id: z.number().describe("Folder ID"),
|
|
1946
|
+
name: z.string().optional().describe("Replacement name"),
|
|
1947
|
+
parentId: z.number().nullable().optional().describe("New parent, or null for a root folder")
|
|
1948
|
+
},
|
|
1949
|
+
async ({ id, ...body }) => {
|
|
1950
|
+
const data = await api("PATCH", `/api/bookmark-folders/${id}`, body);
|
|
1951
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1952
|
+
}
|
|
1953
|
+
);
|
|
1954
|
+
server2.tool(
|
|
1955
|
+
"delete_bookmark_folder",
|
|
1956
|
+
"Destroy a folder AND NOTHING ELSE. Its bookmarks are UNFILED \u2014 folderId set to null, still in the library and not in the Trash \u2014 and its sub-folders are promoted to its own parent. A non-empty folder is therefore accepted, unlike delete_file_folder which refuses one: nothing under it is lost. THERE IS NO UNDO, because a folder is a filing decision rather than a Trash surface; the bookmarks survive but the folder does not come back. Requires the tensor:bookmarks:write scope.",
|
|
1957
|
+
{ id: z.number().describe("Folder ID") },
|
|
1958
|
+
async ({ id }) => {
|
|
1959
|
+
const data = await api("DELETE", `/api/bookmark-folders/${id}`);
|
|
1960
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1961
|
+
}
|
|
1962
|
+
);
|
|
1963
|
+
server2.tool(
|
|
1964
|
+
"list_tab_groups",
|
|
1965
|
+
"List tab groups synced from a browser, each hydrated with its tabs \u2014 there is no per-tab read, because the group is the unit of everything except search. Starred groups come first, then the manual order. `limit`/`offset` page the GROUPS; a group's tabs are never truncated. Requires the tensor:tabs:read scope, which is SEPARATE from tensor:bookmarks:read on purpose: a synced group is in effect a partial browsing history.",
|
|
1966
|
+
{
|
|
1967
|
+
limit: z.number().optional().describe("Max GROUPS. Default 500."),
|
|
1968
|
+
offset: z.number().optional().describe("Pagination offset, in groups"),
|
|
1969
|
+
trash: z.boolean().optional().describe("true = trashed groups instead of live ones")
|
|
1970
|
+
},
|
|
1971
|
+
async ({ limit, offset, trash }) => {
|
|
1972
|
+
const params = new URLSearchParams();
|
|
1973
|
+
if (limit) params.set("limit", String(limit));
|
|
1974
|
+
if (offset) params.set("offset", String(offset));
|
|
1975
|
+
if (trash) params.set("trash", "1");
|
|
1976
|
+
const qs = params.toString();
|
|
1977
|
+
const data = await api("GET", `/api/tabs${qs ? `?${qs}` : ""}`);
|
|
1978
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1979
|
+
}
|
|
1980
|
+
);
|
|
1981
|
+
server2.tool(
|
|
1982
|
+
"get_tab_group",
|
|
1983
|
+
"Get one tab group with its tabs in order. `deviceLabel` says which machine collapsed it and is display only \u2014 never an identity or a key. Requires the tensor:tabs:read scope.",
|
|
1984
|
+
{ id: z.number().describe("Tab group ID") },
|
|
1985
|
+
async ({ id }) => {
|
|
1986
|
+
const data = await api("GET", `/api/tabs/${id}`);
|
|
1987
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1988
|
+
}
|
|
1989
|
+
);
|
|
1990
|
+
server2.tool(
|
|
1991
|
+
"create_tab_group",
|
|
1992
|
+
"Park a set of tabs as one group. ONE CALL CARRIES THE WHOLE GROUP and that is a requirement rather than a convenience \u2014 the per-key rate limit is 120 requests a minute, so posting fifty tabs one at a time would spend a third of the window on a single collapse. Between 1 and 500 tabs, kept in the order you send them. Requires the tensor:tabs:write scope.",
|
|
1993
|
+
{
|
|
1994
|
+
items: z.array(z.object({
|
|
1995
|
+
url: z.string().describe("The tab's URL (max 2048 chars)"),
|
|
1996
|
+
title: z.string().nullable().optional().describe("Page title"),
|
|
1997
|
+
faviconUrl: z.string().nullable().optional().describe("Favicon URL \u2014 kept remote")
|
|
1998
|
+
})).describe("The tabs, in order. At least one, at most 500."),
|
|
1999
|
+
name: z.string().nullable().optional().describe(`Group name. THE SERVER NEVER FILLS THIS IN: omit it and the group stays unnamed, and every Tensor surface renders it as "Untitled group". The Chrome extension's groups look dated because the extension stamps a date itself before posting, which is not something this route does for you \u2014 so name the group here, or accept that it has none.`),
|
|
2000
|
+
deviceLabel: z.string().nullable().optional().describe("Which machine this came from. Display only."),
|
|
2001
|
+
locked: z.boolean().optional().describe("Do not let anything clear this group"),
|
|
2002
|
+
starred: z.boolean().optional().describe("Pin it to the top of the list")
|
|
2003
|
+
},
|
|
2004
|
+
async (params) => {
|
|
2005
|
+
const data = await api("POST", "/api/tabs", params);
|
|
2006
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
2007
|
+
}
|
|
2008
|
+
);
|
|
2009
|
+
server2.tool(
|
|
2010
|
+
"update_tab_group",
|
|
2011
|
+
'Edit a tab group. EXACTLY THREE FIELDS ARE EDITABLE \u2014 name, locked, starred \u2014 and the tab list is deliberately not among them: a whole-array replace would make "which tabs did I have" unanswerable from the audit trail. A tab leaves through delete_tab, and tabs arrive by creating another group. A trashed group answers 404 until it is restored. Requires the tensor:tabs:write scope.',
|
|
2012
|
+
{
|
|
2013
|
+
id: z.number().describe("Tab group ID"),
|
|
2014
|
+
name: z.string().nullable().optional().describe("Replacement name"),
|
|
2015
|
+
locked: z.boolean().optional().describe("Do not let anything clear this group"),
|
|
2016
|
+
starred: z.boolean().optional().describe("Pin it to the top of the list")
|
|
2017
|
+
},
|
|
2018
|
+
async ({ id, ...body }) => {
|
|
2019
|
+
const data = await api("PATCH", `/api/tabs/${id}`, body);
|
|
2020
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
2021
|
+
}
|
|
2022
|
+
);
|
|
2023
|
+
server2.tool(
|
|
2024
|
+
"delete_tab",
|
|
2025
|
+
"Remove ONE tab from a live group. Immediate and not recoverable \u2014 a tab has no Trash of its own because the GROUP is the recoverable unit. To put the whole group aside instead, use delete_tab_group. Requires the tensor:tabs:write scope.",
|
|
2026
|
+
{
|
|
2027
|
+
id: z.number().describe("Tab group ID"),
|
|
2028
|
+
itemId: z.number().describe("The tab's own id, from the group's items")
|
|
2029
|
+
},
|
|
2030
|
+
async ({ id, itemId }) => {
|
|
2031
|
+
const data = await api("DELETE", `/api/tabs/${id}/items/${itemId}`);
|
|
2032
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
2033
|
+
}
|
|
2034
|
+
);
|
|
2035
|
+
server2.tool(
|
|
2036
|
+
"delete_tab_group",
|
|
2037
|
+
"Move a whole tab group to the Trash (soft delete). The tabs stay attached and restore_tab_group undoes it. The Trash empties itself sixty days after deletion; the permanent purge is deliberately not reachable with an API key. Requires the tensor:tabs:write scope.",
|
|
2038
|
+
{ id: z.number().describe("Tab group ID") },
|
|
2039
|
+
async ({ id }) => {
|
|
2040
|
+
const data = await api("DELETE", `/api/tabs/${id}`);
|
|
2041
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
2042
|
+
}
|
|
2043
|
+
);
|
|
2044
|
+
server2.tool(
|
|
2045
|
+
"restore_tab_group",
|
|
2046
|
+
"Restore a tab group from the Trash, tabs and all. 404 when it is not in the Trash. Requires the tensor:tabs:write scope.",
|
|
2047
|
+
{ id: z.number().describe("Tab group ID") },
|
|
2048
|
+
async ({ id }) => {
|
|
2049
|
+
const data = await api("POST", `/api/tabs/${id}/restore`);
|
|
2050
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
2051
|
+
}
|
|
2052
|
+
);
|
|
1828
2053
|
}
|
|
1829
2054
|
function createApiClient(opts) {
|
|
1830
2055
|
const baseUrl = opts.baseUrl.replace(/\/+$/, "");
|
|
@@ -1857,7 +2082,7 @@ function createApiClient(opts) {
|
|
|
1857
2082
|
// package.json
|
|
1858
2083
|
var package_default = {
|
|
1859
2084
|
name: "@levitating/tensor-mcp",
|
|
1860
|
-
version: "5.
|
|
2085
|
+
version: "5.1.0",
|
|
1861
2086
|
description: "Tensor MCP \u2014 Model Context Protocol server for the Tensor wealth management API. Exposes the Tensor API as tools for Claude, Cursor, Codex, and any MCP-aware client.",
|
|
1862
2087
|
type: "module",
|
|
1863
2088
|
main: "./dist/index.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levitating/tensor-mcp",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Tensor MCP — Model Context Protocol server for the Tensor wealth management API. Exposes the Tensor API as tools for Claude, Cursor, Codex, and any MCP-aware client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|