exponential-mcp 0.13.1 → 0.14.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 +35 -0
- package/dist/agentGuidance.js +3 -0
- package/dist/annotations.d.ts +11 -0
- package/dist/annotations.js +4 -0
- package/dist/domains/actions.js +12 -0
- package/dist/domains/areas.js +2 -0
- package/dist/domains/comments.js +7 -0
- package/dist/domains/contacts.js +7 -0
- package/dist/domains/databases.js +13 -0
- package/dist/domains/deals.js +8 -0
- package/dist/domains/decisions.js +14 -0
- package/dist/domains/epics.js +5 -0
- package/dist/domains/features.js +7 -0
- package/dist/domains/framework.d.ts +11 -0
- package/dist/domains/framework.js +18 -0
- package/dist/domains/goals.js +11 -0
- package/dist/domains/keyResults.js +11 -0
- package/dist/domains/labels.js +4 -0
- package/dist/domains/meetings.js +9 -0
- package/dist/domains/organizations.js +3 -0
- package/dist/domains/pages.js +10 -0
- package/dist/domains/positions.js +7 -0
- package/dist/domains/products.js +5 -0
- package/dist/domains/projects.js +4 -0
- package/dist/domains/requirements.js +4 -0
- package/dist/domains/scopes.js +4 -0
- package/dist/domains/stories.js +4 -0
- package/dist/domains/tickets.js +10 -0
- package/dist/domains/time.js +5 -0
- package/dist/domains/workspaces.js +2 -0
- package/dist/index.js +5 -855
- package/dist/runTools.js +5 -0
- package/dist/tools.d.ts +27 -0
- package/dist/tools.js +899 -0
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -250,6 +250,41 @@ is `defer_actions` (amnesty); `reschedule_actions` would just re-inflict the
|
|
|
250
250
|
same pile tomorrow. Individually-dated **loose** actions are the ones that
|
|
251
251
|
deserve a real decision.
|
|
252
252
|
|
|
253
|
+
### Annotations
|
|
254
|
+
|
|
255
|
+
Every tool carries MCP tool annotations: a `title`, `readOnlyHint` and
|
|
256
|
+
`destructiveHint`. A domain tool is read-only only when every operation reads,
|
|
257
|
+
and destructive when any operation deletes. No hand-written tool deletes
|
|
258
|
+
anything.
|
|
259
|
+
|
|
260
|
+
## Using the tools in your own server
|
|
261
|
+
|
|
262
|
+
The tool registry is also exported on its own, as `exponential-mcp/tools`, so
|
|
263
|
+
another server can offer the same tools over a different transport. The
|
|
264
|
+
hosted endpoint in the Exponential app is built on it. Importing it has no side
|
|
265
|
+
effects: it reads no config, touches no files and never exits the process. You
|
|
266
|
+
build the `ExponentialClient`, so you choose who the tools act as.
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
import { ExponentialClient } from 'exponential-sdk';
|
|
270
|
+
import { listTools, callTool } from 'exponential-mcp/tools';
|
|
271
|
+
|
|
272
|
+
const client = new ExponentialClient({ token: process.env.EXPONENTIAL_API_KEY!, apiUrl: 'https://www.exponential.im' });
|
|
273
|
+
|
|
274
|
+
listTools(); // Tool[] for tools/list
|
|
275
|
+
await callTool(client, 'get_workspaces', {}); // CallToolResult for tools/call
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
- `listTools(options?)` returns every tool in `tools/list` order.
|
|
279
|
+
- `callTool(client, name, args, options?)` runs one tool. A failure comes back as
|
|
280
|
+
a result with `isError: true` rather than a throw.
|
|
281
|
+
- The three run tools (`report_progress`, `ask_owner`, `finish_run`) exist only
|
|
282
|
+
for a session serving an Agent run. They are listed and callable only when
|
|
283
|
+
`options.runContext` (`{ runId, runnerId? }`) is passed; leave it out otherwise.
|
|
284
|
+
|
|
285
|
+
The stdio server (`exponential-mcp serve`) calls the same two functions, so both
|
|
286
|
+
offer the same tools from the same release.
|
|
287
|
+
|
|
253
288
|
## Development
|
|
254
289
|
|
|
255
290
|
```bash
|
package/dist/agentGuidance.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { reads } from './annotations.js';
|
|
1
2
|
const GUIDANCE_NOTE = 'This is GUIDANCE, NOT AUTHORITY (ADR-0071): it informs how to work but never grants permission for anything — check permissions and ask the user as you normally would.';
|
|
2
3
|
export const AGENT_GUIDANCE_TOOLS = [
|
|
3
4
|
{
|
|
4
5
|
name: 'get_agent_context',
|
|
6
|
+
annotations: reads('Get agent context'),
|
|
5
7
|
description: [
|
|
6
8
|
"Get the agent context for a workspace (and optionally a project): the workspace's and project's AI instructions, the project's accepted decisions (label, statement, link; `omitted` counts the rest) and, for callers with a write role, accepted ADRs (label, title, link).",
|
|
7
9
|
'Call it before starting work in a workspace or project. Fetch a decision or ADR link for its full reasoning.',
|
|
@@ -18,6 +20,7 @@ export const AGENT_GUIDANCE_TOOLS = [
|
|
|
18
20
|
},
|
|
19
21
|
{
|
|
20
22
|
name: 'get_agent_method',
|
|
23
|
+
annotations: reads('Get agent method'),
|
|
21
24
|
description: [
|
|
22
25
|
'Get the current published Exponential method: the documents (Markdown) describing how work is planned and run, with version and content hash.',
|
|
23
26
|
GUIDANCE_NOTE,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool annotations (MCP `ToolAnnotations`) for the hand-written, guidance and
|
|
3
|
+
* run tools. Domain tools derive theirs from their operations' effects
|
|
4
|
+
* (`domains/framework.ts`). No hand-written tool deletes anything.
|
|
5
|
+
*/
|
|
6
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
export type ToolAnnotations = NonNullable<Tool['annotations']>;
|
|
8
|
+
/** A tool that changes nothing. */
|
|
9
|
+
export declare const reads: (title: string) => ToolAnnotations;
|
|
10
|
+
/** A tool that creates or changes data and deletes nothing. */
|
|
11
|
+
export declare const writes: (title: string) => ToolAnnotations;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A tool that changes nothing. */
|
|
2
|
+
export const reads = (title) => ({ title, readOnlyHint: true, destructiveHint: false });
|
|
3
|
+
/** A tool that creates or changes data and deletes nothing. */
|
|
4
|
+
export const writes = (title) => ({ title, readOnlyHint: false, destructiveHint: false });
|
package/dist/domains/actions.js
CHANGED
|
@@ -25,6 +25,7 @@ export const actions = {
|
|
|
25
25
|
description: 'Actions: the personal and project to-dos on the user’s plate, with due/scheduled dates, priority and a kanban column. Projects live in the `projects` tool, logged time in `time`, and meetings (which can spawn actions) in `meetings`.',
|
|
26
26
|
operations: {
|
|
27
27
|
list: op({
|
|
28
|
+
effect: 'read',
|
|
28
29
|
summary: 'List your open actions (completed/cancelled hidden unless `status` is set). With projectId, returns that project’s actions and ignores `status`; with status alone, returns only actions you created in that kanban column.',
|
|
29
30
|
params: z.object({
|
|
30
31
|
projectId: id('Project').optional(),
|
|
@@ -34,21 +35,25 @@ export const actions = {
|
|
|
34
35
|
run: (client, params) => client.actions.list(params),
|
|
35
36
|
}),
|
|
36
37
|
get_today: op({
|
|
38
|
+
effect: 'read',
|
|
37
39
|
summary: 'What is actually on the user’s plate today, split into overdue / today / inbox — the /today page’s own partition. Prefer this for "what should I do today". Each group is capped at 50 rows; `count` is the true total.',
|
|
38
40
|
params: z.object({ workspaceId: optionalWorkspaceId }),
|
|
39
41
|
run: (client, { workspaceId }) => client.actions.getTodaysActions(workspaceId),
|
|
40
42
|
}),
|
|
41
43
|
get_due_today: op({
|
|
44
|
+
effect: 'read',
|
|
42
45
|
summary: 'Narrow slice: only actions whose dueDate is today. Excludes overdue and scheduled-but-undated work — use get_today for "what is on my plate".',
|
|
43
46
|
params: z.object({ workspaceId: optionalWorkspaceId }),
|
|
44
47
|
run: (client, { workspaceId }) => client.actions.getToday(workspaceId),
|
|
45
48
|
}),
|
|
46
49
|
get_overdue_triage: op({
|
|
50
|
+
effect: 'read',
|
|
47
51
|
summary: 'Explain the overdue pile: cohorts (actions sharing one exact timestamp, i.e. a bulk-dated plan — usually bulk_defer them) vs loose, individually-dated debt.',
|
|
48
52
|
params: z.object({ workspaceId: optionalWorkspaceId }),
|
|
49
53
|
run: (client, { workspaceId }) => client.actions.getOverdueTriage(workspaceId),
|
|
50
54
|
}),
|
|
51
55
|
bulk_reschedule: op({
|
|
56
|
+
effect: 'write',
|
|
52
57
|
summary: 'Move actions to a new date: sets both scheduledStart and dueDate to `dueDate`. Pass null to clear both (bulk_defer says that more clearly). Actions you cannot access are silently skipped.',
|
|
53
58
|
params: z.object({
|
|
54
59
|
actionIds: z.array(id('Action')),
|
|
@@ -57,6 +62,7 @@ export const actions = {
|
|
|
57
62
|
run: (client, { actionIds, dueDate }) => client.actions.bulkReschedule(actionIds, dueDate),
|
|
58
63
|
}),
|
|
59
64
|
bulk_defer: op({
|
|
65
|
+
effect: 'write',
|
|
60
66
|
summary: 'Amnesty: clear the dates on actions so they fall back to their project backlog untimed (1–200 ids). Kanban column is untouched. For work that was never really due — typically an overdue cohort.',
|
|
61
67
|
params: z.object({
|
|
62
68
|
actionIds: z.array(id('Action')).min(1).max(200),
|
|
@@ -64,6 +70,7 @@ export const actions = {
|
|
|
64
70
|
run: (client, { actionIds }) => client.actions.bulkDefer(actionIds),
|
|
65
71
|
}),
|
|
66
72
|
list_by_date_range: op({
|
|
73
|
+
effect: 'read',
|
|
67
74
|
summary: 'Your ACTIVE actions whose dueDate falls in [start, end) — end is exclusive. The workspace filter matches via the action’s project, so project-less actions drop out when it is set.',
|
|
68
75
|
params: z.object({
|
|
69
76
|
start: date('Range start (inclusive)'),
|
|
@@ -73,6 +80,7 @@ export const actions = {
|
|
|
73
80
|
run: (client, { start, end, workspaceId }) => client.actions.getByDateRange(start, end, workspaceId),
|
|
74
81
|
}),
|
|
75
82
|
list_kanban: op({
|
|
83
|
+
effect: 'read',
|
|
76
84
|
summary: 'Kanban-board actions (those with a kanban column), ordered by column then board order. Only returns actions you created.',
|
|
77
85
|
params: z.object({
|
|
78
86
|
projectId: id('Project').optional(),
|
|
@@ -82,6 +90,7 @@ export const actions = {
|
|
|
82
90
|
run: (client, params) => client.actions.getKanban(params),
|
|
83
91
|
}),
|
|
84
92
|
list_project_actions: op({
|
|
93
|
+
effect: 'read',
|
|
85
94
|
summary: 'All actions in one project, including completed ones (unlike list). FORBIDDEN if you lack project access.',
|
|
86
95
|
params: z.object({
|
|
87
96
|
projectId: id('Project'),
|
|
@@ -90,6 +99,7 @@ export const actions = {
|
|
|
90
99
|
run: (client, { projectId, assigneeId }) => client.actions.getProjectActions(projectId, assigneeId),
|
|
91
100
|
}),
|
|
92
101
|
create: op({
|
|
102
|
+
effect: 'write',
|
|
93
103
|
summary: 'Create an action. Priority defaults to "Quick" and status to ACTIVE.',
|
|
94
104
|
params: z.object({
|
|
95
105
|
name: z.string(),
|
|
@@ -109,6 +119,7 @@ export const actions = {
|
|
|
109
119
|
run: (client, params) => client.actions.create(params),
|
|
110
120
|
}),
|
|
111
121
|
update: op({
|
|
122
|
+
effect: 'write',
|
|
112
123
|
summary: 'Update an action. Only the fields you pass change. Complete it with status COMPLETED or kanbanStatus DONE.',
|
|
113
124
|
params: z.object({
|
|
114
125
|
id: id('Action'),
|
|
@@ -133,6 +144,7 @@ export const actions = {
|
|
|
133
144
|
run: (client, params) => client.actions.update(params),
|
|
134
145
|
}),
|
|
135
146
|
upsert_by_source: op({
|
|
147
|
+
effect: 'write',
|
|
136
148
|
summary: 'Idempotent create keyed on (workspaceId, sourceType, sourceId): refreshes name/links if found, else creates. Returns { action, outcome: "created" | "updated" }.',
|
|
137
149
|
params: z.object({
|
|
138
150
|
sourceType: z.string().describe('External source kind, e.g. `claude-session` for the Daily worklog'),
|
package/dist/domains/areas.js
CHANGED
|
@@ -5,11 +5,13 @@ export const areas = {
|
|
|
5
5
|
description: 'Areas: per-product buckets a feature is filed under (exactly one or none). Products are in `products`; file a feature under an area via `features` create/update `areaId`.',
|
|
6
6
|
operations: {
|
|
7
7
|
list: op({
|
|
8
|
+
effect: 'read',
|
|
8
9
|
summary: 'List a product’s areas in display order, with feature counts.',
|
|
9
10
|
params: z.object({ productId: id('Product') }),
|
|
10
11
|
run: (client, params) => client.areas.list(params),
|
|
11
12
|
}),
|
|
12
13
|
create: op({
|
|
14
|
+
effect: 'write',
|
|
13
15
|
summary: 'Create an area at the end of a product’s list. Names are unique per product.',
|
|
14
16
|
params: z.object({
|
|
15
17
|
productId: id('Product'),
|
package/dist/domains/comments.js
CHANGED
|
@@ -41,6 +41,7 @@ export const comments = {
|
|
|
41
41
|
description: 'Comments on actions, features (PRDs), knowledge pages, goals (objectives) and tickets — pick the entity with `target`. Threaded replies and anchored-thread resolve/unresolve exist only on features. Editing and deleting are author-only.',
|
|
42
42
|
operations: {
|
|
43
43
|
list: op({
|
|
44
|
+
effect: 'read',
|
|
44
45
|
summary: 'List comments on an entity. All targets. For tickets this reads the ticket detail (newest first) — there is no separate list endpoint.',
|
|
45
46
|
params: z.object({ target, targetId }),
|
|
46
47
|
run: (client, { target: t, targetId: tid }) => {
|
|
@@ -59,6 +60,7 @@ export const comments = {
|
|
|
59
60
|
},
|
|
60
61
|
}),
|
|
61
62
|
add: op({
|
|
63
|
+
effect: 'write',
|
|
62
64
|
summary: 'Add a top-level comment. All targets; scopeId/threadId/quotedText are feature-only, parentUpdateId is goal-only.',
|
|
63
65
|
params: z.object({
|
|
64
66
|
target,
|
|
@@ -87,6 +89,7 @@ export const comments = {
|
|
|
87
89
|
},
|
|
88
90
|
}),
|
|
89
91
|
update: op({
|
|
92
|
+
effect: 'write',
|
|
90
93
|
summary: 'Replace a comment’s text. All targets; author-only.',
|
|
91
94
|
params: z.object({ target, commentId, body }),
|
|
92
95
|
run: (client, { target: t, commentId, body }) => {
|
|
@@ -105,6 +108,7 @@ export const comments = {
|
|
|
105
108
|
},
|
|
106
109
|
}),
|
|
107
110
|
delete: op({
|
|
111
|
+
effect: 'delete',
|
|
108
112
|
summary: 'Delete a comment permanently. All targets; author-only. On features, deleting a root also deletes its replies.',
|
|
109
113
|
params: z.object({ target, commentId }),
|
|
110
114
|
run: (client, { target: t, commentId }) => {
|
|
@@ -123,6 +127,7 @@ export const comments = {
|
|
|
123
127
|
},
|
|
124
128
|
}),
|
|
125
129
|
reply: op({
|
|
130
|
+
effect: 'write',
|
|
126
131
|
summary: 'Reply to a comment. Feature target only. Replies to replies still hang off the root comment.',
|
|
127
132
|
params: z.object({
|
|
128
133
|
target,
|
|
@@ -136,6 +141,7 @@ export const comments = {
|
|
|
136
141
|
},
|
|
137
142
|
}),
|
|
138
143
|
resolve: op({
|
|
144
|
+
effect: 'write',
|
|
139
145
|
summary: 'Mark an anchored comment thread resolved. Feature target only; only anchored threads have a threadId.',
|
|
140
146
|
params: z.object({
|
|
141
147
|
target,
|
|
@@ -149,6 +155,7 @@ export const comments = {
|
|
|
149
155
|
},
|
|
150
156
|
}),
|
|
151
157
|
unresolve: op({
|
|
158
|
+
effect: 'write',
|
|
152
159
|
summary: 'Reopen a resolved anchored comment thread. Feature target only.',
|
|
153
160
|
params: z.object({
|
|
154
161
|
target,
|
package/dist/domains/contacts.js
CHANGED
|
@@ -28,6 +28,7 @@ export const contacts = {
|
|
|
28
28
|
description: 'CRM contacts (people) in a workspace, with their interaction history. Organizations live in the `organizations` tool and deals in `deals`. Personal fields are encrypted at rest; list/search runs server-side.',
|
|
29
29
|
operations: {
|
|
30
30
|
list: op({
|
|
31
|
+
effect: 'read',
|
|
31
32
|
summary: 'List contacts, newest first. Paginate with the returned nextCursor.',
|
|
32
33
|
params: z.object({
|
|
33
34
|
workspaceId,
|
|
@@ -40,6 +41,7 @@ export const contacts = {
|
|
|
40
41
|
run: (client, params) => client.contacts.list(params),
|
|
41
42
|
}),
|
|
42
43
|
get: op({
|
|
44
|
+
effect: 'read',
|
|
43
45
|
summary: 'Get one contact, optionally with its interaction timeline.',
|
|
44
46
|
params: z.object({
|
|
45
47
|
id: id('Contact'),
|
|
@@ -48,6 +50,7 @@ export const contacts = {
|
|
|
48
50
|
run: (client, { id, includeInteractions }) => client.contacts.get(id, { includeInteractions }),
|
|
49
51
|
}),
|
|
50
52
|
create: op({
|
|
53
|
+
effect: 'write',
|
|
51
54
|
summary: 'Create a contact.',
|
|
52
55
|
params: z.object({
|
|
53
56
|
workspaceId,
|
|
@@ -64,6 +67,7 @@ export const contacts = {
|
|
|
64
67
|
run: (client, params) => client.contacts.create(params),
|
|
65
68
|
}),
|
|
66
69
|
update: op({
|
|
70
|
+
effect: 'write',
|
|
67
71
|
summary: 'Update a contact. Only the fields you pass change.',
|
|
68
72
|
params: z.object({
|
|
69
73
|
id: id('Contact'),
|
|
@@ -80,11 +84,13 @@ export const contacts = {
|
|
|
80
84
|
run: (client, params) => client.contacts.update(params),
|
|
81
85
|
}),
|
|
82
86
|
delete: op({
|
|
87
|
+
effect: 'delete',
|
|
83
88
|
summary: 'Delete a contact permanently.',
|
|
84
89
|
params: z.object({ id: id('Contact') }),
|
|
85
90
|
run: (client, { id }) => client.contacts.delete(id),
|
|
86
91
|
}),
|
|
87
92
|
add_interaction: op({
|
|
93
|
+
effect: 'write',
|
|
88
94
|
summary: 'Log an interaction (email, call, meeting, note…) on a contact’s timeline.',
|
|
89
95
|
params: z.object({
|
|
90
96
|
contactId: id('Contact'),
|
|
@@ -97,6 +103,7 @@ export const contacts = {
|
|
|
97
103
|
run: (client, params) => client.contacts.addInteraction(params),
|
|
98
104
|
}),
|
|
99
105
|
enrich: op({
|
|
106
|
+
effect: 'write',
|
|
100
107
|
summary: 'Queue a web-search enrichment job for a contact. Idempotent: a job already in flight is not re-queued.',
|
|
101
108
|
params: z.object({ id: id('Contact') }),
|
|
102
109
|
run: (client, { id }) => client.contacts.enrich(id),
|
|
@@ -61,6 +61,7 @@ export const databases = {
|
|
|
61
61
|
'Not a work tracker: never put tasks, tickets or projects in a database — those have their own tools.',
|
|
62
62
|
operations: {
|
|
63
63
|
create: op({
|
|
64
|
+
effect: 'write',
|
|
64
65
|
summary: 'Create a database on a page with a title property, and (by default) place its block at the end of the page body. Then add properties and rows.',
|
|
65
66
|
params: z.object({
|
|
66
67
|
pageId: id('Page').describe('The page that will hold it; you need edit access'),
|
|
@@ -87,26 +88,31 @@ export const databases = {
|
|
|
87
88
|
},
|
|
88
89
|
}),
|
|
89
90
|
get: op({
|
|
91
|
+
effect: 'read',
|
|
90
92
|
summary: 'One database: its properties (names, types, select options with ids), saved view, row count and holding page. Read this before writing rows.',
|
|
91
93
|
params: z.object({ id: databaseId }),
|
|
92
94
|
run: (client, { id }) => client.databases.get(id),
|
|
93
95
|
}),
|
|
94
96
|
list: op({
|
|
97
|
+
effect: 'read',
|
|
95
98
|
summary: 'The databases a page holds, detached ones included (detachedAt set: the block is out of the body; rows wait 30 days for the purge).',
|
|
96
99
|
params: z.object({ pageId: id('Page') }),
|
|
97
100
|
run: (client, { pageId }) => client.databases.list(pageId),
|
|
98
101
|
}),
|
|
99
102
|
update: op({
|
|
103
|
+
effect: 'write',
|
|
100
104
|
summary: 'Rename a database, or replace its saved view WHOLE (send the full view, not a patch).',
|
|
101
105
|
params: z.object({ id: databaseId, name: z.string().min(1).optional(), view: viewInput.optional() }),
|
|
102
106
|
run: (client, params) => client.databases.update(params),
|
|
103
107
|
}),
|
|
104
108
|
delete: op({
|
|
109
|
+
effect: 'delete',
|
|
105
110
|
summary: 'Delete a database and every row with it (the rows are pages). Removing the block from the page only detaches; this is the delete.',
|
|
106
111
|
params: z.object({ id: databaseId }),
|
|
107
112
|
run: (client, { id }) => client.databases.delete(id),
|
|
108
113
|
}),
|
|
109
114
|
add_property: op({
|
|
115
|
+
effect: 'write',
|
|
110
116
|
summary: `Add a property (column). Types: ${PROPERTY_TYPES.join(', ')}. title exists from creation; relation arrives with V3. Select options get stable ids.`,
|
|
111
117
|
params: z.object({
|
|
112
118
|
id: databaseId,
|
|
@@ -118,6 +124,7 @@ export const databases = {
|
|
|
118
124
|
run: (client, params) => client.databases.addProperty(params),
|
|
119
125
|
}),
|
|
120
126
|
update_property: op({
|
|
127
|
+
effect: 'write',
|
|
121
128
|
summary: 'Rename, retype, describe or re-option a property. Ids stay, no row is rewritten. options replaces the whole list: include existing options with their id to keep them, leave one out to remove it.',
|
|
122
129
|
params: z.object({
|
|
123
130
|
id: databaseId,
|
|
@@ -130,16 +137,19 @@ export const databases = {
|
|
|
130
137
|
run: (client, params) => client.databases.updateProperty(params),
|
|
131
138
|
}),
|
|
132
139
|
remove_property: op({
|
|
140
|
+
effect: 'delete',
|
|
133
141
|
summary: 'Remove a property from the schema and view (never the title). Row values under it stay until each row is next written.',
|
|
134
142
|
params: z.object({ id: databaseId, propertyId: z.string().describe('Property ID or name') }),
|
|
135
143
|
run: (client, { id, propertyId }) => client.databases.removeProperty(id, propertyId),
|
|
136
144
|
}),
|
|
137
145
|
reorder_properties: op({
|
|
146
|
+
effect: 'write',
|
|
138
147
|
summary: 'Set the column order; propertyIds must name every property exactly once.',
|
|
139
148
|
params: z.object({ id: databaseId, propertyIds: z.array(z.string()).min(1) }),
|
|
140
149
|
run: (client, { id, propertyIds }) => client.databases.reorderProperties(id, propertyIds),
|
|
141
150
|
}),
|
|
142
151
|
list_rows: op({
|
|
152
|
+
effect: 'read',
|
|
143
153
|
summary: 'Rows with their typed values (keyed by property ID; select values are option ids — map them with get), through the saved view or a view you pass. Paged: pass nextCursor back as cursor. columns = visible property ids in order.',
|
|
144
154
|
params: z.object({
|
|
145
155
|
id: databaseId,
|
|
@@ -150,16 +160,19 @@ export const databases = {
|
|
|
150
160
|
run: (client, { id, ...options }) => client.databases.listRows(id, options),
|
|
151
161
|
}),
|
|
152
162
|
add_row: op({
|
|
163
|
+
effect: 'write',
|
|
153
164
|
summary: 'Add a row with typed values (see values). It becomes a page placed where the holding page is; the title property is its title.',
|
|
154
165
|
params: z.object({ id: databaseId, values: values.optional(), note }),
|
|
155
166
|
run: (client, { id, values: v, note: why }) => client.databases.createRow(id, v ?? {}, { note: why }),
|
|
156
167
|
}),
|
|
157
168
|
update_row: op({
|
|
169
|
+
effect: 'write',
|
|
158
170
|
summary: 'Write some of a row\'s cells (see values). Cells you do not name are kept; null clears one. Recorded as a revision on the row page.',
|
|
159
171
|
params: z.object({ rowId: id('Row page'), values, note }),
|
|
160
172
|
run: (client, { rowId, values: v, note: why }) => client.databases.updateRow(rowId, v, { note: why }),
|
|
161
173
|
}),
|
|
162
174
|
delete_row: op({
|
|
175
|
+
effect: 'delete',
|
|
163
176
|
summary: 'Delete a row: the page and its search chunks.',
|
|
164
177
|
params: z.object({ rowId: id('Row page') }),
|
|
165
178
|
run: (client, { rowId }) => client.databases.deleteRow(rowId),
|
package/dist/domains/deals.js
CHANGED
|
@@ -7,26 +7,31 @@ export const deals = {
|
|
|
7
7
|
description: 'CRM deals moving through the workspace’s sales pipeline stages, plus the pipeline and its stages. Deals link to people in `contacts` and companies in `organizations`. All operations target the workspace’s default (oldest active) pipeline.',
|
|
8
8
|
operations: {
|
|
9
9
|
pipeline: op({
|
|
10
|
+
effect: 'read',
|
|
10
11
|
summary: 'Get the workspace’s default pipeline with its stages, or null if there is none you can access.',
|
|
11
12
|
params: z.object({ workspaceId }),
|
|
12
13
|
run: (client, { workspaceId }) => client.pipelines.get(workspaceId),
|
|
13
14
|
}),
|
|
14
15
|
stages: op({
|
|
16
|
+
effect: 'read',
|
|
15
17
|
summary: 'List the pipeline’s stages in order, with deal counts. Use a stage ID for create/move.',
|
|
16
18
|
params: z.object({ workspaceId }),
|
|
17
19
|
run: (client, { workspaceId }) => client.pipelines.getStages(workspaceId),
|
|
18
20
|
}),
|
|
19
21
|
list: op({
|
|
22
|
+
effect: 'read',
|
|
20
23
|
summary: 'List every deal in the pipeline (unpaginated), ordered by position within stage.',
|
|
21
24
|
params: z.object({ workspaceId }),
|
|
22
25
|
run: (client, { workspaceId }) => client.pipelines.listDeals(workspaceId),
|
|
23
26
|
}),
|
|
24
27
|
get: op({
|
|
28
|
+
effect: 'read',
|
|
25
29
|
summary: 'Get one deal with its stage, contact, organization, assignee and latest 50 activities.',
|
|
26
30
|
params: z.object({ id: id('Deal') }),
|
|
27
31
|
run: (client, { id }) => client.pipelines.getDeal(id),
|
|
28
32
|
}),
|
|
29
33
|
create: op({
|
|
34
|
+
effect: 'write',
|
|
30
35
|
summary: 'Create a deal at the end of a stage. Logs a CREATED activity.',
|
|
31
36
|
params: z.object({
|
|
32
37
|
workspaceId,
|
|
@@ -44,6 +49,7 @@ export const deals = {
|
|
|
44
49
|
run: (client, params) => client.pipelines.createDeal(params),
|
|
45
50
|
}),
|
|
46
51
|
update: op({
|
|
52
|
+
effect: 'write',
|
|
47
53
|
summary: 'Update a deal’s fields (not its stage — use move). Only the fields you pass change; a value change is logged as an activity.',
|
|
48
54
|
params: z.object({
|
|
49
55
|
id: id('Deal'),
|
|
@@ -60,6 +66,7 @@ export const deals = {
|
|
|
60
66
|
run: (client, params) => client.pipelines.updateDeal(params),
|
|
61
67
|
}),
|
|
62
68
|
move: op({
|
|
69
|
+
effect: 'write',
|
|
63
70
|
summary: 'Move a deal to a stage and position. Entering a won/lost stage sets closedAt (leaving one clears it); a stage change is logged. Other deals are not re-ordered.',
|
|
64
71
|
params: z.object({
|
|
65
72
|
id: id('Deal'),
|
|
@@ -69,6 +76,7 @@ export const deals = {
|
|
|
69
76
|
run: (client, params) => client.pipelines.moveDeal(params),
|
|
70
77
|
}),
|
|
71
78
|
delete: op({
|
|
79
|
+
effect: 'delete',
|
|
72
80
|
summary: 'Delete a deal permanently, with its activity history.',
|
|
73
81
|
params: z.object({ id: id('Deal') }),
|
|
74
82
|
run: (client, { id }) => client.pipelines.deleteDeal(id),
|
|
@@ -17,6 +17,7 @@ export const decisions = {
|
|
|
17
17
|
description: 'The Decision Log: decisions and open questions (an open question is a decision with status OPEN — there is no separate model), optionally sourced from a meeting with transcript evidence. Meetings are in `meetings`; decisions can be linked to `tickets` and `features` as "implemented by".',
|
|
18
18
|
operations: {
|
|
19
19
|
list: op({
|
|
20
|
+
effect: 'read',
|
|
20
21
|
summary: 'Confirmed decisions in a workspace, newest decided first. Never includes drafts (see list_for_meeting).',
|
|
21
22
|
params: z.object({
|
|
22
23
|
workspaceId,
|
|
@@ -35,26 +36,31 @@ export const decisions = {
|
|
|
35
36
|
run: (client, params) => client.decisions.list(params),
|
|
36
37
|
}),
|
|
37
38
|
get: op({
|
|
39
|
+
effect: 'read',
|
|
38
40
|
summary: 'Get one decision with its deciders, evidence, links and supersession chain.',
|
|
39
41
|
params: z.object({ workspaceId, decisionId }),
|
|
40
42
|
run: (client, { workspaceId, decisionId }) => client.decisions.get(workspaceId, decisionId),
|
|
41
43
|
}),
|
|
42
44
|
list_for_meeting: op({
|
|
45
|
+
effect: 'read',
|
|
43
46
|
summary: 'Decisions and open questions logged from one meeting. Includes drafts if you can edit the meeting. No workspaceId needed.',
|
|
44
47
|
params: z.object({ transcriptionSessionId: meetingId }),
|
|
45
48
|
run: (client, { transcriptionSessionId }) => client.decisions.listForMeeting(transcriptionSessionId),
|
|
46
49
|
}),
|
|
47
50
|
list_for_adr: op({
|
|
51
|
+
effect: 'read',
|
|
48
52
|
summary: 'Decisions formalised as one ADR ("Decided in").',
|
|
49
53
|
params: z.object({ workspaceId, adrDocumentId: id('ADR document') }),
|
|
50
54
|
run: (client, { workspaceId, adrDocumentId }) => client.decisions.listForAdr(workspaceId, adrDocumentId),
|
|
51
55
|
}),
|
|
52
56
|
extract_drafts: op({
|
|
57
|
+
effect: 'write',
|
|
53
58
|
summary: 'AI-extract DRAFT decisions from a meeting’s notes and transcript for review. Idempotent: existing drafts come back; a meeting with confirmed decisions reports alreadyPublished.',
|
|
54
59
|
params: z.object({ transcriptionSessionId: meetingId }),
|
|
55
60
|
run: (client, { transcriptionSessionId }) => client.decisions.extractDrafts(transcriptionSessionId),
|
|
56
61
|
}),
|
|
57
62
|
create: op({
|
|
63
|
+
effect: 'write',
|
|
58
64
|
summary: 'Log a decision (status defaults to PROPOSED). Pass status "OPEN" for an open question and transcriptionSessionId to attach it to a meeting.',
|
|
59
65
|
params: z.object({
|
|
60
66
|
workspaceId,
|
|
@@ -96,6 +102,7 @@ export const decisions = {
|
|
|
96
102
|
run: (client, params) => client.decisions.create(params),
|
|
97
103
|
}),
|
|
98
104
|
update: op({
|
|
105
|
+
effect: 'write',
|
|
99
106
|
summary: 'Edit a decision’s content and scope. Only the fields you pass change; status goes through set_status.',
|
|
100
107
|
params: z.object({
|
|
101
108
|
workspaceId,
|
|
@@ -110,6 +117,7 @@ export const decisions = {
|
|
|
110
117
|
run: (client, params) => client.decisions.update(params),
|
|
111
118
|
}),
|
|
112
119
|
set_status: op({
|
|
120
|
+
effect: 'write',
|
|
113
121
|
summary: 'Lifecycle transition — e.g. answer an open question by moving OPEN → ACCEPTED.',
|
|
114
122
|
params: z.object({
|
|
115
123
|
workspaceId,
|
|
@@ -124,16 +132,19 @@ export const decisions = {
|
|
|
124
132
|
run: (client, params) => client.decisions.setStatus(params),
|
|
125
133
|
}),
|
|
126
134
|
link_ticket: op({
|
|
135
|
+
effect: 'write',
|
|
127
136
|
summary: 'Mark a decision as "implemented by" a ticket. Idempotent: an existing link is returned.',
|
|
128
137
|
params: z.object({ workspaceId, decisionId, ticketId: id('Ticket') }),
|
|
129
138
|
run: (client, { workspaceId, decisionId, ticketId }) => client.decisions.linkTicket(workspaceId, decisionId, ticketId),
|
|
130
139
|
}),
|
|
131
140
|
link_feature: op({
|
|
141
|
+
effect: 'write',
|
|
132
142
|
summary: 'Mark a decision as "implemented by" a feature. Idempotent: an existing link is returned.',
|
|
133
143
|
params: z.object({ workspaceId, decisionId, featureId: id('Feature') }),
|
|
134
144
|
run: (client, { workspaceId, decisionId, featureId }) => client.decisions.linkFeature(workspaceId, decisionId, featureId),
|
|
135
145
|
}),
|
|
136
146
|
unlink: op({
|
|
147
|
+
effect: 'write',
|
|
137
148
|
summary: 'Remove one ticket/feature link.',
|
|
138
149
|
params: z.object({
|
|
139
150
|
workspaceId,
|
|
@@ -142,16 +153,19 @@ export const decisions = {
|
|
|
142
153
|
run: (client, { workspaceId, linkId }) => client.decisions.unlink(workspaceId, linkId),
|
|
143
154
|
}),
|
|
144
155
|
confirm_draft: op({
|
|
156
|
+
effect: 'write',
|
|
145
157
|
summary: 'Publish a DRAFT decision into the log.',
|
|
146
158
|
params: z.object({ workspaceId, decisionId }),
|
|
147
159
|
run: (client, { workspaceId, decisionId }) => client.decisions.confirmDraft(workspaceId, decisionId),
|
|
148
160
|
}),
|
|
149
161
|
reject_draft: op({
|
|
162
|
+
effect: 'write',
|
|
150
163
|
summary: 'Reject a DRAFT decision. Confirmed decisions cannot be rejected — deprecate or supersede via set_status.',
|
|
151
164
|
params: z.object({ workspaceId, decisionId }),
|
|
152
165
|
run: (client, { workspaceId, decisionId }) => client.decisions.rejectDraft(workspaceId, decisionId),
|
|
153
166
|
}),
|
|
154
167
|
delete_draft: op({
|
|
168
|
+
effect: 'delete',
|
|
155
169
|
summary: 'Hard-delete a draft or rejected decision. Refused for confirmed decisions — the log keeps its history.',
|
|
156
170
|
params: z.object({ workspaceId, decisionId }),
|
|
157
171
|
run: (client, { workspaceId, decisionId }) => client.decisions.deleteDraft(workspaceId, decisionId),
|
package/dist/domains/epics.js
CHANGED
|
@@ -7,6 +7,7 @@ export const epics = {
|
|
|
7
7
|
description: 'Epics: large bodies of work in a workspace that group tickets (`tickets`) and actions (`actions`). Each new epic belongs to a product (`products`); older ones may have none.',
|
|
8
8
|
operations: {
|
|
9
9
|
list: op({
|
|
10
|
+
effect: 'read',
|
|
10
11
|
summary: 'List the epics in a workspace (all products), ordered by status then name.',
|
|
11
12
|
params: z.object({
|
|
12
13
|
workspaceId,
|
|
@@ -15,11 +16,13 @@ export const epics = {
|
|
|
15
16
|
run: (client, params) => client.epics.list(params),
|
|
16
17
|
}),
|
|
17
18
|
get: op({
|
|
19
|
+
effect: 'read',
|
|
18
20
|
summary: 'Get one epic with its owner, tickets and actions.',
|
|
19
21
|
params: z.object({ id: id('Epic') }),
|
|
20
22
|
run: (client, { id }) => client.epics.get(id),
|
|
21
23
|
}),
|
|
22
24
|
create: op({
|
|
25
|
+
effect: 'write',
|
|
23
26
|
summary: 'Create an epic owned by you. Priority defaults to MEDIUM.',
|
|
24
27
|
params: z.object({
|
|
25
28
|
workspaceId,
|
|
@@ -33,6 +36,7 @@ export const epics = {
|
|
|
33
36
|
run: (client, params) => client.epics.create(params),
|
|
34
37
|
}),
|
|
35
38
|
update: op({
|
|
39
|
+
effect: 'write',
|
|
36
40
|
summary: 'Update an epic. Only the fields you pass change.',
|
|
37
41
|
params: z.object({
|
|
38
42
|
id: id('Epic'),
|
|
@@ -46,6 +50,7 @@ export const epics = {
|
|
|
46
50
|
run: (client, params) => client.epics.update(params),
|
|
47
51
|
}),
|
|
48
52
|
delete: op({
|
|
53
|
+
effect: 'delete',
|
|
49
54
|
summary: 'Delete an epic permanently (only its owner or a workspace owner/admin may). Its tickets and actions are kept but unlinked.',
|
|
50
55
|
params: z.object({ id: id('Epic') }),
|
|
51
56
|
run: (client, { id }) => client.epics.delete(id),
|
package/dist/domains/features.js
CHANGED
|
@@ -15,6 +15,7 @@ export const features = {
|
|
|
15
15
|
description: 'Product features: long-lived capabilities of a product (see `products`), filed under an area (`areas`). A feature’s shippable increments are in `scopes`, its "shall" statements in `requirements`, and its spec documents are Knowledge pages (`pages`) linked here.',
|
|
16
16
|
operations: {
|
|
17
17
|
list: op({
|
|
18
|
+
effect: 'read',
|
|
18
19
|
summary: 'List a product’s features, newest first, with goal, area, lean key-result links and scope/requirement/ticket counts.',
|
|
19
20
|
params: z.object({
|
|
20
21
|
productId: id('Product'),
|
|
@@ -23,11 +24,13 @@ export const features = {
|
|
|
23
24
|
run: (client, params) => client.features.list(params),
|
|
24
25
|
}),
|
|
25
26
|
get: op({
|
|
27
|
+
effect: 'read',
|
|
26
28
|
summary: 'Get one feature with its scopes, requirements and key-result progress.',
|
|
27
29
|
params: z.object({ id: id('Feature') }),
|
|
28
30
|
run: (client, { id }) => client.features.get(id),
|
|
29
31
|
}),
|
|
30
32
|
create: op({
|
|
33
|
+
effect: 'write',
|
|
31
34
|
summary: 'Create a feature in a product. Status defaults to IDEA.',
|
|
32
35
|
params: z.object({
|
|
33
36
|
productId: id('Product'),
|
|
@@ -43,6 +46,7 @@ export const features = {
|
|
|
43
46
|
run: (client, params) => client.features.create(params),
|
|
44
47
|
}),
|
|
45
48
|
update: op({
|
|
49
|
+
effect: 'write',
|
|
46
50
|
summary: 'Update a feature. Only the fields you pass change; a feature that was ever live cannot be ARCHIVED (deprecate it instead).',
|
|
47
51
|
params: z.object({
|
|
48
52
|
id: id('Feature'),
|
|
@@ -61,11 +65,13 @@ export const features = {
|
|
|
61
65
|
run: (client, params) => client.features.update(params),
|
|
62
66
|
}),
|
|
63
67
|
delete: op({
|
|
68
|
+
effect: 'delete',
|
|
64
69
|
summary: 'Delete a feature permanently, cascading its scopes, requirements, user stories, comments and page links; linked tickets are kept but unlinked.',
|
|
65
70
|
params: z.object({ id: id('Feature') }),
|
|
66
71
|
run: (client, { id }) => client.features.delete(id),
|
|
67
72
|
}),
|
|
68
73
|
link_page: op({
|
|
74
|
+
effect: 'write',
|
|
69
75
|
summary: 'Link a Knowledge page (PRD, spec, research) to a feature. Idempotent: re-linking updates the scope pin. Page must be in the feature’s workspace.',
|
|
70
76
|
params: z.object({
|
|
71
77
|
featureId: id('Feature'),
|
|
@@ -78,6 +84,7 @@ export const features = {
|
|
|
78
84
|
run: (client, params) => client.features.linkPage(params),
|
|
79
85
|
}),
|
|
80
86
|
unlink_page: op({
|
|
87
|
+
effect: 'write',
|
|
81
88
|
summary: 'Unlink a page from a feature. The page itself is not deleted; no-op if not linked.',
|
|
82
89
|
params: z.object({
|
|
83
90
|
featureId: id('Feature'),
|
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
12
12
|
import type { ExponentialClient } from 'exponential-sdk';
|
|
13
|
+
/**
|
|
14
|
+
* What an operation does to data. `read` changes nothing; `write` creates or
|
|
15
|
+
* changes something; `delete` removes something. Drives the tool annotations.
|
|
16
|
+
*/
|
|
17
|
+
export type Effect = 'read' | 'write' | 'delete';
|
|
13
18
|
export interface Operation<S extends z.AnyZodObject = z.AnyZodObject> {
|
|
19
|
+
effect: Effect;
|
|
14
20
|
/** One line: what the operation does and anything surprising about it. */
|
|
15
21
|
summary: string;
|
|
16
22
|
params: S;
|
|
@@ -30,5 +36,10 @@ export declare const id: (what: string) => z.ZodString;
|
|
|
30
36
|
export declare const workspaceId: z.ZodString;
|
|
31
37
|
/** ISO date or datetime; coerced to a Date before it reaches the SDK. */
|
|
32
38
|
export declare const date: (what: string) => z.ZodDate;
|
|
39
|
+
/**
|
|
40
|
+
* A domain tool is read-only only when every operation reads, and destructive
|
|
41
|
+
* when any operation deletes.
|
|
42
|
+
*/
|
|
43
|
+
export declare function domainAnnotations(domain: Domain): NonNullable<Tool['annotations']>;
|
|
33
44
|
export declare function toolDefinition(domain: Domain): Tool;
|
|
34
45
|
export declare function runDomainTool(domain: Domain, client: ExponentialClient, args: Record<string, unknown> | undefined): Promise<unknown>;
|