@tacitai/mcp-server 0.6.50 → 0.6.53

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.
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Capture tools — MV-1537 S3.5: Link Library capture operations exposed as MCP tools.
3
+ *
4
+ * 7 tools:
5
+ * READ: tacit_capture_find, tacit_capture_synthesize
6
+ * WRITE: tacit_capture_save, tacit_capture_remove, tacit_capture_restore,
7
+ * tacit_capture_note, tacit_capture_place
8
+ *
9
+ * All gated on FEATURE_GM_CAPTURE via the backend (returns 404 FEATURE_DISABLED
10
+ * when off). The featureDisabledResult helper surfaces that cleanly.
11
+ */
12
+ import { z } from 'zod';
13
+ import { TacitApiError, TokenExpiredError } from '../client.js';
14
+ import { featureDisabledResult } from './errors.js';
15
+ function apiErrorResult(err, toolName) {
16
+ if (err instanceof TokenExpiredError) {
17
+ return { content: [{ type: 'text', text: err.message }], isError: true };
18
+ }
19
+ if (err instanceof TacitApiError) {
20
+ const disabled = featureDisabledResult(err);
21
+ if (disabled)
22
+ return disabled;
23
+ return { content: [{ type: 'text', text: `API error ${err.statusCode} on ${toolName}: ${err.body}` }], isError: true };
24
+ }
25
+ const msg = err instanceof Error ? err.message : String(err);
26
+ return { content: [{ type: 'text', text: `Error: ${msg}` }], isError: true };
27
+ }
28
+ // ─── Schemas ────────────────────────────────────────────────────────────────
29
+ const captureSaveSchema = z.object({
30
+ url: z.string().optional().describe('Single URL to save'),
31
+ urls: z.array(z.string()).optional().describe('Multiple URLs to save (max 5)'),
32
+ title: z.string().optional().describe('Title override (auto-fetched if omitted)'),
33
+ note: z.string().optional().describe('Personal note to attach (optional)'),
34
+ tags: z.array(z.string()).optional().describe('Tags for categorisation'),
35
+ request_key: z.string().optional().describe('Idempotency key to prevent duplicate saves'),
36
+ door: z.string().optional().describe('Source door identifier (e.g. "mcp", "telegram")'),
37
+ subject_person_ids: z.array(z.string().uuid()).optional().describe('Person UUIDs this link is about'),
38
+ });
39
+ const captureRemoveSchema = z.object({
40
+ link_id: z.string().uuid().describe('UUID of the saved link to soft-delete'),
41
+ });
42
+ const captureRestoreSchema = z.object({
43
+ link_id: z.string().uuid().describe('UUID of the saved link to restore'),
44
+ });
45
+ const captureNoteSchema = z.object({
46
+ note_id: z.string().uuid().describe('UUID of the note'),
47
+ action: z.enum(['edit', 'remove']).describe('"edit" to update content, "remove" to delete the note'),
48
+ content: z.string().optional().describe('New note content (required for action=edit)'),
49
+ });
50
+ const captureFindSchema = z.object({
51
+ query: z.string().optional().describe('Free-text search query'),
52
+ status: z.enum(['active', 'removed', 'all']).optional().describe('Filter by link status (default: active)'),
53
+ tags: z.array(z.string()).optional().describe('Filter by tags (AND match)'),
54
+ limit: z.number().int().min(1).max(100).optional().describe('Max results (default 20)'),
55
+ offset: z.number().int().min(0).optional().describe('Pagination offset'),
56
+ });
57
+ const capturePlaceSchema = z.object({
58
+ link_id: z.string().uuid().describe('UUID of the saved link to place'),
59
+ kb_collection_ids: z.array(z.string().uuid()).optional().describe('KB collection UUIDs to add the link to'),
60
+ dossier_ids: z.array(z.string().uuid()).optional().describe('Dossier UUIDs to add the link to'),
61
+ remove_from_kb: z.array(z.string().uuid()).optional().describe('KB collection UUIDs to remove the link from'),
62
+ remove_from_dossier: z.array(z.string().uuid()).optional().describe('Dossier UUIDs to remove the link from'),
63
+ });
64
+ const captureSynthesizeSchema = z.object({
65
+ query: z.string().min(1).describe('What to synthesize from saved links'),
66
+ by: z.enum(['me', 'anyone']).optional().describe('Whose saved links to include (default: me)'),
67
+ scope_name: z.string().optional().describe('Scope expression (e.g. "in kb:Sales", "in pyramid")'),
68
+ placement_scope: z.enum(['KB', 'PYRAMID', 'BOTH']).optional().describe('Retrieval scope filter'),
69
+ });
70
+ // ─── Registration ───────────────────────────────────────────────────────────
71
+ export function registerCaptureTools(server, getClientFn) {
72
+ // ── tacit_capture_save ──────────────────────────────────────────────────
73
+ server.tool('tacit_capture_save', 'Save one or more URLs to the link library with an optional note. Creates saved_link records, indexes for retrieval, and returns link_id(s). Pass url for a single link or urls for up to 5.', captureSaveSchema.shape, async (args) => {
74
+ try {
75
+ const client = await getClientFn();
76
+ const input = args;
77
+ const body = {};
78
+ if (input.url)
79
+ body['url'] = input.url;
80
+ if (input.urls)
81
+ body['urls'] = input.urls;
82
+ if (input.title)
83
+ body['title'] = input.title;
84
+ if (input.note)
85
+ body['note'] = input.note;
86
+ if (input.tags)
87
+ body['tags'] = input.tags;
88
+ if (input.request_key)
89
+ body['request_key'] = input.request_key;
90
+ if (input.door)
91
+ body['door'] = input.door;
92
+ else
93
+ body['door'] = 'mcp';
94
+ if (input.subject_person_ids)
95
+ body['subject_person_ids'] = input.subject_person_ids;
96
+ const res = await client.request('POST', '/api/v1/gm/capture', body);
97
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
98
+ }
99
+ catch (err) {
100
+ return apiErrorResult(err, 'tacit_capture_save');
101
+ }
102
+ });
103
+ // ── tacit_capture_remove ────────────────────────────────────────────────
104
+ server.tool('tacit_capture_remove', 'Soft-delete a saved link. Removes it from search indexes immediately. Can be restored later.', captureRemoveSchema.shape, async (args) => {
105
+ try {
106
+ const client = await getClientFn();
107
+ const { link_id } = args;
108
+ const res = await client.request('POST', `/api/v1/gm/capture/${link_id}/remove`, {});
109
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
110
+ }
111
+ catch (err) {
112
+ return apiErrorResult(err, 'tacit_capture_remove');
113
+ }
114
+ });
115
+ // ── tacit_capture_restore ───────────────────────────────────────────────
116
+ server.tool('tacit_capture_restore', 'Restore a previously removed saved link. Re-indexes it for retrieval.', captureRestoreSchema.shape, async (args) => {
117
+ try {
118
+ const client = await getClientFn();
119
+ const { link_id } = args;
120
+ const res = await client.request('POST', `/api/v1/gm/capture/${link_id}/restore`, {});
121
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
122
+ }
123
+ catch (err) {
124
+ return apiErrorResult(err, 'tacit_capture_restore');
125
+ }
126
+ });
127
+ // ── tacit_capture_note ──────────────────────────────────────────────────
128
+ server.tool('tacit_capture_note', 'Edit or remove a note on a saved link. Use action="edit" with content to update, or action="remove" to delete the note.', captureNoteSchema.shape, async (args) => {
129
+ try {
130
+ const client = await getClientFn();
131
+ const input = args;
132
+ if (input.action === 'edit') {
133
+ if (!input.content) {
134
+ return { content: [{ type: 'text', text: 'Error: content is required for action=edit' }], isError: true };
135
+ }
136
+ const res = await client.request('POST', `/api/v1/gm/capture/notes/${input.note_id}/edit`, { new_text: input.content });
137
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
138
+ }
139
+ else {
140
+ const res = await client.request('POST', `/api/v1/gm/capture/notes/${input.note_id}/remove`, {});
141
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
142
+ }
143
+ }
144
+ catch (err) {
145
+ return apiErrorResult(err, 'tacit_capture_note');
146
+ }
147
+ });
148
+ // ── tacit_capture_find ──────────────────────────────────────────────────
149
+ server.tool('tacit_capture_find', 'Search saved links with optional query, tag, and status filters. Returns grouped results with notes, tags, KB placements, and dossier references.', captureFindSchema.shape, async (args) => {
150
+ try {
151
+ const client = await getClientFn();
152
+ const input = args;
153
+ const body = {};
154
+ if (input.query)
155
+ body['query'] = input.query;
156
+ if (input.status)
157
+ body['status'] = input.status;
158
+ if (input.tags)
159
+ body['tags'] = input.tags;
160
+ if (input.limit !== undefined)
161
+ body['limit'] = input.limit;
162
+ if (input.offset !== undefined)
163
+ body['offset'] = input.offset;
164
+ const res = await client.request('POST', '/api/v1/gm/capture/find', body);
165
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
166
+ }
167
+ catch (err) {
168
+ return apiErrorResult(err, 'tacit_capture_find');
169
+ }
170
+ });
171
+ // ── tacit_capture_place ─────────────────────────────────────────────────
172
+ server.tool('tacit_capture_place', 'Place a saved link into KB collections and/or dossiers. Can also remove from existing placements.', capturePlaceSchema.shape, async (args) => {
173
+ try {
174
+ const client = await getClientFn();
175
+ const input = args;
176
+ const body = {};
177
+ if (input.kb_collection_ids)
178
+ body['kb_collection_ids'] = input.kb_collection_ids;
179
+ if (input.dossier_ids)
180
+ body['dossier_ids'] = input.dossier_ids;
181
+ if (input.remove_from_kb)
182
+ body['remove_from_kb'] = input.remove_from_kb;
183
+ if (input.remove_from_dossier)
184
+ body['remove_from_dossier'] = input.remove_from_dossier;
185
+ const res = await client.request('POST', `/api/v1/gm/capture/${input.link_id}/place`, body);
186
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
187
+ }
188
+ catch (err) {
189
+ return apiErrorResult(err, 'tacit_capture_place');
190
+ }
191
+ });
192
+ // ── tacit_capture_synthesize ────────────────────────────────────────────
193
+ server.tool('tacit_capture_synthesize', 'Synthesize an answer from saved links only. Scopes retrieval to the caller\'s saved items (or all workspace saves with by=anyone). Supports scope_name for further filtering.', captureSynthesizeSchema.shape, async (args) => {
194
+ try {
195
+ const client = await getClientFn();
196
+ const input = args;
197
+ const body = {
198
+ query: input.query,
199
+ saved_items: { by: input.by ?? 'me' },
200
+ };
201
+ if (input.scope_name)
202
+ body['scope_name'] = input.scope_name;
203
+ if (input.placement_scope)
204
+ body['placement_scope'] = input.placement_scope;
205
+ const res = await client.request('POST', '/api/v1/mind/synthesize', body);
206
+ return { content: [{ type: 'text', text: JSON.stringify(res, null, 2) }] };
207
+ }
208
+ catch (err) {
209
+ return apiErrorResult(err, 'tacit_capture_synthesize');
210
+ }
211
+ });
212
+ }
@@ -11,14 +11,14 @@ const ROLE_ROUTES = [
11
11
  {
12
12
  slug: 'general_manager',
13
13
  present_as: 'General Manager',
14
- workflow_type: 'gm_operations',
14
+ workflow_type: 'gm_content_placement',
15
15
  keywords: ['file this', 'save this', 'ingest', 'place this', 'store', 'catalog', 'route content', 'gm'],
16
16
  description: 'Routes and places content into the data lake, KB, or pyramid. The default for "do something with this content."',
17
17
  },
18
18
  {
19
19
  slug: 'chief_of_staff',
20
20
  present_as: 'Chief of Staff',
21
- workflow_type: 'cos_operations',
21
+ workflow_type: 'cos_coordination',
22
22
  keywords: ['morning brief', 'daily brief', 'triage', 'email', 'meeting prep', 'agenda', 'schedule', 'priorities'],
23
23
  description: 'Daily operations, briefings, meeting prep, email triage, priority management.',
24
24
  },
@@ -32,45 +32,59 @@ const ROLE_ROUTES = [
32
32
  {
33
33
  slug: 'pyramid_executor',
34
34
  present_as: 'Pyramid Executor',
35
- workflow_type: 'pyramid_operations',
35
+ workflow_type: 'pyr_exec',
36
36
  keywords: ['portfolio', 'program', 'value stream', 'dossier', 'alignment', 'strategic', 'pyramid'],
37
37
  description: 'Manages the organizational pyramid: portfolios, programs, value streams, dossiers.',
38
38
  },
39
39
  {
40
40
  slug: 'cmo_marketer',
41
41
  present_as: 'CMO Marketer',
42
- workflow_type: 'cmo_operations',
42
+ workflow_type: 'cmo_marketing_pipeline',
43
43
  keywords: ['marketing', 'campaign', 'brand', 'content strategy', 'social media', 'positioning', 'messaging'],
44
44
  description: 'Marketing campaigns, brand strategy, content creation, positioning.',
45
45
  },
46
46
  {
47
47
  slug: 'sales_executor',
48
48
  present_as: 'Sales Executor',
49
- workflow_type: 'sales_operations',
49
+ workflow_type: 'sales_full_pipeline',
50
50
  keywords: ['sales', 'pipeline', 'proposal', 'discovery', 'prospect', 'lead', 'deal', 'quote', 'revenue'],
51
51
  description: 'Sales pipeline, proposals, discovery calls, prospecting, deal management.',
52
52
  },
53
53
  {
54
54
  slug: 'researcher',
55
55
  present_as: 'Research Analyst',
56
- workflow_type: 'cos_coordination',
56
+ workflow_type: 'research_deep_dive',
57
57
  keywords: ['research', 'competitors', 'competitive analysis', 'market research', 'industry analysis', 'state of the art', 'benchmark'],
58
58
  description: 'Prepares research briefs using tacit_research_prepare. For deep research topics, competitor analysis, and industry surveys.',
59
59
  },
60
60
  {
61
61
  slug: 'wiki_editor',
62
62
  present_as: 'Wiki Editor',
63
- workflow_type: 'wiki_operations',
63
+ workflow_type: 'wiki_authoring',
64
64
  keywords: ['wiki', 'article', 'publish to wiki', 'documentation', 'wiki write'],
65
65
  description: 'Authors and publishes wiki articles. Wiki writes require approval.',
66
66
  },
67
67
  {
68
68
  slug: 'kb_curator',
69
69
  present_as: 'KB Curator',
70
- workflow_type: 'kb_operations',
70
+ workflow_type: 'kb_management',
71
71
  keywords: ['knowledge base', 'kb article', 'organize knowledge', 'kb collection', 'kb category'],
72
72
  description: 'Manages the knowledge base: articles, collections, categories, source registration.',
73
73
  },
74
+ {
75
+ slug: 'cto_engineer',
76
+ present_as: 'CTO Engineering',
77
+ workflow_type: 'cto_engineering',
78
+ keywords: ['new exec role', 'new executive role', 'create a role', 'design a new workflow', 'engineering architecture', 'new skill', 'role creation', 'enforcement type', 'agentic engineering', 'build a new exec'],
79
+ description: 'Engineering organization: new exec role creation, skill architecture, enforcement type design. Routes to Agentic Engineering Exec.',
80
+ },
81
+ {
82
+ slug: 'secretary',
83
+ present_as: 'Secretary',
84
+ workflow_type: 'secretary_chronicle',
85
+ keywords: ['log decision', 'log meeting', 'meeting notes', 'action items', 'what decisions', 'decision history', 'retro', 'retrospective', 'log blocker', 'status update'],
86
+ description: 'Natural language Chronicle event management: log decisions, meetings, action items, blockers, and recall event history.',
87
+ },
74
88
  {
75
89
  slug: 'lake_operator',
76
90
  present_as: 'Lake Operator',
@@ -78,6 +92,20 @@ const ROLE_ROUTES = [
78
92
  keywords: ['data source', 'data lake', 'classify', 'taxonomy', 'catalog', 'connector', 'sync'],
79
93
  description: 'Manages the data lake: sources, classification, taxonomy, connectors, sync.',
80
94
  },
95
+ {
96
+ slug: 'access_administrator',
97
+ present_as: 'Access Administrator',
98
+ workflow_type: 'iam_membership_ops',
99
+ keywords: ['grant membership', 'revoke membership', 'change role', 'offboard', 'reactivate', 'access report', 'capability denial'],
100
+ description: 'Manages workspace membership, role assignments, and capability denials via IAM tools.',
101
+ },
102
+ {
103
+ slug: 'security_officer',
104
+ present_as: 'Security Officer',
105
+ workflow_type: 'security_audit',
106
+ keywords: ['secret inventory', 'rotate secret', 'credential', 'token management', 'approval', 't3'],
107
+ description: 'Manages credential inventory, rotation tracking, and T3 approval workflows.',
108
+ },
81
109
  ];
82
110
  function matchRole(request) {
83
111
  const lower = request.toLowerCase();
@@ -110,7 +138,19 @@ function matchRole(request) {
110
138
  }
111
139
  function buildScript(role) {
112
140
  const steps = [];
113
- if (role.workflow_type === 'cos_coordination' && role.slug === 'researcher') {
141
+ if (role.workflow_type === 'cto_engineering') {
142
+ steps.push('CTO routes to the Agentic Engineering Exec. Call tacit_agent_delegate with role_slug="cto_engineer" and describe the engineering request.');
143
+ steps.push('For new role creation: the AE Exec workflow guides through domain analysis → enforcement type selection → registration → verification.');
144
+ steps.push('Check tacit_workflow_prereqs if a tool returns a workflow block — it shows required prior steps.');
145
+ return steps;
146
+ }
147
+ if (role.workflow_type === 'secretary_chronicle') {
148
+ steps.push('Call tacit_secretary_log to record events from natural language, or tacit_secretary_recall to search event history.');
149
+ steps.push('Secretary auto-classifies event types (decision, meeting, action item, blocker, etc.) from your description.');
150
+ steps.push('For decision history: tacit_secretary_recall follows override chains to show how decisions evolved.');
151
+ return steps;
152
+ }
153
+ if (role.workflow_type === 'research_deep_dive' && role.slug === 'researcher') {
114
154
  steps.push('Call tacit_research_prepare with the research topic instead of tacit_agent_delegate.');
115
155
  steps.push('Review the prepared context, then call tacit_research_launch to execute the research.');
116
156
  steps.push('Check tacit_workflow_prereqs if a tool returns a workflow block — it shows required prior steps.');
@@ -118,19 +158,27 @@ function buildScript(role) {
118
158
  }
119
159
  steps.push(`Call tacit_agent_delegate with role_slug="${role.slug}" and your task description.`);
120
160
  steps.push('The delegation returns agent_id and run_id. Use tacit_agent_status with both to check progress and retrieve results.');
121
- if (role.workflow_type === 'gm_operations') {
161
+ if (role.workflow_type === 'gm_content_placement') {
122
162
  steps.push('For content placement: call tacit_gm_ingest first, then tacit_gm_approve to confirm placement.');
123
163
  }
124
- else if (role.workflow_type === 'wiki_operations') {
164
+ else if (role.workflow_type === 'wiki_authoring') {
125
165
  steps.push('Wiki writes require approval. The workflow enforces: draft → review → approve → publish.');
126
166
  }
127
- else if (role.workflow_type === 'pyramid_operations') {
167
+ else if (role.workflow_type === 'pyr_exec') {
128
168
  steps.push('Use tacit_pyramid_list_portfolios to see the current structure before making changes.');
129
169
  }
130
- if (role.workflow_type === 'cos_operations' || role.workflow_type === 'sales_operations') {
170
+ if (role.workflow_type === 'cos_coordination' || role.workflow_type === 'sales_full_pipeline') {
131
171
  steps.push('While synthesizing, emit brief terminal progress updates so the user knows the system is working.');
132
172
  steps.push('Present the final report as a designed HTML artifact — invoke /artifact-design for the appropriate treatment, publish with the Artifact tool, and open it in the browser automatically.');
133
173
  }
174
+ if (role.workflow_type === 'iam_membership_ops') {
175
+ steps.push('Use tacit_agent_delegate to the access_administrator role.');
176
+ steps.push('IAM tools: iam_grant_membership, iam_revoke_membership, iam_change_role, iam_offboard_member, iam_reactivate_identity, iam_access_report.');
177
+ }
178
+ if (role.workflow_type === 'security_audit') {
179
+ steps.push('Use tacit_agent_delegate to the security_officer role.');
180
+ steps.push('Security tools: security_secret_inventory, security_rotate_secret, iam_create_approval, iam_token_management.');
181
+ }
134
182
  steps.push('Check tacit_workflow_prereqs if a tool returns a workflow block — it shows required prior steps.');
135
183
  return steps;
136
184
  }
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { TacitClient } from '../client.js';
3
+ export declare function registerIamTools(server: McpServer, getClient: () => Promise<TacitClient>): void;
4
+ export declare function registerSecurityTools(server: McpServer, getClient: () => Promise<TacitClient>): void;
@@ -0,0 +1,194 @@
1
+ import { z } from 'zod';
2
+ import { success, apiErrorResult } from './errors.js';
3
+ export function registerIamTools(server, getClient) {
4
+ server.tool('tacit_iam_grant_membership', 'Add a member to the workspace with an optional role, display name, and initial PIN', {
5
+ email: z.string().describe('Email address of the new member'),
6
+ role: z.string().optional().describe('Role to assign (e.g. "member", "admin")'),
7
+ display_name: z.string().optional().describe('Display name for the member'),
8
+ initial_pin: z.string().optional().describe('Initial login PIN'),
9
+ }, async (args) => {
10
+ try {
11
+ const client = await getClient();
12
+ const res = await client.request('POST', '/api/v1/iam/members', args);
13
+ return success(res);
14
+ }
15
+ catch (err) {
16
+ return apiErrorResult(err, 'POST /api/v1/iam/members');
17
+ }
18
+ });
19
+ server.tool('tacit_iam_revoke_membership', 'Remove a member from the workspace', {
20
+ user_id: z.string().describe('ID of the user to remove'),
21
+ }, async (args) => {
22
+ try {
23
+ const client = await getClient();
24
+ const res = await client.request('DELETE', `/api/v1/iam/members/${args.user_id}`);
25
+ return success(res);
26
+ }
27
+ catch (err) {
28
+ return apiErrorResult(err, `DELETE /api/v1/iam/members/${args.user_id}`);
29
+ }
30
+ });
31
+ server.tool('tacit_iam_change_role', 'Change the role of a workspace member', {
32
+ user_id: z.string().describe('ID of the user whose role to change'),
33
+ new_role: z.string().describe('New role to assign'),
34
+ }, async (args) => {
35
+ try {
36
+ const client = await getClient();
37
+ const res = await client.request('PUT', `/api/v1/iam/members/${args.user_id}/role`, {
38
+ new_role: args.new_role,
39
+ });
40
+ return success(res);
41
+ }
42
+ catch (err) {
43
+ return apiErrorResult(err, `PUT /api/v1/iam/members/${args.user_id}/role`);
44
+ }
45
+ });
46
+ server.tool('tacit_iam_offboard_member', 'Offboard a member from the workspace (requires approval proof)', {
47
+ user_id: z.string().describe('ID of the user to offboard'),
48
+ approval_proof: z.string().describe('Approval proof token from tacit_iam_create_approval'),
49
+ reason: z.string().optional().describe('Reason for offboarding'),
50
+ }, async (args) => {
51
+ try {
52
+ const client = await getClient();
53
+ const res = await client.request('POST', `/api/v1/iam/members/${args.user_id}/offboard`, {
54
+ approval_proof: args.approval_proof,
55
+ reason: args.reason,
56
+ });
57
+ return success(res);
58
+ }
59
+ catch (err) {
60
+ return apiErrorResult(err, `POST /api/v1/iam/members/${args.user_id}/offboard`);
61
+ }
62
+ });
63
+ server.tool('tacit_iam_transfer_ownership', 'Transfer workspace ownership to another member (requires approval proof)', {
64
+ target_user_id: z.string().describe('ID of the user to transfer ownership to'),
65
+ approval_proof: z.string().describe('Approval proof token from tacit_iam_create_approval'),
66
+ }, async (args) => {
67
+ try {
68
+ const client = await getClient();
69
+ const res = await client.request('POST', '/api/v1/iam/transfer-ownership', args);
70
+ return success(res);
71
+ }
72
+ catch (err) {
73
+ return apiErrorResult(err, 'POST /api/v1/iam/transfer-ownership');
74
+ }
75
+ });
76
+ server.tool('tacit_iam_access_report', 'Generate an access report for all members in the workspace', {}, async () => {
77
+ try {
78
+ const client = await getClient();
79
+ const res = await client.request('GET', '/api/v1/iam/access-report');
80
+ return success(res);
81
+ }
82
+ catch (err) {
83
+ return apiErrorResult(err, 'GET /api/v1/iam/access-report');
84
+ }
85
+ });
86
+ server.tool('tacit_iam_token_management', 'Manage API tokens: list, issue, rotate, or revoke', {
87
+ action: z.enum(['list', 'issue', 'rotate', 'revoke']).describe('Token action to perform'),
88
+ target_identity_id: z.string().optional().describe('Identity ID to target (for issue/rotate/revoke)'),
89
+ token_id: z.string().optional().describe('Specific token ID (for rotate/revoke)'),
90
+ }, async (args) => {
91
+ try {
92
+ const client = await getClient();
93
+ const res = await client.request('POST', '/api/v1/iam/tokens', args);
94
+ return success(res);
95
+ }
96
+ catch (err) {
97
+ return apiErrorResult(err, 'POST /api/v1/iam/tokens');
98
+ }
99
+ });
100
+ server.tool('tacit_iam_create_approval', 'Create an approval proof for a sensitive operation (offboard, transfer ownership)', {
101
+ operation_type: z.string().describe('Type of operation requiring approval'),
102
+ target_user_id: z.string().describe('ID of the user the operation targets'),
103
+ pin: z.string().describe('Caller PIN for verification'),
104
+ }, async (args) => {
105
+ try {
106
+ const client = await getClient();
107
+ const res = await client.request('POST', '/api/v1/iam/approvals', args);
108
+ return success(res);
109
+ }
110
+ catch (err) {
111
+ return apiErrorResult(err, 'POST /api/v1/iam/approvals');
112
+ }
113
+ });
114
+ server.tool('tacit_iam_identity_recovery', 'Initiate identity recovery for a user by email (public endpoint)', {
115
+ email: z.string().describe('Email address of the identity to recover'),
116
+ }, async (args) => {
117
+ try {
118
+ const client = await getClient();
119
+ const res = await client.request('POST', '/api/v1/iam/identity-recovery', args);
120
+ return success(res);
121
+ }
122
+ catch (err) {
123
+ return apiErrorResult(err, 'POST /api/v1/iam/identity-recovery');
124
+ }
125
+ });
126
+ server.tool('tacit_iam_reactivate_identity', 'Reactivate a previously deactivated member', {
127
+ user_id: z.string().describe('ID of the user to reactivate'),
128
+ }, async (args) => {
129
+ try {
130
+ const client = await getClient();
131
+ const res = await client.request('POST', `/api/v1/iam/members/${args.user_id}/reactivate`);
132
+ return success(res);
133
+ }
134
+ catch (err) {
135
+ return apiErrorResult(err, `POST /api/v1/iam/members/${args.user_id}/reactivate`);
136
+ }
137
+ });
138
+ }
139
+ export function registerSecurityTools(server, getClient) {
140
+ server.tool('tacit_security_access_review', 'Security-grade access review: members, roles, and capability denials', {}, async () => {
141
+ try {
142
+ const client = await getClient();
143
+ const res = await client.request('GET', '/api/v1/iam/access-report');
144
+ return success(res);
145
+ }
146
+ catch (err) {
147
+ return apiErrorResult(err, 'GET /api/v1/iam/access-report');
148
+ }
149
+ });
150
+ server.tool('tacit_security_secret_inventory', 'List all managed secrets in the workspace', {}, async () => {
151
+ try {
152
+ const client = await getClient();
153
+ const res = await client.request('GET', '/api/v1/iam/secrets');
154
+ return success(res);
155
+ }
156
+ catch (err) {
157
+ return apiErrorResult(err, 'GET /api/v1/iam/secrets');
158
+ }
159
+ });
160
+ server.tool('tacit_security_rotate_secret', 'Record a secret rotation event', {
161
+ secret_type: z.string().describe('Type of secret (e.g. "api_key", "db_password")'),
162
+ identifier: z.string().describe('Identifier of the secret being rotated'),
163
+ digest_sha256: z.string().optional().describe('SHA-256 digest of the new secret value'),
164
+ }, async (args) => {
165
+ try {
166
+ const client = await getClient();
167
+ const res = await client.request('POST', '/api/v1/iam/secrets/rotate-record', args);
168
+ return success(res);
169
+ }
170
+ catch (err) {
171
+ return apiErrorResult(err, 'POST /api/v1/iam/secrets/rotate-record');
172
+ }
173
+ });
174
+ server.tool('tacit_security_incident_report', 'Retrieve recent identity-related chronicle events for security review', {}, async () => {
175
+ try {
176
+ const client = await getClient();
177
+ const res = await client.request('GET', '/api/v1/chronicle/events/recent?q=identity.&limit=100');
178
+ return success(res);
179
+ }
180
+ catch (err) {
181
+ return apiErrorResult(err, 'GET /api/v1/chronicle/events/recent?q=identity.');
182
+ }
183
+ });
184
+ server.tool('tacit_mcp_profile_health', 'Check the health of the current IAM profile and token validity', {}, async () => {
185
+ try {
186
+ const client = await getClient();
187
+ const res = await client.request('GET', '/api/v1/iam/profile-health');
188
+ return success(res);
189
+ }
190
+ catch (err) {
191
+ return apiErrorResult(err, 'GET /api/v1/iam/profile-health');
192
+ }
193
+ });
194
+ }
@@ -51,9 +51,14 @@ export function registerOnboardingTools(server, getClient) {
51
51
  }
52
52
  const lines = [];
53
53
  lines.push(`## Onboarding: ${state.name}`);
54
+ if (state.description) {
55
+ lines.push(`*${state.description}*`);
56
+ }
54
57
  lines.push('');
55
58
  lines.push(`Progress: ${completedIds.length} of ${EXPERIENCES.length} experiences complete.`);
56
59
  lines.push('');
60
+ lines.push('⚠️ **Account notice:** Your claude.ai session may be associated with a different account than this workspace. Artifacts you create will publish to your personal claude.ai account. If this is not what you want, switch accounts before continuing to Experience 7.');
61
+ lines.push('');
57
62
  if (!next) {
58
63
  lines.push('All eleven experiences complete — you are a TACIT power user.');
59
64
  lines.push('');
@@ -44,6 +44,47 @@ export function registerPeopleTools(server, getClient) {
44
44
  return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
45
45
  }
46
46
  });
47
+ server.tool('tacit_update_person', 'Update a person record (name, url, email, notes). Pass clear_url/clear_email/clear_notes to remove a field.', {
48
+ person_id: z.string().uuid().describe('Person UUID'),
49
+ name: z.string().optional().describe('New name'),
50
+ url: z.string().url().optional().describe('New URL'),
51
+ clear_url: z.boolean().optional().describe('Set true to clear the URL'),
52
+ email: z.string().email().optional().describe('New email'),
53
+ clear_email: z.boolean().optional().describe('Set true to clear the email'),
54
+ notes: z.string().max(4000).optional().describe('Free-text notes about this person'),
55
+ clear_notes: z.boolean().optional().describe('Set true to clear the notes'),
56
+ }, async (args) => {
57
+ try {
58
+ const client = await getClient();
59
+ const { person_id, ...body } = args;
60
+ const data = await client.request('PATCH', `/api/v1/people/${person_id}`, body);
61
+ return success(data);
62
+ }
63
+ catch (e) {
64
+ if (e instanceof TacitApiError)
65
+ return featureDisabledResult(e) ?? error(e.message);
66
+ return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
67
+ }
68
+ });
69
+ server.tool('tacit_add_document_person', 'Link a person to a document with a role (author, editor, contributor, speaker, subject).', {
70
+ document_id: z.string().uuid().describe('Document (data_object) UUID'),
71
+ person_id: z.string().uuid().describe('Person UUID'),
72
+ role: z.enum(['author', 'editor', 'contributor', 'speaker', 'subject']).default('author').describe('Role of this person on the document'),
73
+ position: z.number().int().min(0).default(0).describe('Author position (0-indexed)'),
74
+ }, async (args) => {
75
+ try {
76
+ const client = await getClient();
77
+ const data = await client.request('PUT', `/api/v1/documents/${args.document_id}/people`, {
78
+ people: [{ person_id: args.person_id, role: args.role, position: args.position }],
79
+ });
80
+ return success(data);
81
+ }
82
+ catch (e) {
83
+ if (e instanceof TacitApiError)
84
+ return featureDisabledResult(e) ?? error(e.message);
85
+ return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
86
+ }
87
+ });
47
88
  server.tool('tacit_get_myself', "Get the authenticated user's own person record.", {}, async () => {
48
89
  try {
49
90
  const client = await getClient();