agent-planner-mcp 0.5.1 → 0.6.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/AGENT_GUIDE.md CHANGED
@@ -17,9 +17,9 @@ This guide is optimized for AI agents using AgentPlanner MCP tools.
17
17
 
18
18
  ### Before Starting Work
19
19
  ```javascript
20
- get_context({ plan_id: "..." })
20
+ get_plan_context({ plan_id: "..." })
21
21
  ```
22
- Returns: statistics, blocked tasks, in-progress tasks, ready tasks, knowledge
22
+ Returns: plan overview, phase summaries, linked goals, knowledge
23
23
 
24
24
  ### Update Task Status
25
25
  ```javascript
@@ -244,7 +244,7 @@ Key rules:
244
244
 
245
245
  ## Best Practices
246
246
 
247
- 1. **Use `get_task_context` instead of `get_context`** - progressive depth gives you exactly what you need
247
+ 1. **Use `get_task_context` for task work, `get_plan_context` for plan overview** - progressive depth gives you exactly what you need
248
248
  2. **Check dependencies before starting** - use `suggest_next_tasks` to find what's ready
249
249
  3. **Log as you work** - helps humans and future agents follow
250
250
  4. **Record important findings** - use `add_learning` after research, decisions, and discoveries
package/SKILL.md CHANGED
@@ -110,7 +110,6 @@ Each suggestion includes a `reason` field explaining why it's recommended.
110
110
  | `delete_node` | Delete a node and its children |
111
111
  | `move_node` | Reparent or reorder a node |
112
112
  | `batch_update_nodes` | Update multiple nodes at once |
113
- | `get_node_context` | Detailed node info with children and logs |
114
113
  | `get_node_ancestry` | Path from root to node |
115
114
 
116
115
  When creating nodes:
@@ -150,12 +149,9 @@ Cycle detection is automatic — you cannot create a dependency that would form
150
149
 
151
150
  | Tool | Purpose |
152
151
  |------|---------|
153
- | `get_task_context` | **Preferred.** Progressive context at depth 1-4 with token budgeting |
152
+ | `get_task_context` | **Primary.** Progressive context at depth 1-4 with token budgeting |
153
+ | `get_plan_context` | Plan overview with phase summaries and knowledge |
154
154
  | `suggest_next_tasks` | Find ready tasks based on dependency analysis |
155
- | `understand_context` | Full situation overview for a plan or goal (see Orientation) |
156
- | `get_plan_context` | Plan overview with phase summaries |
157
- | `get_agent_context` | Legacy leaf-up context (use `get_task_context` instead) |
158
- | `get_context` | Legacy full-plan context (use `get_task_context` or `understand_context` instead) |
159
155
 
160
156
  ### Logging
161
157
 
@@ -261,11 +257,10 @@ Use `get_recent_episodes` to review what has been learned recently across all pl
261
257
  | Tool | Purpose |
262
258
  |------|---------|
263
259
  | `get_started` | Guidance on how to use AgentPlanner — call when new or unsure how to approach a task |
264
- | `understand_context` | Comprehensive context about a plan or goal (purpose, state, activity, blockers, knowledge) |
265
260
 
266
261
  `get_started` accepts an optional `topic`: `overview`, `planning`, `execution`, `knowledge`, or `collaboration`.
267
262
 
268
- `understand_context` accepts `plan_id` and/or `goal_id` use it before starting work on an unfamiliar plan or goal to get the full picture in one call.
263
+ To understand a plan before starting, use `get_plan_context({ plan_id })` for the overview, then `get_task_context({ node_id, depth: 4 })` for deep context on a specific task.
269
264
 
270
265
  ### Other
271
266
 
@@ -325,9 +320,10 @@ When to use RPI vs. a single task:
325
320
  ### Starting a New Session
326
321
  ```
327
322
  1. get_my_tasks({}) → see what's in progress or blocked across all plans
