@enfyra/mcp-server 0.0.65 → 0.0.66
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/package.json
CHANGED
package/src/lib/mcp-examples.js
CHANGED
|
@@ -213,13 +213,13 @@ window.location.href = url.toString()`,
|
|
|
213
213
|
}
|
|
214
214
|
]),
|
|
215
215
|
indexes: JSON.stringify([
|
|
216
|
-
["conversation", "createdAt"]
|
|
217
|
-
["sender", "createdAt"]
|
|
216
|
+
["conversation", "createdAt"]
|
|
218
217
|
])
|
|
219
218
|
})`,
|
|
220
219
|
notes: [
|
|
221
220
|
'Use user_definition as the user table.',
|
|
222
221
|
'Do not add inverse relations on user_definition unless the user explicitly asks.',
|
|
222
|
+
'createdAt, updatedAt, and custom date/datetime/timestamp fields already get auto-generated single-field indexes; add only compound indexes needed by hot filters.',
|
|
223
223
|
'Do not provide physical FK column names; Enfyra derives them.',
|
|
224
224
|
],
|
|
225
225
|
},
|
|
@@ -270,6 +270,7 @@ window.location.href = url.toString()`,
|
|
|
270
270
|
})`,
|
|
271
271
|
notes: [
|
|
272
272
|
'Unread is per user and per message; do not put global read state on conversation.',
|
|
273
|
+
'readAt is a datetime field and gets its own auto index; the explicit indexes here are compound unread lookup indexes.',
|
|
273
274
|
'For chat-list UX, default to a boolean unread dot instead of exact counts.',
|
|
274
275
|
],
|
|
275
276
|
},
|
|
@@ -84,6 +84,7 @@ export function buildMcpServerInstructions(apiBaseUrl) {
|
|
|
84
84
|
'- MCP **`create_table` supports creating columns and relations in the same call**: pass `columns` and `relations` as JSON arrays. Use `create_relation` only when adding a relation to an existing table later.',
|
|
85
85
|
'- MCP **`create_table` supports `isSingleRecord` directly**. Set `isSingleRecord: true` in the create call for settings/config tables that should keep only one record; do not create first and then patch only for this flag.',
|
|
86
86
|
'- MCP **`create_table` and `update_table` support `indexes` and `uniques`** as JSON arrays of logical field groups. Use compound indexes for hot filters and unread/read state, e.g. `indexes: [["member","isRead","conversation"],["conversation","member","isRead"]]` and `uniques: [["message","member"]]`. Relation property names are allowed; Enfyra resolves them to physical FK columns for SQL and Mongo.',
|
|
87
|
+
'- Enfyra auto-generates single-field indexes for `createdAt`, `updatedAt`, and scalar time columns with type `date`, `datetime`, or `timestamp`. SQL appends `id` as the stable tie-breaker, and Mongo appends `_id`. Do not add duplicate single-field indexes for these time fields; add explicit compound indexes only when a hot query combines the time field with other filters such as status, owner, tenant, or relation fields.',
|
|
87
88
|
'- MCP **`create_table` does not accept `alias`**. Do not invent or send alias during table creation; default route/schema behavior is based on `name`. Use `update_table` later only when alias truly needs to change.',
|
|
88
89
|
'- In `create_table.relations`, each relation uses `targetTable` (table id or `{id}`), `type`, `propertyName`, optional `inversePropertyName` or `mappedBy`, `isNullable`, `onDelete`, and `description`. The target table must already exist.',
|
|
89
90
|
'- **Use `user_definition` as the only user table.** Do not create app-specific user/profile mapping tables such as `chat_profile`, `app_user`, `customer_user`, or tables that only mirror/link Enfyra users. If an app needs extra user fields or user relations, add columns/relations directly on `user_definition`.',
|