@ductape/mcp 0.1.30 → 0.1.31
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/dist/index.js +26 -10
- package/package.json +1 -1
- package/src/index.ts +30 -10
package/dist/index.js
CHANGED
|
@@ -522,11 +522,15 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
522
522
|
databases.connect [{ product, env, database }]
|
|
523
523
|
databases.testConnection [{ product, env, database }]
|
|
524
524
|
databases.disconnect []
|
|
525
|
-
databases.query [{ product, env, database,
|
|
526
|
-
databases.insert [{ product, env, database,
|
|
527
|
-
databases.update [{ product, env, database,
|
|
528
|
-
databases.delete [{ product, env, database,
|
|
529
|
-
databases.upsert [{ product, env, database,
|
|
525
|
+
databases.query [{ product, env, database, table, where?: {field: value}, select?: string[], orderBy?: [{field, order:"ASC"|"DESC"}], limit?, offset?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="query", targets={database, table})
|
|
526
|
+
databases.insert [{ product, env, database, table, data: {key: value}|{key:value}[], returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="insert", targets={database, table})
|
|
527
|
+
databases.update [{ product, env, database, table, data: {key:value}, where: {field: value}, returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="update", targets={database, table})
|
|
528
|
+
databases.delete [{ product, env, database, table, where: {field: value}, returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="delete", targets={database, table})
|
|
529
|
+
databases.upsert [{ product, env, database, table, data: {key:value}, conflictKeys: string[], returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="upsert", targets={database, table})
|
|
530
|
+
NOTE: ductape_generate_payload for databases returns:
|
|
531
|
+
payload.input — ready-to-use input with real field names in where/data, plus session and cache inside input
|
|
532
|
+
meta.schema_context.database.fields — { fieldName: { type, required, description?, sample? } } for the table
|
|
533
|
+
meta.schema_context.database.available_tables — list of all tables that have configured actions
|
|
530
534
|
databases.count [{ product, env, database, entity, where? }]
|
|
531
535
|
databases.sum [{ product, env, database, entity, field, where? }]
|
|
532
536
|
databases.avg [{ product, env, database, entity, field, where? }]
|
|
@@ -558,8 +562,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
558
562
|
databases.action.fetch [action_tag]
|
|
559
563
|
databases.action.list [database_tag]
|
|
560
564
|
databases.action.delete [action_tag]
|
|
561
|
-
databases.action.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database,
|
|
562
|
-
databases.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch")
|
|
565
|
+
databases.action.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"})
|
|
566
|
+
databases.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"})
|
|
563
567
|
databases.beginTransaction [{ product, env, database, isolationLevel?: "READ_COMMITTED"|"REPEATABLE_READ"|"SERIALIZABLE" }]
|
|
564
568
|
→ returns a transaction object; pass it to insert/update/delete/upsert/query calls as the last argument.
|
|
565
569
|
Commit with: transaction.commit() Rollback with: transaction.rollback()
|
|
@@ -891,14 +895,26 @@ const payloadGenerateInputSchema = z.object({
|
|
|
891
895
|
targets: z.record(z.any()).optional().describe('Identifies the specific operation to generate a payload for. ' +
|
|
892
896
|
'For actions: { app: "app_tag", action: "action_tag" }. ' +
|
|
893
897
|
'For features: { feature: "feature_tag" }. ' +
|
|
894
|
-
'For databases: { database: "db_tag",
|
|
898
|
+
'For databases: { database: "db_tag", table: "table_or_collection_name" }. ' +
|
|
899
|
+
' Providing table is strongly recommended — the generator scans all actions configured for that table, ' +
|
|
900
|
+
' aggregates field definitions (name, type, required, sample value), and returns them in ' +
|
|
901
|
+
' meta.schema_context.database.fields. The where/data placeholders in the payload are also ' +
|
|
902
|
+
' pre-filled with the real field names. meta.schema_context.database.available_tables lists ' +
|
|
903
|
+
' every table the database has actions configured for, so you can discover table names first. ' +
|
|
904
|
+
'For graphs: { graph: "graph_tag", node_label?: "NodeLabel", edge_type?: "REL_TYPE" }. ' +
|
|
905
|
+
' node_label and edge_type pre-fill the Cypher template; omit to get generic placeholders. ' +
|
|
906
|
+
' meta.schema_context.graph.type tells you the engine (neo4j, neptune, etc.). ' +
|
|
907
|
+
'For vectors: { vector: "vector_tag", namespace?: "ns" }. ' +
|
|
908
|
+
' meta.schema_context.vector surfaces dimensions, metric, and index so you know what size ' +
|
|
909
|
+
' embedding to pass and which distance function is used. ' +
|
|
895
910
|
'For sessions: { session: "session_tag" }. ' +
|
|
896
911
|
'For notifications: { notification: "notif_tag" }. ' +
|
|
897
912
|
'For quotas/fallbacks: { tag: "resource_tag" }. ' +
|
|
898
913
|
'For storage: { storage: "storage_tag" }. ' +
|
|
899
914
|
'For messaging: { broker: "broker_tag", topic?: "topic_tag" }.'),
|
|
900
|
-
include_session: z.boolean().optional().default(true).describe('Include session
|
|
901
|
-
|
|
915
|
+
include_session: z.boolean().optional().default(true).describe('Include a session placeholder inside the generated input object. ' +
|
|
916
|
+
'The placeholder is named "<session_tag_token>" to indicate it expects the runtime JWT, not the tag name.'),
|
|
917
|
+
include_cache: z.boolean().optional().default(true).describe('Include the cache tag inside the generated input object so the caller knows which cache to reference for this query.'),
|
|
902
918
|
schema_mode: z.enum(['strict', 'best_effort']).optional().default('best_effort').describe('"strict" — fail if any required field cannot be resolved. ' +
|
|
903
919
|
'"best_effort" — fill what is known, leave unknowns as null/placeholder. Use best_effort when exploring.'),
|
|
904
920
|
input_hint: z.record(z.any()).optional().describe('Optional. Partial input values you already know. These are merged into the generated payload template ' +
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -533,11 +533,15 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
533
533
|
databases.connect [{ product, env, database }]
|
|
534
534
|
databases.testConnection [{ product, env, database }]
|
|
535
535
|
databases.disconnect []
|
|
536
|
-
databases.query [{ product, env, database,
|
|
537
|
-
databases.insert [{ product, env, database,
|
|
538
|
-
databases.update [{ product, env, database,
|
|
539
|
-
databases.delete [{ product, env, database,
|
|
540
|
-
databases.upsert [{ product, env, database,
|
|
536
|
+
databases.query [{ product, env, database, table, where?: {field: value}, select?: string[], orderBy?: [{field, order:"ASC"|"DESC"}], limit?, offset?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="query", targets={database, table})
|
|
537
|
+
databases.insert [{ product, env, database, table, data: {key: value}|{key:value}[], returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="insert", targets={database, table})
|
|
538
|
+
databases.update [{ product, env, database, table, data: {key:value}, where: {field: value}, returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="update", targets={database, table})
|
|
539
|
+
databases.delete [{ product, env, database, table, where: {field: value}, returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="delete", targets={database, table})
|
|
540
|
+
databases.upsert [{ product, env, database, table, data: {key:value}, conflictKeys: string[], returning?, session?, cache? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="upsert", targets={database, table})
|
|
541
|
+
NOTE: ductape_generate_payload for databases returns:
|
|
542
|
+
payload.input — ready-to-use input with real field names in where/data, plus session and cache inside input
|
|
543
|
+
meta.schema_context.database.fields — { fieldName: { type, required, description?, sample? } } for the table
|
|
544
|
+
meta.schema_context.database.available_tables — list of all tables that have configured actions
|
|
541
545
|
databases.count [{ product, env, database, entity, where? }]
|
|
542
546
|
databases.sum [{ product, env, database, entity, field, where? }]
|
|
543
547
|
databases.avg [{ product, env, database, entity, field, where? }]
|
|
@@ -569,8 +573,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
569
573
|
databases.action.fetch [action_tag]
|
|
570
574
|
databases.action.list [database_tag]
|
|
571
575
|
databases.action.delete [action_tag]
|
|
572
|
-
databases.action.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database,
|
|
573
|
-
databases.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch")
|
|
576
|
+
databases.action.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"})
|
|
577
|
+
databases.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"})
|
|
574
578
|
databases.beginTransaction [{ product, env, database, isolationLevel?: "READ_COMMITTED"|"REPEATABLE_READ"|"SERIALIZABLE" }]
|
|
575
579
|
→ returns a transaction object; pass it to insert/update/delete/upsert/query calls as the last argument.
|
|
576
580
|
Commit with: transaction.commit() Rollback with: transaction.rollback()
|
|
@@ -913,15 +917,31 @@ const payloadGenerateInputSchema = z.object({
|
|
|
913
917
|
'Identifies the specific operation to generate a payload for. ' +
|
|
914
918
|
'For actions: { app: "app_tag", action: "action_tag" }. ' +
|
|
915
919
|
'For features: { feature: "feature_tag" }. ' +
|
|
916
|
-
'For databases: { database: "db_tag",
|
|
920
|
+
'For databases: { database: "db_tag", table: "table_or_collection_name" }. ' +
|
|
921
|
+
' Providing table is strongly recommended — the generator scans all actions configured for that table, ' +
|
|
922
|
+
' aggregates field definitions (name, type, required, sample value), and returns them in ' +
|
|
923
|
+
' meta.schema_context.database.fields. The where/data placeholders in the payload are also ' +
|
|
924
|
+
' pre-filled with the real field names. meta.schema_context.database.available_tables lists ' +
|
|
925
|
+
' every table the database has actions configured for, so you can discover table names first. ' +
|
|
926
|
+
'For graphs: { graph: "graph_tag", node_label?: "NodeLabel", edge_type?: "REL_TYPE" }. ' +
|
|
927
|
+
' node_label and edge_type pre-fill the Cypher template; omit to get generic placeholders. ' +
|
|
928
|
+
' meta.schema_context.graph.type tells you the engine (neo4j, neptune, etc.). ' +
|
|
929
|
+
'For vectors: { vector: "vector_tag", namespace?: "ns" }. ' +
|
|
930
|
+
' meta.schema_context.vector surfaces dimensions, metric, and index so you know what size ' +
|
|
931
|
+
' embedding to pass and which distance function is used. ' +
|
|
917
932
|
'For sessions: { session: "session_tag" }. ' +
|
|
918
933
|
'For notifications: { notification: "notif_tag" }. ' +
|
|
919
934
|
'For quotas/fallbacks: { tag: "resource_tag" }. ' +
|
|
920
935
|
'For storage: { storage: "storage_tag" }. ' +
|
|
921
936
|
'For messaging: { broker: "broker_tag", topic?: "topic_tag" }.'
|
|
922
937
|
),
|
|
923
|
-
include_session: z.boolean().optional().default(true).describe(
|
|
924
|
-
|
|
938
|
+
include_session: z.boolean().optional().default(true).describe(
|
|
939
|
+
'Include a session placeholder inside the generated input object. ' +
|
|
940
|
+
'The placeholder is named "<session_tag_token>" to indicate it expects the runtime JWT, not the tag name.'
|
|
941
|
+
),
|
|
942
|
+
include_cache: z.boolean().optional().default(true).describe(
|
|
943
|
+
'Include the cache tag inside the generated input object so the caller knows which cache to reference for this query.'
|
|
944
|
+
),
|
|
925
945
|
schema_mode: z.enum(['strict', 'best_effort']).optional().default('best_effort').describe(
|
|
926
946
|
'"strict" — fail if any required field cannot be resolved. ' +
|
|
927
947
|
'"best_effort" — fill what is known, leave unknowns as null/placeholder. Use best_effort when exploring.'
|