You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
14 tool-description rewrites to prevent first-use misuse:
* All 8 server-beta-only tools (observation_add, observation_record_event,
observation_search, observation_context, observation_generation_status,
memory_add, memory_search, memory_context) now prefix the description
with [Server-beta runtime only — DISABLED in default "worker" runtime.]
and append a one-line pointer to the worker-runtime equivalent. The
transport already returns this error at call-time; surfacing it in the
description lets Claude pick the right tool the first time.
* search.obs_type now warns about the FTS5 type-token trap: combining
query='bugfix' with obs_type='bugfix' returns 0 results because the
FTS5 index covers title/subtitle/narrative/text/facts/concepts but
NOT the type column. Use one or the other for type-token queries.
* prime_corpus / query_corpus / rebuild_corpus / reprime_corpus
preconditions strengthened — explicit that query_corpus errors when
prime is missing, that rebuild doesn't reprime, and that responses
are LLM-generative rather than deterministic lookups.
* build_corpus description rewritten to list canonical types and
emphasize verifying stats.observation_count before priming.
Copy file name to clipboardExpand all lines: src/servers/mcp-server.ts
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -524,7 +524,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
524
524
// MCP clients keep working without rewrites. (Plan line 753.)
525
525
{
526
526
name: 'observation_add',
527
-
description: 'Insert a manual observation directly into server-beta storage. Calls /v1/memories — does NOT enqueue generation. Server-beta runtime only. Params: content (required), projectId (optional, falls back to settings), serverSessionId, kind, metadata.',
527
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Insert a manual observation directly into server-beta storage (/v1/memories — does NOT enqueue generation). In worker runtime use the hook pipeline (hook-client.mjs) instead. Params: content (required), projectId (optional, falls back to settings), serverSessionId, kind, metadata.',
528
528
inputSchema: {
529
529
type: 'object',
530
530
properties: {
@@ -541,7 +541,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
541
541
},
542
542
{
543
543
name: 'observation_record_event',
544
-
description: 'Record an agent event into server-beta. Calls /v1/events — server inserts the event row, the outbox row, and enqueues a generation job atomically. Server-beta runtime only.',
544
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Record an agent event (/v1/events) — server inserts event row, outbox row, and enqueues a generation job atomically. Worker runtime: use the hook pipeline (hook-client.mjs) instead.',
545
545
inputSchema: {
546
546
type: 'object',
547
547
properties: {
@@ -562,7 +562,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
562
562
},
563
563
{
564
564
name: 'observation_search',
565
-
description: 'Full-text search across generated observations using server-beta\'s GIN tsvector index (Phase 1). Calls /v1/search. Server-beta runtime only. Params: query (required), projectId (optional), limit (default 20, max 100).',
565
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Full-text search across server-beta-generated observations (Postgres FTS). In worker runtime use the top-level `search` tool instead. Params: query (required), projectId, limit (default 20, max 100).',
566
566
inputSchema: {
567
567
type: 'object',
568
568
properties: {
@@ -577,7 +577,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
577
577
},
578
578
{
579
579
name: 'observation_context',
580
-
description: 'Get top-N relevant observations for context injection. Returns matched observations AND a pre-joined context string suitable for prompt injection. Calls /v1/context. Server-beta runtime only.',
580
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Returns top-N relevant observations PLUS a single concatenated text block ready for system-prompt injection. Worker-runtime substitute: use `search` + `get_observations` and concat manually.',
581
581
inputSchema: {
582
582
type: 'object',
583
583
properties: {
@@ -592,7 +592,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
592
592
},
593
593
{
594
594
name: 'observation_generation_status',
595
-
description: 'Look up the status of an observationgeneration job by id. Calls /v1/jobs/:id. Server-beta runtime only. Returns the same payload as REST.',
595
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Look up an observation-generation job (LLM job that converts a raw event into a structured observation). Worker runtime has no equivalent. Params: jobId (required).',
596
596
inputSchema: {
597
597
type: 'object',
598
598
properties: {
@@ -609,7 +609,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
609
609
// there is one code path for MCP write/read against server-beta.
610
610
{
611
611
name: 'memory_add',
612
-
description: 'Compatibility alias for observation_add. Same behavior; same schema modulo the legacy field names.',
612
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Pure compatibility alias for observation_add — supports legacy field names "narrative" and "title". New code should call observation_add directly. Not usable in worker runtime.',
613
613
inputSchema: {
614
614
type: 'object',
615
615
properties: {
@@ -640,7 +640,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
640
640
},
641
641
{
642
642
name: 'memory_search',
643
-
description: 'Compatibility alias for observation_search. Same FTS path; same /v1/search REST endpoint.',
643
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Pure compatibility alias for observation_search. New code should call the top-level `search` (worker runtime) or observation_search (server-beta).',
644
644
inputSchema: {
645
645
type: 'object',
646
646
properties: {
@@ -655,7 +655,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
655
655
},
656
656
{
657
657
name: 'memory_context',
658
-
description: 'Compatibility alias for observation_context. Same /v1/context REST endpoint.',
658
+
description: '[Server-beta runtime only — DISABLED in default "worker" runtime.] Pure compatibility alias for observation_context. Not usable in worker runtime.',
659
659
inputSchema: {
660
660
type: 'object',
661
661
properties: {
@@ -781,7 +781,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
781
781
},
782
782
{
783
783
name: 'build_corpus',
784
-
description: 'Build a knowledge corpus from filtered observations. Creates a queryable knowledge agent. Params: name (required), description, project, types (comma-separated), concepts (comma-separated), files (comma-separated), query, dateStart, dateEnd, limit',
784
+
description: 'Build a knowledge corpus snapshot for later prime_corpus + query_corpus. Verify `stats.observation_count` and `date_range` in the response before priming. Params: name (required, used as filename), description, project, types (comma-separated; canonical: bugfix,decision,feature,change,refactor,discovery), concepts, files, query, dateStart (ISO), dateEnd (ISO), limit (default 500).',
785
785
inputSchema: {
786
786
type: 'object',
787
787
properties: {
@@ -817,7 +817,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
817
817
},
818
818
{
819
819
name: 'prime_corpus',
820
-
description: 'Prime a knowledge corpus — creates an AI session loaded with the corpus knowledge. Must be called before query_corpus.',
820
+
description: 'Prime a corpus into a fresh AI session. Returns {session_id, name}. REQUIRED before query_corpus — querying an unprimed corpus errors. Session persists for the MCP server lifetime. After rebuild_corpus call reprime_corpus to pick up new observations.',
821
821
inputSchema: {
822
822
type: 'object',
823
823
properties: {
@@ -834,7 +834,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
834
834
},
835
835
{
836
836
name: 'query_corpus',
837
-
description: 'Ask a question to a primed knowledge corpus. The corpus must be primed first with prime_corpus.',
837
+
description: 'Ask a natural-language question against a primed corpus; returns an LLM-synthesized answer with citations like [obs:<id>]. PRECONDITION: prime_corpus(name) must have been called first in this MCP server lifetime — otherwise this errors. The answer is generative, NOT a deterministic lookup. Params: name (corpus), question.',
838
838
inputSchema: {
839
839
type: 'object',
840
840
properties: {
@@ -852,7 +852,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
852
852
},
853
853
{
854
854
name: 'rebuild_corpus',
855
-
description: 'Rebuild a knowledge corpus from its stored filter — re-runs the search to refresh with new observations. Does not re-prime the session.',
855
+
description: 'Re-run a corpus filter to pick up new observations. Does NOT touch the primed AI session — to make queries reflect the rebuild, also call reprime_corpus(name). Inherits the same filter logic as build_corpus.',
856
856
inputSchema: {
857
857
type: 'object',
858
858
properties: {
@@ -869,7 +869,7 @@ NEVER fetch full details without filtering first. 10x token savings.`,
869
869
},
870
870
{
871
871
name: 'reprime_corpus',
872
-
description: 'Create a fresh knowledge agent session for a corpus, clearing prior Q&A context. Use when conversation has drifted or after rebuilding.',
872
+
description: "Discard a corpus' current AI session and create a fresh one — clears all prior Q&A history. Use after rebuild_corpus, after the conversation has drifted, or to escape a confused session. Previous session_id is no longer queryable after this.",
0 commit comments