agent-planner-mcp 1.5.15 → 1.5.19

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/SKILL.md CHANGED
@@ -42,6 +42,9 @@ AgentPlanner exposes a **BDI-aligned** surface — Beliefs (state queries), Desi
42
42
  - `update_goal` — atomic goal update; subsumes link/unlink + achiever changes
43
43
  - `create_goal` — create a new top-level goal (no parent). Agents create goals directly when asked — no UI step. Defaults to `status='active'`.
44
44
  - `derive_subgoal` *(v1.0)* — create a sub-goal under an existing parent (use `create_goal` for top-level).
45
+ - `record_criterion_progress` — set the `current` value of a measurable success criterion (by `criterion_id` or 0-based `index`, both shown in `goal_state`). The write that drives goal attainment, e.g. "p99 latency: current 140 → 100".
46
+
47
+ **Success criteria** (`success_criteria` on create/derive/update) accept either plain strings (qualitative) or structured measurable objects: `{ statement, metric?, target?, current?, unit?, direction: 'increase'|'decrease'|'boolean' }`. A criterion with **metric + target + direction** is *measurable* and counts toward goal attainment (`increase`: current ≥ target, `decrease`: current ≤ target, `boolean`: current truthy). Prefer measurable criteria — "p99 latency < 100ms" beats "make it fast".
45
48
 
46
49
  ### Intentions — what am I committing to?
47
50
 
@@ -334,6 +337,26 @@ recall_knowledge({
334
337
  - **v0.8.x → v0.9.0** — clean break. 63 legacy CRUD tools collapsed into 15 BDI-aligned tools. See [docs/MIGRATION_v0.9.md](docs/MIGRATION_v0.9.md) for the full mapping.
335
338
  - **v0.9.x → v1.0.0** — additive. v0.9 read/update tools unchanged. Adds the full mutation surface (creation, structural edits, sharing, collaboration) so humans can steer entirely through agent conversation. The previously planned `ap_admin_*` namespace is no longer needed — those operations are now first-class BDI tools, with the draft-status seam keeping autonomous agent creation reviewable. See [docs/MIGRATION_v1.0.md](docs/MIGRATION_v1.0.md).
336
339
 
340
+ ## UI vocabulary → data model → tools
341
+
342
+ The web UI (agentplanner.io) and these tools are the same system in two languages. When a human refers to something they see on a screen, map it here:
343
+
344
+ | UI term | What it is | Tools |
345
+ |---|---|---|
346
+ | **Workspace** | Org-scoped folder that owns goals + plans | `list_workspaces`, `create_workspace` |
347
+ | **Blueprint** | Dehydrated, reusable plan shape; forks into a workspace | `list_blueprints`, `save_as_blueprint`, `fork_blueprint`, `delete_blueprint` |
348
+ | **Mission / Mission Control** | Home overview: goal health, decision queue, activity | `briefing` |
349
+ | **Goal** (a *Desire*) | What you're pursuing | `create_goal`, `derive_subgoal`, `list_goals`, `goal_state`, `update_goal` |
350
+ | **Plan** (an *Intention*) | Committed plan of action that achieves a goal | `form_intention` (create), `extend_intention` (add nodes), `update_plan`, `update_node`, `move_node` |
351
+ | **Knowledge / episode** (a *Belief*) | Facts the agents have learned | `add_learning`, `recall_knowledge` |
352
+ | **Health** | Per-goal `on_track` / `at_risk` / `stale` | `briefing`, `list_goals`, `goal_state` |
353
+ | **Tension / Contradiction** | A coherence conflict — new knowledge contradicts existing facts or tasks (UI "Tensions" card) | `plan_analysis` (coherence), `recall_knowledge` (current vs superseded facts) |
354
+ | **Decision queue / "Awaiting you"** | Human approvals pending | `queue_decision`, `resolve_decision` |
355
+ | **Committed vs Proposed** | A goal is *committed* once promoted (`promoted_at` set), *proposed* before | `update_goal({ committed })` |
356
+ | **Attainment vs Execution** | *Attainment* = success criteria met; *Execution* = tasks completed. Distinct numbers. | `record_criterion_progress` (attainment), `update_task` (execution) |
357
+ | **Critical path / Bottlenecks** | Longest blocking chain / high-fan-out incomplete tasks | `plan_analysis` |
358
+ | **RPI chain** | Research → Plan → Implement decomposition | `propose_research_chain` |
359
+
337
360
  ## Principles
338
361
 
339
362
  - Tools are intent-shaped, not CRUD-shaped — name what you want to accomplish, not which row to mutate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-planner-mcp",
3
- "version": "1.5.15",
3
+ "version": "1.5.19",
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/api-client.js CHANGED
@@ -592,6 +592,11 @@ const goals = {
592
592
  return response.data;
593
593
  },
594
594
 
595
+ recordCriterionProgress: async (goalId, body) => {
596
+ const response = await apiClient.post(`/goals/${goalId}/criteria/progress`, body);
597
+ return response.data;
598
+ },
599
+
595
600
  // v2 goal-dependency endpoints
596
601
  getPath: async (goalId, maxDepth) => {
597
602
  const params = maxDepth ? `?max_depth=${maxDepth}` : '';
package/src/index.js CHANGED
@@ -3,6 +3,7 @@ const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
3
3
  const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
4
4
  const { MCPHTTPServer } = require('./server-http');
5
5
  const { setupTools } = require('./tools');
6
+ const { SERVER_INSTRUCTIONS } = require('./server-instructions');
6
7
  const { version } = require('../package.json');
7
8
  require('dotenv').config();
8
9
 
@@ -77,7 +78,10 @@ async function main() {
77
78
  }, {
78
79
  capabilities: {
79
80
  tools: {}
80
- }
81
+ },
82
+ // Shown to the model on connect — the no-skill safety net mapping plain
83
+ // intents to the BDI tool names + pointing at get_started.
84
+ instructions: SERVER_INSTRUCTIONS
81
85
  });
82
86
 
83
87
  console.error('MCP Server created');
@@ -15,6 +15,7 @@
15
15
  const express = require('express');
16
16
  const { SessionManager } = require('./session-manager');
17
17
  const { setupTools } = require('./tools');
18
+ const { SERVER_INSTRUCTIONS } = require('./server-instructions');
18
19
  const { createApiClient } = require('./api-client');
19
20
  const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
20
21
  const { createOAuthMetadata, mcpAuthMetadataRouter, getOAuthProtectedResourceMetadataUrl } = require('@modelcontextprotocol/sdk/server/auth/router.js');
@@ -522,7 +523,9 @@ class MCPHTTPServer {
522
523
  }, {
523
524
  capabilities: {
524
525
  tools: {}
525
- }
526
+ },
527
+ // Shown to the model on connect — the no-skill safety net (see index.js).
528
+ instructions: SERVER_INSTRUCTIONS
526
529
  });
