mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
fix: get_node_essentials examples now use consistent workflowNodeType (MEDIUM-02)
ISSUE: get_node_essentials with includeExamples=true returned empty examples array even though examples existed in database. ROOT CAUSE: Inconsistent node type construction between result object and examples query. - Line 1888: result.workflowNodeType computed correctly - Line 1917: fullNodeType recomputed with potential different defaults - If node.package was null/missing, defaulted to 'n8n-nodes-base' - This caused langchain nodes to query with wrong prefix DETAILS: search_nodes uses nodeResult.workflowNodeType (line 1203) ✅ get_node_essentials used getWorkflowNodeType() again (line 1917) ❌ Example failure: - Node package: '@n8n/n8n-nodes-langchain' - Node type: 'nodes-langchain.agent' - Line 1888: workflowNodeType = '@n8n/n8n-nodes-langchain.agent' ✅ - Line 1917: fullNodeType = 'n8n-nodes-base.agent' ❌ (defaulted) - Query fails: template_node_configs has '@n8n/n8n-nodes-langchain.agent' FIX: Use result.workflowNodeType instead of reconstructing it. This matches search_nodes behavior and ensures consistency. VERIFICATION: Now both tools query with same node type format: - search_nodes: queries with workflowNodeType - get_node_essentials: queries with workflowNodeType - Both match template_node_configs FULL form Resolves: MEDIUM-02 (get_node_essentials examples retrieval) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1914,7 +1914,8 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
||||
// Add examples from templates if requested
|
||||
if (includeExamples) {
|
||||
try {
|
||||
const fullNodeType = getWorkflowNodeType(node.package ?? 'n8n-nodes-base', node.nodeType);
|
||||
// Use the already-computed workflowNodeType from result (line 1888)
|
||||
// This ensures consistency with search_nodes behavior (line 1203)
|
||||
const examples = this.db!.prepare(`
|
||||
SELECT
|
||||
parameters_json,
|
||||
@@ -1928,7 +1929,7 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
||||
WHERE node_type = ?
|
||||
ORDER BY rank
|
||||
LIMIT 3
|
||||
`).all(fullNodeType) as any[];
|
||||
`).all(result.workflowNodeType) as any[];
|
||||
|
||||
if (examples.length > 0) {
|
||||
(result as any).examples = examples.map((ex: any) => ({
|
||||
|
||||
Reference in New Issue
Block a user