feat: add includeOperations to search_nodes and patterns mode to search_templates

- Add `includeOperations` flag to search_nodes that returns resource/operation
  trees per result (e.g., Slack: 7 resources, 44 operations). Saves a get_node
  round-trip when building workflows.
- Add `searchMode: "patterns"` to search_templates — lightweight workflow pattern
  summaries mined from 2,700+ templates (node frequency, co-occurrence, connection
  chains across 10 task categories).
- Fix operations extraction: use filter() instead of find() to capture ALL
  operation properties, each mapped to its resource via displayOptions.
- Fix FTS-to-LIKE fallback silently dropping search options.
- Add mine-workflow-patterns.ts script (npm run mine:patterns).
- Restore 584 community nodes in database after rebuild.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2026-03-30 15:45:03 +02:00
parent 20ebfbb0fc
commit bda2009b77
10 changed files with 3414 additions and 28 deletions

View File

@@ -57,6 +57,11 @@ export const n8nDocumentationToolsFinal: ToolDefinition[] = [
description: 'Include top 2 real-world configuration examples from popular templates (default: false)',
default: false,
},
includeOperations: {
type: 'boolean',
default: false,
description: 'Include resource/operation tree per node. Adds ~100-300 tokens per result but saves a get_node round-trip.',
},
source: {
type: 'string',
enum: ['all', 'core', 'community', 'verified'],
@@ -242,14 +247,14 @@ export const n8nDocumentationToolsFinal: ToolDefinition[] = [
},
{
name: 'search_templates',
description: `Search templates with multiple modes. Use searchMode='keyword' for text search, 'by_nodes' to find templates using specific nodes, 'by_task' for curated task-based templates, 'by_metadata' for filtering by complexity/setup time/services.`,
description: `Search templates with multiple modes. Use searchMode='keyword' for text search, 'by_nodes' to find templates using specific nodes, 'by_task' for curated task-based templates, 'by_metadata' for filtering by complexity/setup time/services, 'patterns' for lightweight workflow pattern summaries mined from 2700+ templates.`,
inputSchema: {
type: 'object',
properties: {
searchMode: {
type: 'string',
enum: ['keyword', 'by_nodes', 'by_task', 'by_metadata'],
description: 'Search mode. keyword=text search (default), by_nodes=find by node types, by_task=curated task templates, by_metadata=filter by complexity/services',
enum: ['keyword', 'by_nodes', 'by_task', 'by_metadata', 'patterns'],
description: 'Search mode. keyword=text search (default), by_nodes=find by node types, by_task=curated task templates, by_metadata=filter by complexity/services, patterns=lightweight workflow pattern summaries',
default: 'keyword',
},
// For searchMode='keyword'
@@ -271,7 +276,7 @@ export const n8nDocumentationToolsFinal: ToolDefinition[] = [
items: { type: 'string' },
description: 'For searchMode=by_nodes: array of node types (e.g., ["n8n-nodes-base.httpRequest", "n8n-nodes-base.slack"])',
},
// For searchMode='by_task'
// For searchMode='by_task' or 'patterns'
task: {
type: 'string',
enum: [
@@ -286,7 +291,7 @@ export const n8nDocumentationToolsFinal: ToolDefinition[] = [
'api_integration',
'database_operations'
],
description: 'For searchMode=by_task: the type of task',
description: 'For searchMode=by_task: the type of task. For searchMode=patterns: optional category filter (omit for overview of all categories).',
},
// For searchMode='by_metadata'
category: {