527
530
 
528
531
  // Get per-session API client (bound to user's token), or create one for initialize requests
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Server-level MCP instructions — surfaced to the model the moment the server
3
+ * connects, independent of any externally-loaded skill. This is the safety net
4
+ * for agents that do NOT have the AgentPlanner SKILL.md: it maps plain intents
5
+ * to the BDI tool names (which were renamed at v0.9, e.g. "create a plan" is
6
+ * `form_intention`, not `create_plan`) and points to `get_started` for the rest.
7
+ *
8
+ * Keep this short — it's read on every connect. Deeper guidance lives in
9
+ * `get_started` (auto-derived from the live tool set, so it can't drift).
10
+ */
11
+ const SERVER_INSTRUCTIONS = [
12
+ 'AgentPlanner uses an intent-shaped, BDI-aligned tool vocabulary (renamed at v0.9 — there is no create_plan/quick_plan/create_node/quick_status).',
13
+ 'New here or unsure which tool? Call `get_started` first — it returns the full tool map and recommended workflows.',
14
+ '',
15
+ 'Common intents → tool:',
16
+ '- Create a goal → `create_goal` (a sub-goal → `derive_subgoal`)',
17
+ '- Create a plan with its task tree → `form_intention` (add tasks later → `extend_intention`; an R→P→I chain → `propose_research_chain`)',
18
+ '- Find and claim the next task → `claim_next_task`',
19
+ '- Update status / log progress / finish a task → `update_task` (folds the old quick_status + quick_log + add_log + release)',
20
+ '- Read a goal (details, progress, quality, bottlenecks) → `goal_state`; all goals’ health → `briefing` / `list_goals`',
21
+ '- Read a task in context → `task_context`; analyze a plan (critical path, bottlenecks, impact, coherence) → `plan_analysis`',
22
+ '- Record / recall knowledge → `add_learning` / `recall_knowledge`',
23
+ '- Queue a human decision → `queue_decision`; resolve one → `resolve_decision`',
24
+ ].join('\n');
25
+
26
+ module.exports = { SERVER_INSTRUCTIONS };
@@ -617,7 +617,8 @@ const planAnalysisDefinition = {
617
617
  name: 'plan_analysis',
618
618
  description:
619
619
  "Advanced plan reads: impact analysis (delay/block/remove), critical path, " +
620
- "bottleneck list, or coherence check.",
620
+ "bottleneck list, or coherence check. Replaces the legacy analyze_impact / " +
621
+ "get_critical_path / run_coherence_check / check_coherence_pending tools.",
621
622
  inputSchema: {
622
623
  type: 'object',
623
624
  properties: {
@@ -9,6 +9,35 @@
9
9
 
10
10
  const { asOf, formatResponse, errorResponse, safeArray, apiErrorMessage } = require('./_shared');
11
11
 
12
+ // Success criteria accept plain strings (qualitative) or structured measurable
13
+ // units. A criterion with metric+target+direction becomes "measurable" and
14
+ // drives goal attainment (see the backend's goalCriteria.normalizeCriteria,
15
+ // which also maps legacy string[] / {criteria:[]} shapes onto this).
16
+ const SUCCESS_CRITERIA_SCHEMA = {
17
+ type: 'array',
18
+ description:
19
+ "Each entry is a plain string (qualitative) OR a structured object " +
20
+ "{ statement, metric?, target?, current?, unit?, direction: 'increase'|'decrease'|'boolean' }. " +
21
+ "Give a criterion metric+target+direction to make it measurable so it counts toward goal attainment.",
22
+ items: {
23
+ oneOf: [
24
+ { type: 'string' },
25
+ {
26
+ type: 'object',
27
+ required: ['statement'],
28
+ properties: {
29
+ statement: { type: 'string', description: 'Human-readable condition.' },
30
+ metric: { type: 'string', description: 'What is measured, e.g. "p99 latency".' },
31
+ target: { description: 'Goal value (number or string).' },
32
+ current: { description: 'Latest observed value (number or string).' },
33
+ unit: { type: 'string', description: 'e.g. "ms", "%", "customers".' },
34
+ direction: { type: 'string', enum: ['increase', 'decrease', 'boolean'] },
35
+ },
36
+ },
37
+ ],
38
+ },
39
+ };
40
+
12
41
  const listGoalsDefinition = {
13
42
  name: 'list_goals',
14
43
  description:
@@ -93,7 +122,7 @@ const updateGoalDefinition = {
93
122
  // Commitment: true once the goal is promoted to active execution
94
123
  // (replaces the old desire/intention goal_type vocabulary).
95
124
  committed: { type: 'boolean' },
96
- success_criteria: {},
125
+ success_criteria: SUCCESS_CRITERIA_SCHEMA,
97
126
  add_linked_plans: { type: 'array', items: { type: 'string' } },
98
127
  remove_linked_plans: { type: 'array', items: { type: 'string' } },
99
128
  add_achievers: { type: 'array', items: { type: 'string' } },
@@ -210,11 +239,7 @@ const deriveSubgoalDefinition = {
210
239
  default: 'active',
211
240
  description: "Default 'active' for human-directed creation. Pass 'draft' when acting autonomously without explicit user direction.",
212
241
  },
213
- success_criteria: {
214
- type: 'array',
215
- items: { type: 'string' },
216
- description: "Concrete, observable conditions that mark this sub-goal achieved.",
217
- },
242
+ success_criteria: SUCCESS_CRITERIA_SCHEMA,
218
243
  priority: { type: 'integer', default: 0 },
219
244
  },
220
245
  required: ['parent_goal_id', 'title', 'rationale'],
@@ -301,11 +326,7 @@ const createGoalDefinition = {
301
326
  default: 'active',
302
327
  description: "Default 'active' (live). Pass 'draft' to propose without activating.",
303
328
  },
304
- success_criteria: {
305
- type: 'array',
306
- items: { type: 'string' },
307
- description: "Concrete, observable conditions that mark this goal achieved.",
308
- },
329
+ success_criteria: SUCCESS_CRITERIA_SCHEMA,
309
330
  priority: { type: 'integer', minimum: 0, maximum: 10, default: 0 },
310
331
  workspace_id: { type: 'string', description: "Optional. Target workspace; defaults to the active org's default workspace." },
311
332
  },
@@ -342,12 +363,66 @@ async function createGoalHandler(args, apiClient) {
342
363
  });
343
364
  }
344
365
 
366
+ // ─────────────────────────────────────────────────────────────────────────
367
+ // record_criterion_progress — set the current value of a measurable criterion.
368
+ // This is the write that makes goal attainment real (metric moved 40→72).
369
+ // ─────────────────────────────────────────────────────────────────────────
370
+
371
+ const recordCriterionProgressDefinition = {
372
+ name: 'record_criterion_progress',
373
+ description:
374
+ "Record the latest observed value of one of a goal's success criteria " +
375
+ "(e.g. a metric moved 40→72). Identify the criterion by criterion_id " +
376
+ "(stable, like 'c0') or its 0-based index — both are visible in goal_state. " +
377
+ "Only measurable criteria (metric+target+direction) count toward attainment; " +
378
+ "this is the write that makes goal attainment real.",
379
+ inputSchema: {
380
+ type: 'object',
381
+ properties: {
382
+ goal_id: { type: 'string' },
383
+ criterion_id: { type: 'string', description: "Stable criterion id (e.g. 'c0'). Use this or index." },
384
+ index: { type: 'integer', description: '0-based position of the criterion. Alternative to criterion_id.' },
385
+ current: { description: 'Latest observed value (number or string). Required.' },
386
+ },
387
+ required: ['goal_id', 'current'],
388
+ },
389
+ };
390
+
391
+ async function recordCriterionProgressHandler(args, apiClient) {
392
+ const { goal_id, criterion_id, index, current } = args;
393
+ if (!goal_id) return errorResponse('invalid_arg', 'record_criterion_progress requires goal_id');
394
+ if (current === undefined) return errorResponse('invalid_arg', 'record_criterion_progress requires current');
395
+ if (!criterion_id && !Number.isInteger(index)) {
396
+ return errorResponse('invalid_arg', 'record_criterion_progress requires criterion_id or index');
397
+ }
398
+
399
+ const body = { current };
400
+ if (criterion_id) body.criterion_id = criterion_id;
401
+ if (Number.isInteger(index)) body.index = index;
402
+
403
+ try {
404
+ const result = await apiClient.goals.recordCriterionProgress(goal_id, body);
405
+ return formatResponse({ as_of: asOf(), goal_id, criterion: result.criterion, criteria: result.criteria });
406
+ } catch (err) {
407
+ const status = err.response?.status;
408
+ if (status === 404) return errorResponse('not_found', apiErrorMessage(err));
409
+ return errorResponse('upstream_unavailable', `record_criterion_progress failed: ${apiErrorMessage(err)}`);
410
+ }
411
+ }
412
+
345
413
  module.exports = {
346
- definitions: [listGoalsDefinition, updateGoalDefinition, createGoalDefinition, deriveSubgoalDefinition],
414
+ definitions: [
415
+ listGoalsDefinition,
416
+ updateGoalDefinition,
417
+ createGoalDefinition,
418
+ deriveSubgoalDefinition,
419
+ recordCriterionProgressDefinition,
420
+ ],
347
421
  handlers: {
348
422
  list_goals: listGoalsHandler,
349
423
  update_goal: updateGoalHandler,
350
424
  create_goal: createGoalHandler,
351
425
  derive_subgoal: deriveSubgoalHandler,
426
+ record_criterion_progress: recordCriterionProgressHandler,
352
427
  },
353
428
  };
@@ -791,7 +791,10 @@ const formIntentionDefinition = {
791
791
  name: 'form_intention',
792
792
  description:
793
793
  "Create a plan that achieves a goal, including an initial phase/task " +
794
- "tree, in one call. Declare execution order inline: give nodes a `ref` and " +
794
+ "tree, in one call. This is the canonical way to CREATE A PLAN (replaces the " +
795
+ "legacy quick_plan / create_plan / import_plan_markdown; inline nodes replace " +
796
+ "create_node / quick_task; depends_on replaces create_dependency). " +
797
+ "Declare execution order inline: give nodes a `ref` and " +
795
798
  "list prerequisite refs/titles in `depends_on` to create 'blocks' edges in " +
796
799
  "the same call — don't ship a bare hierarchy. The response returns a " +
797
800
  "`structure` summary and warns (`created_without_dependencies`) when a " +
@@ -961,19 +964,22 @@ async function formIntentionHandler(args, apiClient) {
961
964
  }
962
965
  }
963
966
 
964
- // 3. Link plan to goal (best-effort).
967
+ // 3. Create tree (top-level children parent to root via omitted parent_id).
968
+ const nodeResults = [];
969
+ const ctx = { refMap: new Map(), titleMap: new Map(), edgeIntents: [] };
970
+ await createSubtree(apiClient, plan.id, null, tree, nodeResults, ctx);
971
+
972
+ // 4. Link plan to goal (best-effort) — AFTER the tree exists. The link
973
+ // endpoint cascades 'achieves' edges to all CURRENT task nodes, so linking
974
+ // before node creation wired zero achievers (goal_state then showed empty
975
+ // linked_tasks and fell back to coarse linked-plan stats). Order matters.
965
976
  try {
966
977
  await apiClient.goals.linkPlan(goal_id, plan.id);
967
978
  } catch (err) {
968
979
  // Non-fatal — plan exists, link can be retried by user.
969
980
  }
970
981
 
971
- // 3. Create tree (top-level children parent to root via omitted parent_id).
972
- const nodeResults = [];
973
- const ctx = { refMap: new Map(), titleMap: new Map(), edgeIntents: [] };
974
- await createSubtree(apiClient, plan.id, null, tree, nodeResults, ctx);
975
-
976
- // 4. Wire inline dependency edges. depends_on:[X] on N means X blocks N.
982
+ // 5. Wire inline dependency edges. depends_on:[X] on N means X blocks N.
977
983
  const resolveRef = (ref) => {
978
984
  if (ctx.refMap.has(ref)) return ctx.refMap.get(ref);
979
985
  const byTitle = ctx.titleMap.get(ref);
@@ -8,9 +8,11 @@ const { version: MCP_VERSION } = require('../../../package.json');
8
8
  const getStartedDefinition = {
9
9
  name: 'get_started',
10
10
  description:
11
- "Onboarding for new agents. Returns the BDI tool surface map and recommended " +
12
- "workflows: mission control loop (Cowork), single-task session (Code/CLI), " +
13
- "multi-agent claiming (OpenClaw).",
11
+ "Call this FIRST when you are new to AgentPlanner or unsure which tool to use " +
12
+ "(e.g. looking for create_plan / quick_plan the answer is form_intention). " +
13
+ "Returns the live BDI tool-surface map and recommended workflows: mission " +
14
+ "control loop (Cowork), single-task session (Code/CLI), multi-agent claiming " +
15
+ "(OpenClaw). The map is derived from the actual tool set, so it can't drift.",
14
16
  inputSchema: {
15
17
  type: 'object',
16
18
  properties: {
@@ -29,6 +31,17 @@ async function getStartedHandler(args, apiClient) {
29
31
  api = { version: 'unavailable' };
30
32
  }
31
33
 
34
+ // Derived from the actual module definitions so this map can't drift from the
35
+ // real tool set (it silently did — delete_blueprint and record_criterion_progress
36
+ // were both missing at points). Lazy require avoids any load-order cycle.
37
+ const namesOf = (mod) => (mod.definitions || []).map((d) => d.name);
38
+ const toolsByNamespace = {
39
+ beliefs: namesOf(require('./beliefs')),
40
+ desires: namesOf(require('./desires')),
41
+ intentions: namesOf(require('./intentions')),
42
+ workspaces: namesOf(require('./workspaces')),
43
+ };
44
+
32
45
  return formatResponse({
33
46
  as_of: asOf(),
34
47
  mcp_version: MCP_VERSION,
@@ -39,12 +52,7 @@ async function getStartedHandler(args, apiClient) {
39
52
  "AgentPlanner exposes a BDI-aligned MCP surface. Tools are grouped by " +
40
53
  "Beliefs (state queries), Desires (goals), and Intentions (committed actions). " +
41
54
  "Each tool answers one whole agentic question and returns an `as_of` timestamp.",
42
- tools_by_namespace: {
43
- beliefs: ['briefing', 'list_plans', 'task_context', 'goal_state', 'recall_knowledge', 'search', 'plan_analysis'],
44
- desires: ['list_goals', 'create_goal', 'update_goal', 'derive_subgoal'],
45
- intentions: ['form_intention', 'extend_intention', 'link_intentions', 'propose_research_chain', 'claim_next_task', 'update_task', 'update_node', 'release_task', 'queue_decision', 'resolve_decision', 'add_learning'],
46
- workspaces: ['list_workspaces', 'create_workspace', 'list_blueprints', 'fork_blueprint', 'save_as_blueprint', 'delete_blueprint'],
47
- },
55
+ tools_by_namespace: toolsByNamespace,
48
56
  recommended_workflows: [
49
57
  {
50
58
  name: 'Set up new work a human asked for',