@ema.co/mcp-toolkit 2026.2.27 → 2026.2.28
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.
Potentially problematic release.
This version of @ema.co/mcp-toolkit might be problematic. Click here for more details.
- package/.context/public/guides/ema-user-guide.md +7 -6
- package/.context/public/guides/mcp-tools-guide.md +46 -23
- package/dist/config/index.js +11 -0
- package/dist/config/workflow-patterns.js +361 -0
- package/dist/mcp/autobuilder.js +2 -2
- package/dist/mcp/domain/generation-schema.js +15 -9
- package/dist/mcp/domain/structural-rules.js +3 -3
- package/dist/mcp/domain/validation-rules.js +20 -27
- package/dist/mcp/domain/workflow-generator.js +3 -3
- package/dist/mcp/domain/workflow-graph.js +1 -1
- package/dist/mcp/guidance.js +60 -1
- package/dist/mcp/handlers/conversation/adapter.js +13 -0
- package/dist/mcp/handlers/conversation/create.js +19 -0
- package/dist/mcp/handlers/conversation/delete.js +18 -0
- package/dist/mcp/handlers/conversation/formatters.js +62 -0
- package/dist/mcp/handlers/conversation/history.js +15 -0
- package/dist/mcp/handlers/conversation/index.js +43 -0
- package/dist/mcp/handlers/conversation/list.js +40 -0
- package/dist/mcp/handlers/conversation/messages.js +13 -0
- package/dist/mcp/handlers/conversation/rename.js +16 -0
- package/dist/mcp/handlers/conversation/send.js +90 -0
- package/dist/mcp/handlers/data/index.js +169 -3
- package/dist/mcp/handlers/feedback/client-id.js +49 -0
- package/dist/mcp/handlers/feedback/coalesce.js +167 -0
- package/dist/mcp/handlers/feedback/index.js +42 -1
- package/dist/mcp/handlers/feedback/outbox.js +301 -0
- package/dist/mcp/handlers/feedback/probes.js +127 -0
- package/dist/mcp/handlers/feedback/remote-store.js +59 -0
- package/dist/mcp/handlers/feedback/store.js +13 -1
- package/dist/mcp/handlers/persona/delete.js +7 -28
- package/dist/mcp/handlers/persona/update.js +7 -26
- package/dist/mcp/handlers/persona/version.js +30 -15
- package/dist/mcp/handlers/template/adapter.js +23 -0
- package/dist/mcp/handlers/template/crud.js +174 -0
- package/dist/mcp/handlers/template/index.js +6 -7
- package/dist/mcp/handlers/workflow/adapter.js +30 -46
- package/dist/mcp/handlers/workflow/index.js +2 -2
- package/dist/mcp/handlers/workflow/validation.js +2 -2
- package/dist/mcp/knowledge-guidance-topics.js +90 -53
- package/dist/mcp/knowledge.js +7 -357
- package/dist/mcp/prompts.js +5 -5
- package/dist/mcp/resources-dynamic.js +46 -38
- package/dist/mcp/resources-validation.js +5 -5
- package/dist/mcp/server.js +38 -5
- package/dist/mcp/tools.js +340 -8
- package/dist/sdk/client-adapter.js +90 -2
- package/dist/sdk/client.js +7 -0
- package/dist/sdk/ema-client.js +242 -27
- package/dist/sdk/generated/agent-catalog.js +96 -39
- package/dist/sdk/generated/deprecated-actions.js +1 -1
- package/dist/sdk/grpc-client.js +67 -5
- package/dist/sync/central-factory.js +86 -0
- package/dist/sync/central-version-storage.js +387 -0
- package/dist/sync/dis-port.js +75 -0
- package/dist/sync/version-policy.js +29 -31
- package/dist/sync/version-storage-interface.js +11 -0
- package/dist/sync/version-storage.js +22 -22
- package/package.json +2 -1
|
@@ -36,13 +36,13 @@ export const GUIDANCE_TOPICS = {
|
|
|
36
36
|
examples: [
|
|
37
37
|
"✅ trigger.user_query → search.query (TEXT_WITH_SOURCES → TEXT_WITH_SOURCES)",
|
|
38
38
|
"❌ trigger.chat_conversation → search.query (CHAT_CONVERSATION ≠ TEXT_WITH_SOURCES)",
|
|
39
|
-
"✅ search.search_results →
|
|
39
|
+
"✅ search.search_results → call_llm.named_inputs_Search_Results (SEARCH_RESULT → ANY via named_inputs)",
|
|
40
40
|
"❌ search.search_results → call_llm.query (SEARCH_RESULT ≠ TEXT_WITH_SOURCES)",
|
|
41
41
|
"✅ search.search_results → call_llm.named_inputs_* (SEARCH_RESULT → ANY)",
|
|
42
42
|
],
|
|
43
43
|
criticalRules: [
|
|
44
44
|
"CHAT_CONVERSATION only compatible with chat_categorizer.conversation",
|
|
45
|
-
"SEARCH_RESULT
|
|
45
|
+
"SEARCH_RESULT → call_llm.named_inputs (most common), respond_with_sources.search_results, or any node accepting ANY",
|
|
46
46
|
"call_llm.named_inputs accepts ANY type",
|
|
47
47
|
"Use conversation_to_search_query to convert CHAT_CONVERSATION → TEXT_WITH_SOURCES",
|
|
48
48
|
],
|
|
@@ -61,26 +61,32 @@ export const GUIDANCE_TOPICS = {
|
|
|
61
61
|
},
|
|
62
62
|
"hitl-patterns": {
|
|
63
63
|
title: "Human-in-the-Loop Patterns",
|
|
64
|
-
content: "HITL
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
64
|
+
content: "Two HITL mechanisms:\n\n" +
|
|
65
|
+
"1. **general_hitl (Human Collaboration Agent)**: Standalone node with three modes — " +
|
|
66
|
+
"Conversational (back-and-forth dialogue with success/failure criteria), " +
|
|
67
|
+
"Standard Form (structured fields: string, number, boolean, multi-select), " +
|
|
68
|
+
"Custom Form (external hosted form URL). Outputs: human_collaboration_status (HITL Success/Failure enum) " +
|
|
69
|
+
"and summarized_conversation. Branch downstream with runIf.\n\n" +
|
|
70
|
+
"2. **Agent-level HITL flags**: entity_extraction_with_documents and send_email_agent support " +
|
|
71
|
+
"`disable_human_interaction: false` for simple yes/no approval on their own action. " +
|
|
72
|
+
"The platform handles the approval UI automatically.\n\n" +
|
|
73
|
+
"JSON format: Set `disable_human_interaction: false` on the action node " +
|
|
74
|
+
"in workflow_def.actions[]. Note: false = HITL ON, true = HITL OFF.",
|
|
71
75
|
status: "verified",
|
|
72
76
|
examples: [
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
+
"Complex approval dialogue → general_hitl (Conversational mode, define success/failure criteria)",
|
|
78
|
+
"Collect structured data from user → general_hitl (Standard Form mode)",
|
|
79
|
+
"Simple email send approval → send_email_agent with disable_human_interaction: false",
|
|
80
|
+
"Review extraction before acting → entity_extraction_with_documents with disable_human_interaction: false",
|
|
81
|
+
"JSON: { name: 'review', action: { name: 'general_hitl' }, ... } → standalone HITL node",
|
|
77
82
|
],
|
|
78
83
|
criticalRules: [
|
|
79
|
-
"general_hitl
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
+
"general_hitl IS deployable — it's a full Human Collaboration Agent with 3 modes",
|
|
85
|
+
"For rich dialogue/forms: use general_hitl (Conversational, Standard Form, Custom Form)",
|
|
86
|
+
"For simple approval: use HITL flag on send_email_agent or entity_extraction_with_documents",
|
|
87
|
+
"external_action_caller does NOT support HITL",
|
|
88
|
+
"JSON field: `disable_human_interaction` (boolean) on agent-level HITL — false=HITL on, true=HITL off",
|
|
89
|
+
"general_hitl max_exchanges prevents infinite loops (default 5). Exceeding max = HITL Failure.",
|
|
84
90
|
],
|
|
85
91
|
},
|
|
86
92
|
"hitl-policy": {
|
|
@@ -103,16 +109,16 @@ export const GUIDANCE_TOPICS = {
|
|
|
103
109
|
},
|
|
104
110
|
"multi-source-search": {
|
|
105
111
|
title: "Multi-Source Search Architecture",
|
|
106
|
-
content: "For comprehensive answers, combine local search with web search. Use
|
|
112
|
+
content: "For comprehensive answers, combine local search with web search. Use combine_and_rerank_search_results to merge and rerank by relevance. Alternatively, use call_llm with multiple named_inputs to combine results with prompt-based ranking.",
|
|
107
113
|
status: "verified",
|
|
108
114
|
examples: [
|
|
109
|
-
"search (local) + live_web_search →
|
|
110
|
-
"
|
|
115
|
+
"search (local) + live_web_search → combine_and_rerank_search_results → call_llm",
|
|
116
|
+
"search (local) + live_web_search → call_llm.named_inputs_KB_Results + call_llm.named_inputs_Web_Results",
|
|
111
117
|
],
|
|
112
118
|
criticalRules: [
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
119
|
+
"combine_and_rerank_search_results reranks by relevance — use when you need weighted/prioritized results",
|
|
120
|
+
"call_llm with named_inputs gives prompt-level control over how results are synthesized",
|
|
121
|
+
"Single search node can handle multiple datastores via datastore_configs",
|
|
116
122
|
],
|
|
117
123
|
},
|
|
118
124
|
"voice-tool-calling": {
|
|
@@ -404,7 +410,9 @@ export const GUIDANCE_TOPICS = {
|
|
|
404
410
|
- NO → Use transform node (json_mapper, fixed_response)
|
|
405
411
|
|
|
406
412
|
### Q3: What KIND of generation?
|
|
407
|
-
-
|
|
413
|
+
- KB Q&A → call_llm with search results via named_inputs (most common, 89% of production)
|
|
414
|
+
- KB Q&A with automatic citations → respond_with_sources
|
|
415
|
+
- Explain external tool results → respond_for_external_actions
|
|
408
416
|
- Custom generation → call_llm
|
|
409
417
|
- Complex multi-step reasoning → custom_agent
|
|
410
418
|
- Search + synthesize in one → document_synthesis
|
|
@@ -420,26 +428,29 @@ export const GUIDANCE_TOPICS = {
|
|
|
420
428
|
| fixed_response | 0 | <50ms | Static content, config, templates |
|
|
421
429
|
| json_mapper | 0 | <100ms | Transform JSON without reasoning |
|
|
422
430
|
| entity_extraction | 1 | 1-2s | Extract structured data |
|
|
423
|
-
|
|
|
424
|
-
|
|
|
431
|
+
| call_llm | 1 | 2-4s | Custom generation, KB Q&A with named_inputs |
|
|
432
|
+
| respond_with_sources | 1 | 2-4s | Citation-grounded search response |
|
|
433
|
+
| respond_for_external_actions | 1 | 2-4s | Explain external tool results ONLY |
|
|
425
434
|
| custom_agent | 1-3 | 3-8s | Complex reasoning |
|
|
426
435
|
| document_synthesis | 2-5 | 5-15s | Multi-search + synthesis |`,
|
|
427
436
|
examples: [
|
|
428
437
|
"✅ Static template → fixed_response (0 LLM calls)",
|
|
429
438
|
"✅ Extract client_name, email → entity_extraction (1 LLM call, typed output)",
|
|
430
|
-
"✅
|
|
439
|
+
"✅ KB Q&A → search → call_llm.named_inputs_Search_Results (most common)",
|
|
431
440
|
"✅ Custom email generation → call_llm with search results in named_inputs",
|
|
441
|
+
"✅ Explain Salesforce API result → respond_for_external_actions",
|
|
432
442
|
"❌ Using call_llm to extract JSON → Use entity_extraction instead",
|
|
433
|
-
"❌ Using document_synthesis for simple Q&A → Use
|
|
443
|
+
"❌ Using document_synthesis for simple Q&A → Use call_llm with named_inputs",
|
|
444
|
+
"❌ Using respond_for_external_actions for KB Q&A → It's for tool results only",
|
|
434
445
|
"❌ Using custom_agent for static response → Use fixed_response",
|
|
435
446
|
],
|
|
436
447
|
criticalRules: [
|
|
437
448
|
"NEVER use LLM for transforms that json_mapper can do",
|
|
438
449
|
"NEVER use call_llm for structured extraction - use entity_extraction",
|
|
439
|
-
"NEVER use
|
|
450
|
+
"NEVER use respond_for_external_actions for KB Q&A — it's ONLY for external_action_caller results",
|
|
440
451
|
"ALWAYS use fixed_response for static content (templates, config, help text)",
|
|
441
|
-
"Use
|
|
442
|
-
"Use
|
|
452
|
+
"Use call_llm with named_inputs for most post-search generation (89% of production)",
|
|
453
|
+
"Use respond_with_sources for citation-grounded responses",
|
|
443
454
|
"Use custom_agent when task requires role context + multi-step reasoning",
|
|
444
455
|
"Use document_synthesis only when you need search-plan-search-synthesize pattern",
|
|
445
456
|
],
|
|
@@ -447,23 +458,28 @@ export const GUIDANCE_TOPICS = {
|
|
|
447
458
|
"llm-node-selection": {
|
|
448
459
|
title: "LLM Node Selection: Which One to Use",
|
|
449
460
|
status: "verified",
|
|
450
|
-
content: `Different
|
|
461
|
+
content: `Different generation nodes serve different purposes. Choose based on your needs:
|
|
451
462
|
|
|
452
|
-
##
|
|
453
|
-
- **Best for**:
|
|
454
|
-
- **Input**:
|
|
455
|
-
- **Output**: Response with source citations
|
|
456
|
-
- **When**: User asks question, you search KB, return answer
|
|
457
|
-
- **NOT for**: Custom generation, complex reasoning
|
|
458
|
-
|
|
459
|
-
## call_llm
|
|
460
|
-
- **Best for**: Custom text generation with instructions
|
|
461
|
-
- **Input**: Query + optional search/context via named_inputs
|
|
463
|
+
## call_llm (Respond) — Default choice for most generation
|
|
464
|
+
- **Best for**: KB Q&A, custom text generation, content synthesis
|
|
465
|
+
- **Input**: Query + optional search/context/anything via named_inputs
|
|
462
466
|
- **Output**: Generated text
|
|
463
|
-
- **When**:
|
|
464
|
-
- **
|
|
467
|
+
- **When**: Most common post-search node (89% of production). Use for KB Q&A, email drafting, document content.
|
|
468
|
+
- **Key feature**: named_inputs accepts ANY type — wire search results, tool outputs, etc.
|
|
469
|
+
|
|
470
|
+
## respond_with_sources — Citation-grounded search responses
|
|
471
|
+
- **Best for**: Responses that need automatic source citations
|
|
472
|
+
- **Input**: Query + search_results (requires SEARCH_RESULT type)
|
|
473
|
+
- **Output**: Response with citations
|
|
474
|
+
- **When**: You specifically need citation-based filtering and source attribution
|
|
475
|
+
|
|
476
|
+
## respond_for_external_actions — Explain external tool results ONLY
|
|
477
|
+
- **Best for**: Explaining results from external_action_caller (Salesforce, ServiceNow, etc.)
|
|
478
|
+
- **Input**: Query + external_action_result from external_action_caller
|
|
479
|
+
- **Output**: Human-friendly explanation of tool results
|
|
480
|
+
- **ONLY use after**: external_action_caller. NOT for KB Q&A, NOT for search results.
|
|
465
481
|
|
|
466
|
-
## custom_agent
|
|
482
|
+
## custom_agent — Complex multi-step reasoning
|
|
467
483
|
- **Best for**: Complex tasks requiring role + instructions
|
|
468
484
|
- **Input**: Role instructions + task instructions + named_inputs
|
|
469
485
|
- **Output**: Structured or free-form response (use output_fields for structured)
|
|
@@ -471,25 +487,26 @@ export const GUIDANCE_TOPICS = {
|
|
|
471
487
|
- **NOT for**: Simple generation (overkill)
|
|
472
488
|
- **CRITICAL**: When outputting JSON for json_mapper, use output_fields to define keys
|
|
473
489
|
|
|
474
|
-
## document_synthesis
|
|
490
|
+
## document_synthesis — Multi-source research
|
|
475
491
|
- **Best for**: Multi-source research with planning
|
|
476
492
|
- **Input**: User request + search results
|
|
477
493
|
- **Output**: Synthesized document
|
|
478
494
|
- **When**: Need to search → plan → search again → synthesize
|
|
479
495
|
- **NOT for**: Simple KB lookup (too heavy)`,
|
|
480
496
|
examples: [
|
|
481
|
-
"User asks 'What is our refund policy?' →
|
|
482
|
-
"Need to generate email with specific template → call_llm",
|
|
497
|
+
"User asks 'What is our refund policy?' → search → call_llm.named_inputs_Search_Results",
|
|
498
|
+
"Need to generate email with specific template → call_llm with structured prompt",
|
|
499
|
+
"Salesforce lookup result → respond_for_external_actions to explain to user",
|
|
483
500
|
"Need to analyze portfolio and recommend actions → custom_agent",
|
|
484
501
|
"Need to research topic across multiple sources → document_synthesis",
|
|
485
502
|
],
|
|
486
503
|
criticalRules: [
|
|
487
|
-
"
|
|
488
|
-
"
|
|
504
|
+
"call_llm: Default for KB Q&A and most generation. 1 LLM call, accepts named_inputs of ANY type",
|
|
505
|
+
"respond_with_sources: For citation-grounded responses from search results",
|
|
506
|
+
"respond_for_external_actions: ONLY after external_action_caller — NOT for KB Q&A",
|
|
489
507
|
"custom_agent: 1-3 LLM calls, complex reasoning, has role context",
|
|
490
508
|
"document_synthesis: 2-5 LLM calls, heavy, only for research tasks",
|
|
491
|
-
"Default to
|
|
492
|
-
"Upgrade to call_llm when you need custom instructions",
|
|
509
|
+
"Default to call_llm for most post-search generation",
|
|
493
510
|
"Upgrade to custom_agent for complex reasoning",
|
|
494
511
|
"Use document_synthesis sparingly (latency expensive)",
|
|
495
512
|
],
|
|
@@ -612,4 +629,24 @@ json_mapper outputs go to output_json. Use fixed_response template variables:
|
|
|
612
629
|
"Default values in json_mapper rules prevent null errors",
|
|
613
630
|
],
|
|
614
631
|
},
|
|
632
|
+
"feedback-probes": {
|
|
633
|
+
title: "Feedback Probes and Telemetry Collection",
|
|
634
|
+
content: `Tool responses may include a _probe field with a targeted question about your experience. Responding to probes helps improve specific areas of the toolkit.
|
|
635
|
+
|
|
636
|
+
To respond to a probe, use:
|
|
637
|
+
toolkit_feedback(method="submit", category="probe_response", message="<your answer>", context="<probe.id>")
|
|
638
|
+
|
|
639
|
+
The toolkit also collects anonymous telemetry (tool usage, error rates, latency) to identify patterns. This data is coalesced locally and periodically uploaded as a digest. Set EMA_FEEDBACK_DISABLED=1 to opt out of all remote collection.`,
|
|
640
|
+
status: "verified",
|
|
641
|
+
examples: [
|
|
642
|
+
'toolkit_feedback(method="submit", category="probe_response", message="Workflow deploy was confusing because...", context="workflow-deploy-confidence-2026q1")',
|
|
643
|
+
'toolkit_feedback(method="submit", category="gap", message="No docs on how to wire email inputs")',
|
|
644
|
+
],
|
|
645
|
+
criticalRules: [
|
|
646
|
+
"When a _probe appears in a tool response, respond via toolkit_feedback with category='probe_response'",
|
|
647
|
+
"Include the id from the _probe field as the context parameter",
|
|
648
|
+
"Probes are optional — skip if not relevant to your current task",
|
|
649
|
+
"Regular feedback (gap, confusion, success, error_unclear, suggestion) can be submitted anytime",
|
|
650
|
+
],
|
|
651
|
+
},
|
|
615
652
|
};
|