Skip to content

Commit 7a98c1b

Browse files
committed
Improve MCP tool descriptions and parameter schemas (TDQS A)
Each of the 11 waypath_* tools now ships richer descriptions covering behavior (read-only vs write), purpose, completeness, conciseness, and parameter semantics. Parameter schemas gain per-property descriptions plus length bounds. Bumps version to 0.1.2.
1 parent 14c83f1 commit 7a98c1b

2 files changed

Lines changed: 126 additions & 27 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "waypath",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Local-first external brain CLI for coding agents — SQLite-backed context, graph-aware recall, and governed memory for Claude Code, Codex, and MCP clients.",
55
"type": "module",
66
"main": "dist/src/index.js",

src/mcp/tools.ts

Lines changed: 125 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
3333
return [
3434
{
3535
name: 'waypath_recall',
36-
description: 'Search Waypath truth and archive recall.',
36+
description:
37+
'Read-only hybrid search over the local Waypath SQLite memory store. Runs FTS5 lexical search fused with graph-aware Reciprocal Rank Fusion (RRF) across truth-kernel and archive tables and returns ranked entries with source, score, and snippet. Use before answering any question that may depend on prior decisions, preferences, or project facts; call this instead of waypath_graph_query when you have a free-text query rather than a known entity id. Does not write to the database and does not hit the network.',
3738
inputSchema: {
3839
type: 'object',
3940
properties: {
40-
query: { type: 'string', description: 'Recall query text.' },
41+
query: {
42+
type: 'string',
43+
description:
44+
'Free-text recall query (1-500 chars). Supports natural language; tokens are FTS5-escaped automatically. Prefer specific nouns and project names over vague phrases ("auth service rollout plan" beats "that thing"). Required.',
45+
minLength: 1,
46+
maxLength: 500,
47+
},
4148
},
4249
required: ['query'],
4350
additionalProperties: false,
@@ -48,14 +55,36 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
4855
},
4956
{
5057
name: 'waypath_session_start',
51-
description: 'Build a Waypath session-start context pack.',
58+
description:
59+
'Read-only context pack builder for the beginning of a coding or planning session. Assembles a prioritized brief from recent decisions, active preferences, seed entities, and related graph context. Does not write to the database. Call once per session before substantive work; for mid-session lookups use waypath_recall or waypath_graph_query instead. All parameters are optional — pass what is known; omitted fields fall back to project defaults.',
5260
inputSchema: {
5361
type: 'object',
5462
properties: {
55-
project: { type: 'string' },
56-
objective: { type: 'string' },
57-
activeTask: { type: 'string' },
58-
seedEntities: { type: 'array', items: { type: 'string' } },
63+
project: {
64+
type: 'string',
65+
description:
66+
'Project identifier or slug (e.g. "acme-api"). Optional; when omitted the store is queried across all projects.',
67+
maxLength: 200,
68+
},
69+
objective: {
70+
type: 'string',
71+
description:
72+
'One-sentence goal for this session ("land the stripe webhook refactor"). Optional; biases ranking toward relevant truth-kernel entries.',
73+
maxLength: 500,
74+
},
75+
activeTask: {
76+
type: 'string',
77+
description:
78+
'Current task identifier or short label (e.g. "PROJ-412" or "fix flake in payments_test"). Optional; scopes the pack toward this task\'s neighborhood.',
79+
maxLength: 500,
80+
},
81+
seedEntities: {
82+
type: 'array',
83+
description:
84+
'Optional list of known entity ids (people, files, systems) to expand from. Useful when you already know the starting points; omit to let Waypath infer seeds from project/objective/activeTask.',
85+
items: { type: 'string', maxLength: 200 },
86+
maxItems: 32,
87+
},
5988
},
6089
additionalProperties: false,
6190
},
@@ -70,13 +99,22 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
7099
},
71100
{
72101
name: 'waypath_graph_query',
73-
description: 'Expand graph context for an entity.',
102+
description:
103+
'Read-only traversal of the Waypath knowledge graph from a specific entity id. Returns neighbors, edges, and related facts using one of four traversal patterns. Use this when you already have a resolved entity id (from waypath_recall results or from prior context); for free-text lookup use waypath_recall instead. Does not write to the database.',
74104
inputSchema: {
75105
type: 'object',
76106
properties: {
77-
entityId: { type: 'string' },
107+
entityId: {
108+
type: 'string',
109+
description:
110+
'Entity id to expand from, as returned by waypath_recall or waypath_session_start (e.g. "person:alice", "system:auth-svc"). Required.',
111+
minLength: 1,
112+
maxLength: 200,
113+
},
78114
pattern: {
79115
type: 'string',
116+
description:
117+
'Traversal pattern selector. "project_context" surfaces projects/tasks/decisions around the entity. "person_context" surfaces ownership, preferences, and collaborations. "system_reasoning" walks system → dependency → decision chains. "contradiction_lookup" finds conflicting preferences/facts attached to the entity. Optional; defaults to a balanced traversal when omitted.',
80118
enum: ['project_context', 'person_context', 'system_reasoning', 'contradiction_lookup'],
81119
},
82120
},
@@ -93,11 +131,18 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
93131
},
94132
{
95133
name: 'waypath_page',
96-
description: 'Synthesize a Waypath knowledge page.',
134+
description:
135+
'Synthesize a human-readable knowledge page about a subject by aggregating and summarizing matching truth-kernel and archive entries. Returns a structured page object plus a markdown summary. The synthesis is deterministic for a given store state and does not call out to any LLM or network service. Read-only with respect to promoted memory; may cache synthesis artifacts in the local store. Use for briefings or handoffs when a recall result would be too fragmented; for targeted lookup use waypath_recall instead.',
97136
inputSchema: {
98137
type: 'object',
99138
properties: {
100-
subject: { type: 'string' },
139+
subject: {
140+
type: 'string',
141+
description:
142+
'Subject to synthesize a page about. Can be an entity id ("project:acme-api") or a natural-language subject ("Q2 billing migration"). Required; 1-300 chars.',
143+
minLength: 1,
144+
maxLength: 300,
145+
},
101146
},
102147
required: ['subject'],
103148
additionalProperties: false,
@@ -108,11 +153,18 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
108153
},
109154
{
110155
name: 'waypath_promote',
111-
description: 'Create a Waypath promotion candidate.',
156+
description:
157+
'WRITE: submit a candidate for promotion into the Waypath truth-kernel. Creates a new candidate row in the local SQLite review queue — it does NOT promote immediately. A human (or agent with explicit authority) must call waypath_review to accept or reject the candidate before it becomes queryable by waypath_recall. Use when you want to persist a decision, preference, or fact; use waypath_review_queue to list pending candidates and waypath_review to act on them.',
112158
inputSchema: {
113159
type: 'object',
114160
properties: {
115-
subject: { type: 'string' },
161+
subject: {
162+
type: 'string',
163+
description:
164+
'The proposed truth statement or fact to promote, as free text. Will be stored verbatim on the candidate record and shown to the reviewer. 1-1000 chars. Required.',
165+
minLength: 1,
166+
maxLength: 1000,
167+
},
116168
},
117169
required: ['subject'],
118170
additionalProperties: false,
@@ -123,16 +175,30 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
123175
},
124176
{
125177
name: 'waypath_review',
126-
description: 'Review a Waypath promotion candidate.',
178+
description:
179+
'WRITE: decide the fate of a pending promotion candidate. Setting status to "accepted" promotes the candidate into the truth-kernel so it becomes visible to waypath_recall; "rejected" discards it; "superseded" marks it as replaced by a newer candidate; the other states are non-terminal holding states. This call is the governance gate between waypath_promote and durable memory — do not accept without evidence. Call waypath_review_queue first to list candidates and their ids.',
127180
inputSchema: {
128181
type: 'object',
129182
properties: {
130-
candidateId: { type: 'string' },
183+
candidateId: {
184+
type: 'string',
185+
description:
186+
'Candidate id from waypath_review_queue or the response of waypath_promote. Required.',
187+
minLength: 1,
188+
maxLength: 200,
189+
},
131190
status: {
132191
type: 'string',
192+
description:
193+
'Decision to record. "accepted" = promote into truth-kernel (visible to waypath_recall). "rejected" = discard permanently. "needs_more_evidence" = keep pending, signal reviewer needs support. "pending_review" = reset to inbox. "superseded" = replaced by a newer candidate. Required.',
133194
enum: ['pending_review', 'accepted', 'rejected', 'needs_more_evidence', 'superseded'],
134195
},
135-
notes: { type: 'string' },
196+
notes: {
197+
type: 'string',
198+
description:
199+
'Optional free-text rationale for the decision (shown in audit trail). Recommended for "rejected" and "needs_more_evidence". 0-2000 chars.',
200+
maxLength: 2000,
201+
},
136202
},
137203
required: ['candidateId', 'status'],
138204
additionalProperties: false,
@@ -147,7 +213,8 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
147213
},
148214
{
149215
name: 'waypath_review_queue',
150-
description: 'List pending review queue items, stale pages, and contradictions.',
216+
description:
217+
'Read-only snapshot of everything awaiting human attention: pending promotion candidates, stale knowledge pages past their refresh threshold, and detected preference contradictions. Use at the start of a review or maintenance session to see outstanding work; then call waypath_review, waypath_refresh_page, or waypath_resolve_contradiction as appropriate. Takes no parameters.',
151218
inputSchema: {
152219
type: 'object',
153220
properties: {},
@@ -159,14 +226,37 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
159226
},
160227
{
161228
name: 'waypath_resolve_contradiction',
162-
description: 'Resolve a Waypath preference contradiction by keeping one preference.',
229+
description:
230+
'WRITE: resolve a detected contradiction between two or more preferences sharing the same key by keeping exactly one preference and marking the others as superseded. Intended for user-scoped or project-scoped preference collisions surfaced by waypath_review_queue. Use waypath_review_queue first to see active contradictions and their preference ids. This call persists to the local store and is the destructive side of contradiction handling — the non-kept preferences are no longer returned by waypath_recall.',
163231
inputSchema: {
164232
type: 'object',
165233
properties: {
166-
key: { type: 'string', description: 'The preference key with the contradiction.' },
167-
keepPreferenceId: { type: 'string', description: 'The preference ID to keep.' },
168-
scopeRef: { type: 'string', description: 'Optional scope reference.' },
169-
notes: { type: 'string', description: 'Optional resolution notes.' },
234+
key: {
235+
type: 'string',
236+
description:
237+
'The preference key with the contradiction (e.g. "editor.tab_width", "deploy.region"). Must match the key reported by waypath_review_queue. Required.',
238+
minLength: 1,
239+
maxLength: 200,
240+
},
241+
keepPreferenceId: {
242+
type: 'string',
243+
description:
244+
'The preference id to keep as authoritative. All other preferences with the same key (and matching scope) are marked superseded. Required.',
245+
minLength: 1,
246+
maxLength: 200,
247+
},
248+
scopeRef: {
249+
type: 'string',
250+
description:
251+
'Optional scope reference ("user:dd", "project:acme-api") when the contradiction is scoped rather than global. Omit to resolve across all scopes of the key.',
252+
maxLength: 200,
253+
},
254+
notes: {
255+
type: 'string',
256+
description:
257+
'Optional free-text rationale for the resolution (stored in audit trail). Recommended for non-obvious decisions. 0-2000 chars.',
258+
maxLength: 2000,
259+
},
170260
},
171261
required: ['key', 'keepPreferenceId'],
172262
additionalProperties: false,
@@ -182,11 +272,18 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
182272
},
183273
{
184274
name: 'waypath_refresh_page',
185-
description: 'Refresh a Waypath knowledge page.',
275+
description:
276+
'WRITE: rebuild an existing knowledge page against the current store state and update its cached summary/markdown. Use on pages flagged "stale" by waypath_review_queue, or after a large batch of promotions that should be reflected in a briefing page. Idempotent — calling twice with no intervening writes produces the same output. Does not call any external service.',
186277
inputSchema: {
187278
type: 'object',
188279
properties: {
189-
pageId: { type: 'string', description: 'The knowledge page ID to refresh.' },
280+
pageId: {
281+
type: 'string',
282+
description:
283+
'The knowledge page id to refresh, as returned by waypath_page or waypath_review_queue. Required; 1-200 chars.',
284+
minLength: 1,
285+
maxLength: 200,
286+
},
190287
},
191288
required: ['pageId'],
192289
additionalProperties: false,
@@ -197,7 +294,8 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
197294
},
198295
{
199296
name: 'waypath_source_status',
200-
description: 'Inspect local source adapter availability.',
297+
description:
298+
'Read-only probe of the local source adapters Waypath can ingest from (filesystem snapshots, git repos, JCP live reader, etc.). Returns each adapter\'s availability, last-scan timestamp, and any configuration errors. Use to diagnose "why is my recall empty" or before running a large ingest. Does not write and does not hit the network. Takes no parameters.',
201299
inputSchema: {
202300
type: 'object',
203301
properties: {},
@@ -209,7 +307,8 @@ export function createWaypathMcpTools(): readonly WaypathMcpTool[] {
209307
},
210308
{
211309
name: 'waypath_health',
212-
description: 'Inspect Waypath database health, FTS sync, and source probe status.',
310+
description:
311+
'Read-only end-to-end health check: SQLite connectivity and migration version, FTS5 index sync status, source adapter probe results, and truth-kernel row counts. Safe to call any time and from any context. Use as a single diagnostic entrypoint before opening a support issue; for adapter-specific detail call waypath_source_status. Takes no parameters.',
213312
inputSchema: {
214313
type: 'object',
215314
properties: {},

0 commit comments

Comments
 (0)