328
- 2. get_recent_episodes({ max_episodes: 10 }) → review what was learned/decided recently across all plans
329
- 3. If resuming: get_task_context({ node_id: "...", depth: 2 })
330
- 4. If starting fresh: suggest_next_tasks({ plan_id: "..." })
323
+ 2. get_recent_episodes({ max_episodes: 10 }) → review recent knowledge across all plans
324
+ 3. If resuming a task: get_task_context({ node_id: "...", depth: 2 })
325
+ 4. If orienting on a plan: get_plan_context({ plan_id: "..." })
326
+ 5. If starting fresh: suggest_next_tasks({ plan_id: "..." })
331
327
  ```
332
328
 
333
329
  ### Breaking Down a Large Task
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-planner-mcp",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "MCP server for AgentPlanner — AI agent orchestration with planning, dependencies, knowledge graphs, and human oversight",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/tools.js CHANGED
@@ -182,18 +182,6 @@ function setupTools(server, apiClientOverride) {
182
182
  // CONTEXT LOADING - Get everything you need
183
183
  // Use before starting work on a plan/goal
184
184
  // ========================================
185
- {
186
- name: "get_context",
187
- description: "Load EVERYTHING you need to work on a plan or goal: structure, status, progress, blocked tasks, recent activity, and relevant knowledge. Call this FIRST before starting work.",
188
- inputSchema: {
189
- type: "object",
190
- properties: {
191
- plan_id: { type: "string", description: "Plan to get context for" },
192
- goal_id: { type: "string", description: "Goal to get context for" },
193
- include_knowledge: { type: "boolean", default: true, description: "Include relevant knowledge entries" }
194
- }
195
- }
196
- },
197
185
  {
198
186
  name: "get_my_tasks",
199
187
  description: "Get tasks that need attention - blocked tasks, in-progress tasks, and next tasks to start. Perfect for status check-ins.",
@@ -474,18 +462,6 @@ function setupTools(server, apiClientOverride) {
474
462
  required: ["plan_id", "node_id"]
475
463
  }
476
464
  },
477
- {
478
- name: "get_node_context",
479
- description: "Get comprehensive context for a node including children and logs",
480
- inputSchema: {
481
- type: "object",
482
- properties: {
483
- plan_id: { type: "string", description: "Plan ID" },
484
- node_id: { type: "string", description: "Node ID" }
485
- },
486
- required: ["plan_id", "node_id"]
487
- }
488
- },
489
465
  {
490
466
  name: "get_node_ancestry",
491
467
  description: "Get the path from root to a specific node",
@@ -742,7 +718,7 @@ function setupTools(server, apiClientOverride) {
742
718
  // ===== PLAN STRUCTURE & SUMMARY =====
743
719
  {
744
720
  name: "get_plan_structure",
745
- description: "Get the hierarchical structure of a plan with minimal fields (id, parent_id, node_type, title, status, order_index). Use get_node_context for detailed information about specific nodes.",
721
+ description: "Get the hierarchical structure of a plan with minimal fields (id, parent_id, node_type, title, status, order_index). Use get_task_context for detailed information about specific nodes.",
746
722
  inputSchema: {
747
723
  type: "object",
748
724
  properties: {
@@ -769,33 +745,9 @@ function setupTools(server, apiClientOverride) {
769
745
  },
770
746
 
771
747
  // ===== AGENT CONTEXT TOOLS (Leaf-up context loading) =====
772
- {
773
- name: "get_agent_context",
774
- description: "Get focused context for a specific task/node. Uses leaf-up traversal - returns only the relevant path from the node to root, not the entire plan tree. Best for agents starting work on a specific task.",
775
- inputSchema: {
776
- type: "object",
777
- properties: {
778
- node_id: {
779
- type: "string",
780
- description: "Task or phase node ID to get context for"
781
- },
782
- include_knowledge: {
783
- type: "boolean",
784
- description: "Include knowledge entries from relevant scopes (plan, goals, org)",
785
- default: true
786
- },
787
- include_siblings: {
788
- type: "boolean",
789
- description: "Include sibling tasks in the same phase",
790
- default: false
791
- }
792
- },
793
- required: ["node_id"]
794
- }
795
- },
796
748
  {
797
749
  name: "get_plan_context",
798
- description: "Get plan-level context overview. Returns plan details, phase summaries (not full tree), linked goals, and organization. Use get_agent_context for task-focused work.",
750
+ description: "Get plan-level context overview. Returns plan details, phase summaries (not full tree), linked goals, and organization. Use get_task_context for task-focused work.",
799
751
  inputSchema: {
800
752
  type: "object",
801
753
  properties: {
@@ -1147,18 +1099,6 @@ function setupTools(server, apiClientOverride) {
1147
1099
  }
1148
1100
  }
1149
1101
  },
1150
- {
1151
- name: "understand_context",
1152
- description: "Get comprehensive context about a plan or goal - its purpose, current state, recent activity, blocked tasks, and relevant knowledge. Use this BEFORE starting work to understand the full situation.",
1153
- inputSchema: {
1154
- type: "object",
1155
- properties: {
1156
- plan_id: { type: "string", description: "Plan ID to understand" },
1157
- goal_id: { type: "string", description: "Goal ID to understand" },
1158
- include_knowledge: { type: "boolean", description: "Include relevant knowledge entries", default: true }
1159
- }
1160
- }
1161
- }
1162
1102
  ]
1163
1103
  };
1164
1104
  });
@@ -1240,7 +1180,7 @@ function setupTools(server, apiClientOverride) {
1240
1180
  next_steps: [
1241
1181
  "Use quick_status to update task progress",
1242
1182
  "Use quick_log to document your work",
1243
- "Use get_context to load full plan details"
1183
+ "Use get_plan_context to load full plan details"
1244
1184
  ]
1245
1185
  });
1246
1186
  }
@@ -1376,88 +1316,7 @@ function setupTools(server, apiClientOverride) {
1376
1316
  // ========================================
1377
1317
  // CONTEXT LOADING IMPLEMENTATIONS
1378
1318
  // ========================================
1379
-
1380
- if (name === "get_context") {
1381
- // Redirect to understand_context implementation (same functionality)
1382
- const { plan_id, goal_id, include_knowledge = true } = args;
1383
-
1384
- if (!plan_id && !goal_id) {
1385
- return formatResponse({
1386
- error: "Provide either plan_id or goal_id to get context",
1387
- suggestion: "Use list_plans or list_goals to find IDs"
1388
- });
1389
- }
1390
-
1391
- const context = {
1392
- retrieved_at: new Date().toISOString()
1393
- };
1394
-
1395
- // Get goal context
1396
- if (goal_id) {
1397
- try {
1398
- context.goal = await apiClient.goals.get(goal_id);
1399
- if (include_knowledge) {
1400
- try {
1401
- const graphResult = await apiClient.graphiti.graphSearch({ query: context.goal?.title || '', max_results: 10 });
1402
- context.goal_knowledge = graphResult?.results?.facts || [];
1403
- } catch (e) {}
1404
- }
1405
- } catch (e) {
1406
- context.goal_error = e.message;
1407
- }
1408
- }
1409
-
1410
- // Get plan context
1411
- if (plan_id) {
1412
- try {
1413
- context.plan = await apiClient.plans.getPlan(plan_id);
1414
- context.plan_url = buildPlanUrl(plan_id);
1415
-
1416
- const nodes = await apiClient.nodes.getNodes(plan_id);
1417
- context.statistics = calculatePlanStatistics(nodes);
1418
- context.progress_percentage = context.statistics.total > 0
1419
- ? ((context.statistics.status_counts.completed / context.statistics.total) * 100).toFixed(1) + '%'
1420
- : '0%';
1421
-
1422
- const flatNodes = flattenNodes(nodes);
1423
- context.needs_attention = {
1424
- blocked: flatNodes.filter(n => n.status === 'blocked').map(n => ({
1425
- id: n.id, title: n.title, type: n.node_type
1426
- })),
1427
- in_progress: flatNodes.filter(n => n.status === 'in_progress').map(n => ({
1428
- id: n.id, title: n.title, type: n.node_type
1429
- })),
1430
- ready_to_start: flatNodes
1431
- .filter(n => n.node_type === 'task' && n.status === 'not_started')
1432
- .slice(0, 5)
1433
- .map(n => ({ id: n.id, title: n.title }))
1434
- };
1435
-
1436
- try {
1437
- const activity = await apiClient.activity.getPlanActivity(plan_id);
1438
- context.recent_activity = (activity || []).slice(0, 5);
1439
- } catch (e) {}
1440
-
1441
- if (include_knowledge) {
1442
- try {
1443
- const graphResult = await apiClient.graphiti.graphSearch({ query: context.plan?.title || '', max_results: 10 });
1444
- context.plan_knowledge = graphResult?.results?.facts || [];
1445
- } catch (e) {}
1446
- }
1447
- } catch (e) {
1448
- context.plan_error = e.message;
1449
- }
1450
- }
1451
-
1452
- context.recommendation = context.needs_attention?.blocked?.length > 0
1453
- ? "⚠️ There are blocked tasks that need attention first"
1454
- : context.needs_attention?.in_progress?.length > 0
1455
- ? "Continue working on the in-progress tasks"
1456
- : "Pick a task from ready_to_start to begin";
1457
-
1458
- return formatResponse(context);
1459
- }
1460
-
1319
+
1461
1320
  if (name === "get_my_tasks") {
1462
1321
  const { plan_id, status = ["blocked", "in_progress"] } = args;
1463
1322
 
@@ -1711,7 +1570,7 @@ function setupTools(server, apiClientOverride) {
1711
1570
  phases: createdPhases,
1712
1571
  tasks: createdTasks,
1713
1572
  next_steps: [
1714
- "Use get_context to review the imported plan",
1573
+ "Use get_plan_context to review the imported plan",
1715
1574
  "Use quick_status to update task progress"
1716
1575
  ]
1717
1576
  });
@@ -1902,17 +1761,6 @@ function setupTools(server, apiClientOverride) {
1902
1761
  }
1903
1762
  }
1904
1763
 
1905
- if (name === "get_node_context") {
1906
- const { plan_id, node_id } = args;
1907
-
1908
- // Get node with context
1909
- const response = await apiClient.axiosInstance.get(
1910
- `/plans/${plan_id}/nodes/${node_id}/context`
1911
- );
1912
-
1913
- return formatResponse(response.data);
1914
- }
1915
-
1916
1764
  if (name === "get_node_ancestry") {
1917
1765
  const { plan_id, node_id } = args;
1918
1766
 
@@ -2122,17 +1970,6 @@ function setupTools(server, apiClientOverride) {
2122
1970
  }
2123
1971
 
2124
1972
  // ===== AGENT CONTEXT TOOLS =====
2125
- if (name === "get_agent_context") {
2126
- const { node_id, include_knowledge = true, include_siblings = false } = args;
2127
-
2128
- const result = await apiClient.context.getNodeContext(node_id, {
2129
- include_knowledge,
2130
- include_siblings
2131
- });
2132
-
2133
- return formatResponse(result);
2134
- }
2135
-
2136
1973
  if (name === "get_plan_context") {
2137
1974
  const { plan_id, include_knowledge = true } = args;
2138
1975
 
@@ -2385,7 +2222,7 @@ function setupTools(server, apiClientOverride) {
2385
2222
  recommended_workflow: [
2386
2223
  "1. Check list_goals to understand current objectives",
2387
2224
  "2. Use list_plans to see existing plans",
2388
- "3. Before working on a plan, use understand_context to get the full picture",
2225
+ "3. Before working on a plan, use get_plan_context to get the full picture",
2389
2226
  "4. Update task statuses as you work (update_node with status)",
2390
2227
  "5. Store important decisions and learnings using add_learning",
2391
2228
  "6. Check recall_knowledge before making decisions to see past context"
@@ -2486,90 +2323,6 @@ function setupTools(server, apiClientOverride) {
2486
2323
  return formatResponse(guides[topic] || guides.overview);
2487
2324
  }
2488
2325
 
2489
- if (name === "understand_context") {
2490
- const { plan_id, goal_id, include_knowledge = true } = args;
2491
-
2492
- if (!plan_id && !goal_id) {
2493
- return formatResponse({
2494
- error: "Provide either plan_id or goal_id to get context"
2495
- });
2496
- }
2497
-
2498
- const context = {
2499
- retrieved_at: new Date().toISOString()
2500
- };
2501
-
2502
- // Get goal context
2503
- if (goal_id) {
2504
- try {
2505
- context.goal = await apiClient.goals.get(goal_id);
2506
-
2507
- // Get related knowledge if available
2508
- if (include_knowledge) {
2509
- try {
2510
- const graphResult = await apiClient.graphiti.graphSearch({ query: context.goal?.title || '', max_results: 10 });
2511
- context.goal_knowledge = graphResult?.results?.facts || [];
2512
- } catch (e) {
2513
- // Knowledge fetch failed, continue without it
2514
- }
2515
- }
2516
- } catch (e) {
2517
- context.goal_error = e.message;
2518
- }
2519
- }
2520
-
2521
- // Get plan context
2522
- if (plan_id) {
2523
- try {
2524
- context.plan = await apiClient.plans.getPlan(plan_id);
2525
-
2526
- const nodes = await apiClient.nodes.getNodes(plan_id);
2527
- context.statistics = calculatePlanStatistics(nodes);
2528
- context.progress_percentage = context.statistics.total > 0
2529
- ? ((context.statistics.status_counts.completed / context.statistics.total) * 100).toFixed(1) + '%'
2530
- : '0%';
2531
-
2532
- // Get blocked and in-progress tasks for attention
2533
- const flatNodes = flattenNodes(nodes);
2534
- context.needs_attention = {
2535
- blocked: flatNodes.filter(n => n.status === 'blocked').map(n => ({
2536
- id: n.id,
2537
- title: n.title,
2538
- type: n.node_type
2539
- })),
2540
- in_progress: flatNodes.filter(n => n.status === 'in_progress').map(n => ({
2541
- id: n.id,
2542
- title: n.title,
2543
- type: n.node_type
2544
- }))
2545
- };
2546
-
2547
- // Get recent activity
2548
- try {
2549
- const activity = await apiClient.activity.getPlanActivity(plan_id);
2550
- context.recent_activity = (activity || []).slice(0, 5);
2551
- } catch (e) {
2552
- // Activity fetch failed, continue without it
2553
- }
2554
-
2555
- // Get related knowledge if available
2556
- if (include_knowledge) {
2557
- try {
2558
- const graphResult = await apiClient.graphiti.graphSearch({ query: context.plan?.title || '', max_results: 10 });
2559
- context.plan_knowledge = graphResult?.results?.facts || [];
2560
- } catch (e) {
2561
- // Knowledge fetch failed, continue without it
2562
- }
2563
- }
2564
- } catch (e) {
2565
- context.plan_error = e.message;
2566
- }
2567
- }
2568
-
2569
- context.recommendation = "Review the statistics, needs_attention, and knowledge entries before starting work.";
2570
- return formatResponse(context);
2571
- }
2572
-
2573
2326
  // ===== GOALS HEALTH DASHBOARD =====
2574
2327
  if (name === "check_goals_health") {
2575
2328
  const { status_filter } = args || {};