fix: MCP servers — broken INSERT into dropped type column, stale content refs

The previous schema sync (86f43c9) was incomplete — it renamed variables
but left the SQL statements writing to `type` and `content` columns that
no longer exist in the schema. Fresh installs crash on first node create.

nodeService.js:
- Remove `type` from INSERT/UPDATE, replace with `event_date`
- Fix `content` → `notes` in INSERT values and UPDATE SET clauses
- Add `sanitizeTitle()` and chunk fallback logic

sqlite-client.js:
- Remove `is_pinned` from CREATE TABLE
- Add `description` and `icon` to dimensions table

index.js:
- Add temporal filter fields to search schema
- Improved description prompts
- Dynamic date injection in instructions

server.js + stdio-server.js:
- Add content→notes mapping in update handlers
- Fix output returning `notes` instead of `content`
- Add extraction tool schemas and handlers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
“BeeRad”
2026-02-16 09:16:51 +11:00
co-authored by Claude Opus 4.6
parent 2f6518207d
commit 7c6197fc0d
5 changed files with 335 additions and 52 deletions
+9 -2
View File
@@ -446,9 +446,16 @@ mcpServer.registerTool(
throw new McpError(ErrorCode.InvalidParams, 'At least one field must be provided in updates.');
}
// Map MCP 'content' field → internal 'notes' field
const mappedUpdates = { ...updates };
if (mappedUpdates.content !== undefined) {
mappedUpdates.notes = mappedUpdates.content;
delete mappedUpdates.content;
}
const result = await callRaHApi(`/api/nodes/${id}`, {
method: 'PUT',
body: JSON.stringify(updates)
body: JSON.stringify(mappedUpdates)
});
const node = result.node || result.data;
@@ -485,7 +492,7 @@ mcpServer.registerTool(
nodes.push({
id: result.node.id,
title: result.node.title,
content: result.node.content ?? null,
notes: result.node.notes ?? null,
link: result.node.link ?? null,
dimensions: result.node.dimensions || [],
updated_at: result.node.updated_at