@dod/planax-mcp 0.1.2 → 0.1.4
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 +2 -1
- package/dist/api-client.js +13 -1
- package/dist/server.js +1 -1
- package/dist/tools/document.tools.js +83 -1
- package/dist/tools/folder.tools.js +56 -56
- package/dist/tools/plan.tools.js +140 -140
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,7 +127,7 @@ env = { PLANAX_ACCESS_TOKEN = "your_token_here" }
|
|
|
127
127
|
</details>
|
|
128
128
|
|
|
129
129
|
<details>
|
|
130
|
-
<summary><b>Document</b> (
|
|
130
|
+
<summary><b>Document</b> (16)</summary>
|
|
131
131
|
|
|
132
132
|
- `document_list` - 프로젝트의 문서 목록 (필터 지원)
|
|
133
133
|
- `document_get` - 문서 상세 정보
|
|
@@ -135,6 +135,7 @@ env = { PLANAX_ACCESS_TOKEN = "your_token_here" }
|
|
|
135
135
|
- `document_get_markdown_content` - Markdown 문서 내용 조회
|
|
136
136
|
- `document_update_markdown_content` - Markdown 문서 내용 수정
|
|
137
137
|
- `document_upload` - 파일(PDF, Word, Excel, 이미지 등) 업로드
|
|
138
|
+
- `document_replace_file` - 기존 문서의 파일을 새 파일로 교체 (새 버전으로 올라가고 이전 버전은 이력에 남음)
|
|
138
139
|
- `document_create_placeholder` - 나중에 채울 자리표시 문서 생성
|
|
139
140
|
- `document_convert_placeholder` - 자리표시 문서를 실제 문서로 변환
|
|
140
141
|
- `document_create_link` - 외부 콘텐츠를 가리키는 링크 문서 생성
|
package/dist/api-client.js
CHANGED
|
@@ -43,8 +43,20 @@ export class PlanaxApiClient {
|
|
|
43
43
|
* Multipart/form-data POST request (file upload)
|
|
44
44
|
*/
|
|
45
45
|
async postForm(path, form) {
|
|
46
|
+
return this.sendForm('post', path, form);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Multipart/form-data PATCH request (file replace)
|
|
50
|
+
*/
|
|
51
|
+
async patchForm(path, form) {
|
|
52
|
+
return this.sendForm('patch', path, form);
|
|
53
|
+
}
|
|
54
|
+
async sendForm(method, path, form) {
|
|
46
55
|
try {
|
|
47
|
-
const response = await this.client.
|
|
56
|
+
const response = await this.client.request({
|
|
57
|
+
method,
|
|
58
|
+
url: path,
|
|
59
|
+
data: form,
|
|
48
60
|
headers: { 'Content-Type': 'multipart/form-data' },
|
|
49
61
|
maxBodyLength: Infinity,
|
|
50
62
|
maxContentLength: Infinity,
|
package/dist/server.js
CHANGED
|
@@ -3,6 +3,44 @@ import { basename } from 'node:path';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { successResponse, errorResponse } from './types.js';
|
|
5
5
|
const MAX_UPLOAD_BYTES = 50 * 1024 * 1024;
|
|
6
|
+
const MIME_BY_EXTENSION = {
|
|
7
|
+
pdf: 'application/pdf',
|
|
8
|
+
jpg: 'image/jpeg',
|
|
9
|
+
jpeg: 'image/jpeg',
|
|
10
|
+
png: 'image/png',
|
|
11
|
+
gif: 'image/gif',
|
|
12
|
+
webp: 'image/webp',
|
|
13
|
+
svg: 'image/svg+xml',
|
|
14
|
+
bmp: 'image/bmp',
|
|
15
|
+
txt: 'text/plain',
|
|
16
|
+
csv: 'text/csv',
|
|
17
|
+
md: 'text/markdown',
|
|
18
|
+
html: 'text/html',
|
|
19
|
+
json: 'application/json',
|
|
20
|
+
xml: 'application/xml',
|
|
21
|
+
zip: 'application/zip',
|
|
22
|
+
doc: 'application/msword',
|
|
23
|
+
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
24
|
+
xls: 'application/vnd.ms-excel',
|
|
25
|
+
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
26
|
+
ppt: 'application/vnd.ms-powerpoint',
|
|
27
|
+
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
28
|
+
hwp: 'application/x-hwp',
|
|
29
|
+
mp4: 'video/mp4',
|
|
30
|
+
mov: 'video/quicktime',
|
|
31
|
+
mp3: 'audio/mpeg',
|
|
32
|
+
wav: 'audio/wav',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Guess a MIME type from the file extension.
|
|
36
|
+
* An empty Blob type makes the multipart part go out without Content-Type,
|
|
37
|
+
* so the server stores application/octet-stream and the preview does not show.
|
|
38
|
+
*/
|
|
39
|
+
function guessMimeType(fileName) {
|
|
40
|
+
const dot = fileName.lastIndexOf('.');
|
|
41
|
+
const extension = dot >= 0 ? fileName.slice(dot + 1).toLowerCase() : '';
|
|
42
|
+
return MIME_BY_EXTENSION[extension] ?? 'application/octet-stream';
|
|
43
|
+
}
|
|
6
44
|
/**
|
|
7
45
|
* Build a Blob from a local file path or base64 content for multipart upload.
|
|
8
46
|
*/
|
|
@@ -21,7 +59,7 @@ async function loadFilePart(filePath, contentBase64, fileName) {
|
|
|
21
59
|
if (!name) {
|
|
22
60
|
throw new Error('fileName is required when using contentBase64.');
|
|
23
61
|
}
|
|
24
|
-
return { blob: new Blob([new Uint8Array(buffer)]), name };
|
|
62
|
+
return { blob: new Blob([new Uint8Array(buffer)], { type: guessMimeType(name) }), name };
|
|
25
63
|
}
|
|
26
64
|
/**
|
|
27
65
|
* Document Tools Module
|
|
@@ -637,6 +675,50 @@ export function register({ server, apiClient }) {
|
|
|
637
675
|
return errorResponse(error);
|
|
638
676
|
}
|
|
639
677
|
});
|
|
678
|
+
// ===== Document Replace File (new version) =====
|
|
679
|
+
server.registerTool('document_replace_file', {
|
|
680
|
+
description: `Replace the file of an existing document with a new one. The document gets a new version; earlier versions stay in version history.
|
|
681
|
+
|
|
682
|
+
**When to use:**
|
|
683
|
+
- Upload a revised file (e.g., "protocol v2.pdf") to a document that already exists
|
|
684
|
+
- Use document_upload instead to create a new document
|
|
685
|
+
|
|
686
|
+
**Note:**
|
|
687
|
+
- Not allowed while a signature process is in progress on the document (cancel it first in the web app)
|
|
688
|
+
- A MARKDOWN document becomes a FILE document; its previous text stays in version history
|
|
689
|
+
- If the replaced version went through signing, the document status resets to DRAFT
|
|
690
|
+
|
|
691
|
+
**Input:** Provide either \`filePath\` (absolute path on the machine running this MCP server) or \`contentBase64\` with \`fileName\`. Max 50MB.
|
|
692
|
+
|
|
693
|
+
**Example:**
|
|
694
|
+
{ projectId: "...", documentId: "...", filePath: "/Users/me/Documents/protocol_v2.pdf", changeReason: "IRB 의견 반영" }
|
|
695
|
+
|
|
696
|
+
**Returns:** Updated document (new version number)`,
|
|
697
|
+
inputSchema: {
|
|
698
|
+
projectId: z.string().uuid().describe('Project ID (UUID) - required'),
|
|
699
|
+
documentId: z.string().uuid().describe('Document ID (UUID) to replace the file of'),
|
|
700
|
+
filePath: z.string().optional().describe('Absolute path of the local file to upload'),
|
|
701
|
+
contentBase64: z.string().optional().describe('Base64-encoded file content (use with fileName)'),
|
|
702
|
+
fileName: z.string().optional().describe('File name with extension (required with contentBase64)'),
|
|
703
|
+
changeReason: z.string().max(500).optional().describe('Reason shown in version history'),
|
|
704
|
+
versionLabel: z.string().optional().describe('Version label (e.g., "v2.0")'),
|
|
705
|
+
},
|
|
706
|
+
}, async ({ projectId, documentId, filePath, contentBase64, fileName, changeReason, versionLabel }) => {
|
|
707
|
+
try {
|
|
708
|
+
const { blob, name } = await loadFilePart(filePath, contentBase64, fileName);
|
|
709
|
+
const form = new FormData();
|
|
710
|
+
form.append('file', blob, name);
|
|
711
|
+
if (changeReason)
|
|
712
|
+
form.append('changeReason', changeReason);
|
|
713
|
+
if (versionLabel)
|
|
714
|
+
form.append('versionLabel', versionLabel);
|
|
715
|
+
const result = await apiClient.patchForm(`/projects/${projectId}/documents/${documentId}/replace-file`, form);
|
|
716
|
+
return successResponse(result, `File replaced with "${name}" (new version)`);
|
|
717
|
+
}
|
|
718
|
+
catch (error) {
|
|
719
|
+
return errorResponse(error);
|
|
720
|
+
}
|
|
721
|
+
});
|
|
640
722
|
// ===== Document Convert Placeholder =====
|
|
641
723
|
server.registerTool('document_convert_placeholder', {
|
|
642
724
|
description: `Convert a placeholder document to an actual document.
|
|
@@ -17,14 +17,14 @@ const FolderColorSchema = z.enum(['blue', 'green', 'yellow', 'orange', 'red', 'p
|
|
|
17
17
|
export function register({ server, apiClient }) {
|
|
18
18
|
// ===== Folder List/Tree Operations =====
|
|
19
19
|
server.registerTool('folder_list', {
|
|
20
|
-
description: `List all folders in a project as a tree structure.
|
|
21
|
-
|
|
22
|
-
**Purpose:** 프로젝트의 문서 저장 폴더 구조를 조회합니다.
|
|
23
|
-
|
|
24
|
-
**Note:** Folder는 Plan의 Phase와 독립적입니다.
|
|
25
|
-
- Phase: 프로젝트 단계/일정 (언제/무엇을)
|
|
26
|
-
- Folder: 문서 저장 위치 (어디에)
|
|
27
|
-
|
|
20
|
+
description: `List all folders in a project as a tree structure.
|
|
21
|
+
|
|
22
|
+
**Purpose:** 프로젝트의 문서 저장 폴더 구조를 조회합니다.
|
|
23
|
+
|
|
24
|
+
**Note:** Folder는 Plan의 Phase와 독립적입니다.
|
|
25
|
+
- Phase: 프로젝트 단계/일정 (언제/무엇을)
|
|
26
|
+
- Folder: 문서 저장 위치 (어디에)
|
|
27
|
+
|
|
28
28
|
**Returns:** Root folders with nested subFolders as tree structure`,
|
|
29
29
|
inputSchema: {
|
|
30
30
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -55,23 +55,23 @@ export function register({ server, apiClient }) {
|
|
|
55
55
|
});
|
|
56
56
|
// ===== Folder CRUD Operations =====
|
|
57
57
|
server.registerTool('folder_create', {
|
|
58
|
-
description: `Create a new folder in a project. Can create root folders or subfolders.
|
|
59
|
-
|
|
60
|
-
**Purpose:** 문서를 정리할 폴더를 생성합니다.
|
|
61
|
-
|
|
62
|
-
**Usage:**
|
|
63
|
-
- Root folder: parentFolderId 생략
|
|
64
|
-
- Subfolder: parentFolderId에 상위 폴더 ID 지정
|
|
65
|
-
|
|
66
|
-
**Examples:**
|
|
67
|
-
1. Root folder 생성:
|
|
68
|
-
{ projectId: "...", name: "01. Regulatory", color: "blue" }
|
|
69
|
-
|
|
70
|
-
2. Subfolder 생성:
|
|
71
|
-
{ projectId: "...", name: "FDA Submissions", parentFolderId: "..." }
|
|
72
|
-
|
|
73
|
-
**Colors:** blue, green, yellow, orange, red, purple, pink, gray
|
|
74
|
-
|
|
58
|
+
description: `Create a new folder in a project. Can create root folders or subfolders.
|
|
59
|
+
|
|
60
|
+
**Purpose:** 문서를 정리할 폴더를 생성합니다.
|
|
61
|
+
|
|
62
|
+
**Usage:**
|
|
63
|
+
- Root folder: parentFolderId 생략
|
|
64
|
+
- Subfolder: parentFolderId에 상위 폴더 ID 지정
|
|
65
|
+
|
|
66
|
+
**Examples:**
|
|
67
|
+
1. Root folder 생성:
|
|
68
|
+
{ projectId: "...", name: "01. Regulatory", color: "blue" }
|
|
69
|
+
|
|
70
|
+
2. Subfolder 생성:
|
|
71
|
+
{ projectId: "...", name: "FDA Submissions", parentFolderId: "..." }
|
|
72
|
+
|
|
73
|
+
**Colors:** blue, green, yellow, orange, red, purple, pink, gray
|
|
74
|
+
|
|
75
75
|
**Returns:** Created folder with id, name, color, and hierarchy info`,
|
|
76
76
|
inputSchema: {
|
|
77
77
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -96,21 +96,21 @@ export function register({ server, apiClient }) {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
server.registerTool('folder_update', {
|
|
99
|
-
description: `Update an existing folder.
|
|
100
|
-
|
|
101
|
-
**Usage:**
|
|
102
|
-
- 이름/설명/색상 변경
|
|
103
|
-
- 다른 폴더 하위로 이동 (parentFolderId 변경)
|
|
104
|
-
- Root로 이동 (parentFolderId: null)
|
|
105
|
-
|
|
106
|
-
**Examples:**
|
|
107
|
-
1. 이름/색상 변경:
|
|
108
|
-
{ projectId: "...", folderId: "...", name: "New Name", color: "purple" }
|
|
109
|
-
|
|
110
|
-
2. 다른 폴더로 이동:
|
|
111
|
-
{ projectId: "...", folderId: "...", parentFolderId: "new-parent-uuid" }
|
|
112
|
-
|
|
113
|
-
3. Root로 이동:
|
|
99
|
+
description: `Update an existing folder.
|
|
100
|
+
|
|
101
|
+
**Usage:**
|
|
102
|
+
- 이름/설명/색상 변경
|
|
103
|
+
- 다른 폴더 하위로 이동 (parentFolderId 변경)
|
|
104
|
+
- Root로 이동 (parentFolderId: null)
|
|
105
|
+
|
|
106
|
+
**Examples:**
|
|
107
|
+
1. 이름/색상 변경:
|
|
108
|
+
{ projectId: "...", folderId: "...", name: "New Name", color: "purple" }
|
|
109
|
+
|
|
110
|
+
2. 다른 폴더로 이동:
|
|
111
|
+
{ projectId: "...", folderId: "...", parentFolderId: "new-parent-uuid" }
|
|
112
|
+
|
|
113
|
+
3. Root로 이동:
|
|
114
114
|
{ projectId: "...", folderId: "...", parentFolderId: null }`,
|
|
115
115
|
inputSchema: {
|
|
116
116
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -139,13 +139,13 @@ export function register({ server, apiClient }) {
|
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
server.registerTool('folder_delete', {
|
|
142
|
-
description: `Delete a folder.
|
|
143
|
-
|
|
144
|
-
**Constraints:**
|
|
145
|
-
- 폴더가 비어있어야 삭제 가능
|
|
146
|
-
- 하위 폴더가 있으면 삭제 불가
|
|
147
|
-
- 문서가 있으면 삭제 불가
|
|
148
|
-
|
|
142
|
+
description: `Delete a folder.
|
|
143
|
+
|
|
144
|
+
**Constraints:**
|
|
145
|
+
- 폴더가 비어있어야 삭제 가능
|
|
146
|
+
- 하위 폴더가 있으면 삭제 불가
|
|
147
|
+
- 문서가 있으면 삭제 불가
|
|
148
|
+
|
|
149
149
|
**Tip:** 하위 항목을 먼저 이동하거나 삭제 후 폴더 삭제`,
|
|
150
150
|
inputSchema: {
|
|
151
151
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -162,15 +162,15 @@ export function register({ server, apiClient }) {
|
|
|
162
162
|
});
|
|
163
163
|
// ===== Folder Path/Navigation =====
|
|
164
164
|
server.registerTool('folder_get_path', {
|
|
165
|
-
description: `Get the breadcrumb path for a folder.
|
|
166
|
-
|
|
167
|
-
**Returns:** Array of folders from root to target folder
|
|
168
|
-
|
|
169
|
-
**Example Response:**
|
|
170
|
-
[
|
|
171
|
-
{ "id": "root-uuid", "name": "Research Documents" },
|
|
172
|
-
{ "id": "sub-uuid", "name": "Literature Review" },
|
|
173
|
-
{ "id": "target-uuid", "name": "2024 Papers" }
|
|
165
|
+
description: `Get the breadcrumb path for a folder.
|
|
166
|
+
|
|
167
|
+
**Returns:** Array of folders from root to target folder
|
|
168
|
+
|
|
169
|
+
**Example Response:**
|
|
170
|
+
[
|
|
171
|
+
{ "id": "root-uuid", "name": "Research Documents" },
|
|
172
|
+
{ "id": "sub-uuid", "name": "Literature Review" },
|
|
173
|
+
{ "id": "target-uuid", "name": "2024 Papers" }
|
|
174
174
|
]`,
|
|
175
175
|
inputSchema: {
|
|
176
176
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
package/dist/tools/plan.tools.js
CHANGED
|
@@ -13,16 +13,16 @@ import { successResponse, errorResponse } from './types.js';
|
|
|
13
13
|
export function register({ server, apiClient }) {
|
|
14
14
|
// ===== Plan Basic Operations =====
|
|
15
15
|
server.registerTool('plan_check_exists', {
|
|
16
|
-
description: `Check if a plan exists for the project.
|
|
17
|
-
|
|
18
|
-
**When to use:**
|
|
19
|
-
- Before creating a new plan, check if one already exists
|
|
20
|
-
- Determine if plan-related operations are available
|
|
21
|
-
|
|
22
|
-
**Examples:**
|
|
23
|
-
1. Check plan existence:
|
|
24
|
-
{ projectId: "project-uuid" }
|
|
25
|
-
|
|
16
|
+
description: `Check if a plan exists for the project.
|
|
17
|
+
|
|
18
|
+
**When to use:**
|
|
19
|
+
- Before creating a new plan, check if one already exists
|
|
20
|
+
- Determine if plan-related operations are available
|
|
21
|
+
|
|
22
|
+
**Examples:**
|
|
23
|
+
1. Check plan existence:
|
|
24
|
+
{ projectId: "project-uuid" }
|
|
25
|
+
|
|
26
26
|
**Returns:** { exists: boolean }`,
|
|
27
27
|
inputSchema: {
|
|
28
28
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -37,20 +37,20 @@ export function register({ server, apiClient }) {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
server.registerTool('plan_create', {
|
|
40
|
-
description: `Create a new plan for the project (from template or blank).
|
|
41
|
-
|
|
42
|
-
**When to use:**
|
|
43
|
-
- Initialize project planning by creating a plan structure
|
|
44
|
-
- Start a new project with predefined phases from a template
|
|
45
|
-
- Create a blank plan to build custom structure
|
|
46
|
-
|
|
47
|
-
**Examples:**
|
|
48
|
-
1. Create blank plan:
|
|
49
|
-
{ projectId: "..." }
|
|
50
|
-
|
|
51
|
-
2. Create from template:
|
|
52
|
-
{ projectId: "...", templateId: "template-uuid" }
|
|
53
|
-
|
|
40
|
+
description: `Create a new plan for the project (from template or blank).
|
|
41
|
+
|
|
42
|
+
**When to use:**
|
|
43
|
+
- Initialize project planning by creating a plan structure
|
|
44
|
+
- Start a new project with predefined phases from a template
|
|
45
|
+
- Create a blank plan to build custom structure
|
|
46
|
+
|
|
47
|
+
**Examples:**
|
|
48
|
+
1. Create blank plan:
|
|
49
|
+
{ projectId: "..." }
|
|
50
|
+
|
|
51
|
+
2. Create from template:
|
|
52
|
+
{ projectId: "...", templateId: "template-uuid" }
|
|
53
|
+
|
|
54
54
|
**Returns:** Created plan object with initial structure`,
|
|
55
55
|
inputSchema: {
|
|
56
56
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -68,21 +68,21 @@ export function register({ server, apiClient }) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
server.registerTool('plan_get_tree', {
|
|
71
|
-
description: `Get the full plan tree including all phases, tasks, and documents.
|
|
72
|
-
|
|
73
|
-
**When to use:**
|
|
74
|
-
- View entire project plan structure at once
|
|
75
|
-
- Get overview of all phases, tasks, and documents
|
|
76
|
-
- Export or analyze complete plan hierarchy
|
|
77
|
-
|
|
78
|
-
**Examples:**
|
|
79
|
-
1. Get full plan tree:
|
|
80
|
-
{ projectId: "..." }
|
|
81
|
-
|
|
82
|
-
**Returns:** Hierarchical tree structure with:
|
|
83
|
-
- phases (nested with sub-phases)
|
|
84
|
-
- tasks linked to each phase
|
|
85
|
-
- documents linked to each phase
|
|
71
|
+
description: `Get the full plan tree including all phases, tasks, and documents.
|
|
72
|
+
|
|
73
|
+
**When to use:**
|
|
74
|
+
- View entire project plan structure at once
|
|
75
|
+
- Get overview of all phases, tasks, and documents
|
|
76
|
+
- Export or analyze complete plan hierarchy
|
|
77
|
+
|
|
78
|
+
**Examples:**
|
|
79
|
+
1. Get full plan tree:
|
|
80
|
+
{ projectId: "..." }
|
|
81
|
+
|
|
82
|
+
**Returns:** Hierarchical tree structure with:
|
|
83
|
+
- phases (nested with sub-phases)
|
|
84
|
+
- tasks linked to each phase
|
|
85
|
+
- documents linked to each phase
|
|
86
86
|
- root-level tasks and documents`,
|
|
87
87
|
inputSchema: {
|
|
88
88
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -98,17 +98,17 @@ export function register({ server, apiClient }) {
|
|
|
98
98
|
});
|
|
99
99
|
// ===== Phase Operations =====
|
|
100
100
|
server.registerTool('plan_list_root_phases', {
|
|
101
|
-
description: `List all root-level phases in the plan.
|
|
102
|
-
|
|
103
|
-
**When to use:**
|
|
104
|
-
- Get top-level phases without nested structure
|
|
105
|
-
- Quick overview of main project milestones
|
|
106
|
-
- Navigate to specific phase for more details
|
|
107
|
-
|
|
108
|
-
**Examples:**
|
|
109
|
-
1. List root phases:
|
|
110
|
-
{ projectId: "..." }
|
|
111
|
-
|
|
101
|
+
description: `List all root-level phases in the plan.
|
|
102
|
+
|
|
103
|
+
**When to use:**
|
|
104
|
+
- Get top-level phases without nested structure
|
|
105
|
+
- Quick overview of main project milestones
|
|
106
|
+
- Navigate to specific phase for more details
|
|
107
|
+
|
|
108
|
+
**Examples:**
|
|
109
|
+
1. List root phases:
|
|
110
|
+
{ projectId: "..." }
|
|
111
|
+
|
|
112
112
|
**Returns:** Array of root-level phases (phases without parent)`,
|
|
113
113
|
inputSchema: {
|
|
114
114
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -123,22 +123,22 @@ export function register({ server, apiClient }) {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
server.registerTool('plan_list_all_phases', {
|
|
126
|
-
description: `List all phases in the plan as a flat list with path information.
|
|
127
|
-
|
|
128
|
-
**When to use:**
|
|
129
|
-
- Get all phases regardless of nesting level
|
|
130
|
-
- Search or filter phases across entire plan
|
|
131
|
-
- Build breadcrumb navigation
|
|
132
|
-
- Export flat list for reporting
|
|
133
|
-
|
|
134
|
-
**Examples:**
|
|
135
|
-
1. List all phases:
|
|
136
|
-
{ projectId: "..." }
|
|
137
|
-
|
|
138
|
-
**Returns:** Flat array of all phases with:
|
|
139
|
-
- id, name, status
|
|
140
|
-
- parentPhaseId
|
|
141
|
-
- path (breadcrumb info)
|
|
126
|
+
description: `List all phases in the plan as a flat list with path information.
|
|
127
|
+
|
|
128
|
+
**When to use:**
|
|
129
|
+
- Get all phases regardless of nesting level
|
|
130
|
+
- Search or filter phases across entire plan
|
|
131
|
+
- Build breadcrumb navigation
|
|
132
|
+
- Export flat list for reporting
|
|
133
|
+
|
|
134
|
+
**Examples:**
|
|
135
|
+
1. List all phases:
|
|
136
|
+
{ projectId: "..." }
|
|
137
|
+
|
|
138
|
+
**Returns:** Flat array of all phases with:
|
|
139
|
+
- id, name, status
|
|
140
|
+
- parentPhaseId
|
|
141
|
+
- path (breadcrumb info)
|
|
142
142
|
- depth level`,
|
|
143
143
|
inputSchema: {
|
|
144
144
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -153,21 +153,21 @@ export function register({ server, apiClient }) {
|
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
server.registerTool('plan_get_phase_children', {
|
|
156
|
-
description: `Get children of a phase (sub-phases, tasks, and documents).
|
|
157
|
-
|
|
158
|
-
**When to use:**
|
|
159
|
-
- Expand a phase to see its contents
|
|
160
|
-
- List sub-phases under a parent phase
|
|
161
|
-
- View tasks and documents linked to a specific phase
|
|
162
|
-
- Build tree view UI by loading children on demand
|
|
163
|
-
|
|
164
|
-
**Examples:**
|
|
165
|
-
1. Get phase children:
|
|
166
|
-
{ projectId: "...", phaseId: "phase-uuid" }
|
|
167
|
-
|
|
168
|
-
**Returns:** Object containing:
|
|
169
|
-
- subPhases: Array of child phases
|
|
170
|
-
- tasks: Array of linked tasks
|
|
156
|
+
description: `Get children of a phase (sub-phases, tasks, and documents).
|
|
157
|
+
|
|
158
|
+
**When to use:**
|
|
159
|
+
- Expand a phase to see its contents
|
|
160
|
+
- List sub-phases under a parent phase
|
|
161
|
+
- View tasks and documents linked to a specific phase
|
|
162
|
+
- Build tree view UI by loading children on demand
|
|
163
|
+
|
|
164
|
+
**Examples:**
|
|
165
|
+
1. Get phase children:
|
|
166
|
+
{ projectId: "...", phaseId: "phase-uuid" }
|
|
167
|
+
|
|
168
|
+
**Returns:** Object containing:
|
|
169
|
+
- subPhases: Array of child phases
|
|
170
|
+
- tasks: Array of linked tasks
|
|
171
171
|
- documents: Array of linked documents`,
|
|
172
172
|
inputSchema: {
|
|
173
173
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -183,23 +183,23 @@ export function register({ server, apiClient }) {
|
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
server.registerTool('plan_create_phase', {
|
|
186
|
-
description: `Create a new phase in the plan.
|
|
187
|
-
|
|
188
|
-
**Usage:**
|
|
189
|
-
- Creates a phase at root level or as a sub-phase under another phase
|
|
190
|
-
- Phases organize tasks and documents hierarchically
|
|
191
|
-
- Supports unlimited nesting depth
|
|
192
|
-
|
|
193
|
-
**Examples:**
|
|
194
|
-
1. Create root phase:
|
|
195
|
-
{ projectId: "...", name: "Phase 1: Planning" }
|
|
196
|
-
|
|
197
|
-
2. Create sub-phase:
|
|
198
|
-
{ projectId: "...", name: "1.1 Requirements", parentPhaseId: "..." }
|
|
199
|
-
|
|
200
|
-
3. With dates:
|
|
201
|
-
{ projectId: "...", name: "Development", startDate: "2024-01-15", expectedEndDate: "2024-03-15" }
|
|
202
|
-
|
|
186
|
+
description: `Create a new phase in the plan.
|
|
187
|
+
|
|
188
|
+
**Usage:**
|
|
189
|
+
- Creates a phase at root level or as a sub-phase under another phase
|
|
190
|
+
- Phases organize tasks and documents hierarchically
|
|
191
|
+
- Supports unlimited nesting depth
|
|
192
|
+
|
|
193
|
+
**Examples:**
|
|
194
|
+
1. Create root phase:
|
|
195
|
+
{ projectId: "...", name: "Phase 1: Planning" }
|
|
196
|
+
|
|
197
|
+
2. Create sub-phase:
|
|
198
|
+
{ projectId: "...", name: "1.1 Requirements", parentPhaseId: "..." }
|
|
199
|
+
|
|
200
|
+
3. With dates:
|
|
201
|
+
{ projectId: "...", name: "Development", startDate: "2024-01-15", expectedEndDate: "2024-03-15" }
|
|
202
|
+
|
|
203
203
|
**Returns:** Created phase with id, name, status, order, and hierarchy info`,
|
|
204
204
|
inputSchema: {
|
|
205
205
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -223,37 +223,37 @@ export function register({ server, apiClient }) {
|
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
225
|
server.registerTool('plan_update_phase', {
|
|
226
|
-
description: `Update an existing phase.
|
|
227
|
-
|
|
228
|
-
**When to use:**
|
|
229
|
-
- Rename a phase
|
|
230
|
-
- Update phase status (NOT_STARTED -> IN_PROGRESS -> COMPLETED)
|
|
231
|
-
- Set or update phase dates (start, expected end, actual end)
|
|
232
|
-
- Put a phase on hold
|
|
233
|
-
|
|
234
|
-
**Examples:**
|
|
235
|
-
1. Update status:
|
|
236
|
-
{ projectId: "...", phaseId: "...", status: "IN_PROGRESS" }
|
|
237
|
-
|
|
238
|
-
2. Rename phase:
|
|
239
|
-
{ projectId: "...", phaseId: "...", name: "Updated Phase Name" }
|
|
240
|
-
|
|
241
|
-
3. Set dates:
|
|
242
|
-
{
|
|
243
|
-
projectId: "...",
|
|
244
|
-
phaseId: "...",
|
|
245
|
-
startDate: "2024-01-15",
|
|
246
|
-
expectedEndDate: "2024-03-15"
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
4. Complete a phase:
|
|
250
|
-
{
|
|
251
|
-
projectId: "...",
|
|
252
|
-
phaseId: "...",
|
|
253
|
-
status: "COMPLETED",
|
|
254
|
-
actualEndDate: "2024-03-10"
|
|
255
|
-
}
|
|
256
|
-
|
|
226
|
+
description: `Update an existing phase.
|
|
227
|
+
|
|
228
|
+
**When to use:**
|
|
229
|
+
- Rename a phase
|
|
230
|
+
- Update phase status (NOT_STARTED -> IN_PROGRESS -> COMPLETED)
|
|
231
|
+
- Set or update phase dates (start, expected end, actual end)
|
|
232
|
+
- Put a phase on hold
|
|
233
|
+
|
|
234
|
+
**Examples:**
|
|
235
|
+
1. Update status:
|
|
236
|
+
{ projectId: "...", phaseId: "...", status: "IN_PROGRESS" }
|
|
237
|
+
|
|
238
|
+
2. Rename phase:
|
|
239
|
+
{ projectId: "...", phaseId: "...", name: "Updated Phase Name" }
|
|
240
|
+
|
|
241
|
+
3. Set dates:
|
|
242
|
+
{
|
|
243
|
+
projectId: "...",
|
|
244
|
+
phaseId: "...",
|
|
245
|
+
startDate: "2024-01-15",
|
|
246
|
+
expectedEndDate: "2024-03-15"
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
4. Complete a phase:
|
|
250
|
+
{
|
|
251
|
+
projectId: "...",
|
|
252
|
+
phaseId: "...",
|
|
253
|
+
status: "COMPLETED",
|
|
254
|
+
actualEndDate: "2024-03-10"
|
|
255
|
+
}
|
|
256
|
+
|
|
257
257
|
**Returns:** Updated phase object`,
|
|
258
258
|
inputSchema: {
|
|
259
259
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|
|
@@ -285,17 +285,17 @@ export function register({ server, apiClient }) {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
server.registerTool('plan_delete_phase', {
|
|
288
|
-
description: `Delete a phase from the plan.
|
|
289
|
-
|
|
290
|
-
**Usage:**
|
|
291
|
-
- Deletes the specified phase and all its sub-phases recursively
|
|
292
|
-
- Task and Document links are removed (but Tasks/Documents themselves are preserved)
|
|
293
|
-
- This action cannot be undone
|
|
294
|
-
|
|
295
|
-
**Examples:**
|
|
296
|
-
1. Delete a phase:
|
|
297
|
-
{ projectId: "...", phaseId: "..." }
|
|
298
|
-
|
|
288
|
+
description: `Delete a phase from the plan.
|
|
289
|
+
|
|
290
|
+
**Usage:**
|
|
291
|
+
- Deletes the specified phase and all its sub-phases recursively
|
|
292
|
+
- Task and Document links are removed (but Tasks/Documents themselves are preserved)
|
|
293
|
+
- This action cannot be undone
|
|
294
|
+
|
|
295
|
+
**Examples:**
|
|
296
|
+
1. Delete a phase:
|
|
297
|
+
{ projectId: "...", phaseId: "..." }
|
|
298
|
+
|
|
299
299
|
**Returns:** Success confirmation message`,
|
|
300
300
|
inputSchema: {
|
|
301
301
|
projectId: z.string().uuid().describe('Project ID (UUID)'),
|