feat: add intelligent execution data filtering to n8n_get_execution tool

Implements comprehensive execution data filtering system to enable AI agents
to inspect large workflow executions without exceeding token limits.

Features:
- Preview mode: Shows structure, counts, and size estimates (~500 tokens)
- Summary mode: Returns 2 sample items per node (~2-5K tokens)
- Filtered mode: Granular control with itemsLimit and nodeNames
- Full mode: Complete data retrieval (explicit opt-in)
- Smart recommendations based on data size analysis
- Structure-only mode (itemsLimit: 0) for schema inspection
- 100% backward compatibility with legacy includeData parameter

Technical improvements:
- New ExecutionProcessor service with intelligent filtering logic
- Type-safe implementation with Record<string, unknown> over any
- Comprehensive validation and error handling
- 33 unit tests with 78% coverage
- Constants-based thresholds for easy tuning

Bug fixes:
- Fixed preview mode API data fetching to enable structure analysis
- Validates and caps itemsLimit to prevent abuse

Impact:
- Reduces token usage by 80-95% for large datasets (50+ items)
- Prevents token overflow when inspecting workflow executions
- Enables recommended workflow: preview → recommendation → targeted fetch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-09-30 23:44:19 +02:00
parent a1db133a50
commit ec0d2e8a6e
10 changed files with 1991 additions and 60 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "n8n-mcp",
"version": "2.14.4",
"version": "2.14.5",
"description": "Integration between n8n workflow automation and Model Context Protocol (MCP)",
"main": "dist/index.js",
"bin": {