mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-04-06 01:23:08 +00:00
fix: trim patterns response tokens and add missing documentation (#683)
- Trim task-specific patterns ~64%: drop displayName, shorten field names (frequency→freq), cap chains at 5, use short node type names in chains - Add patterns mode to tools_documentation essentials, full docs, and tools-documentation.ts overview (was completely missing) - Document includeOperations omission behavior for trigger/freeform nodes - Add patterns return shape to search_templates returns documentation - Trim search_nodes examples from 11 to 6 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:
@@ -3909,17 +3909,23 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
||||
const patterns = this.workflowPatternsCache!;
|
||||
|
||||
if (category) {
|
||||
// Return specific category pattern data
|
||||
// Return specific category pattern data (trimmed for token efficiency)
|
||||
const categoryData = patterns.categories[category];
|
||||
if (!categoryData) {
|
||||
const available = Object.keys(patterns.categories);
|
||||
return { error: `Unknown category "${category}". Available: ${available.join(', ')}` };
|
||||
}
|
||||
const MAX_CHAINS = 5;
|
||||
return {
|
||||
category,
|
||||
...categoryData,
|
||||
nodes: categoryData.nodes?.slice(0, limit),
|
||||
commonChains: categoryData.commonChains?.slice(0, limit),
|
||||
templateCount: categoryData.templateCount,
|
||||
pattern: categoryData.pattern,
|
||||
nodes: categoryData.nodes?.slice(0, limit).map(n => ({
|
||||
type: n.type, freq: n.frequency, role: n.role
|
||||
})),
|
||||
chains: categoryData.commonChains?.slice(0, MAX_CHAINS).map(c => ({
|
||||
path: c.chain.map(t => t.split('.').pop() ?? t), count: c.count, freq: c.frequency
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user