feat: implement AI-optimized MCP tools with 95% size reduction
- Add get_node_essentials tool for 10-20 essential properties only - Add search_node_properties for targeted property search - Add get_node_for_task with 14 pre-configured templates - Add validate_node_config for comprehensive validation - Add get_property_dependencies for visibility analysis - Implement PropertyFilter service with curated essentials - Implement ExampleGenerator with working examples - Implement TaskTemplates for common workflows - Implement ConfigValidator with security checks - Implement PropertyDependencies for dependency analysis - Enhance property descriptions to 100% coverage - Add version information to essentials response - Update documentation with new tools Response sizes reduced from 100KB+ to <5KB for better AI agent usability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
59
scripts/test-node-info.js
Normal file
59
scripts/test-node-info.js
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Test get_node_info to diagnose timeout issues
|
||||
*/
|
||||
|
||||
const { N8NDocumentationMCPServer } = require('../dist/mcp/server-update');
|
||||
|
||||
async function testNodeInfo() {
|
||||
console.log('🔍 Testing get_node_info...\n');
|
||||
|
||||
try {
|
||||
const server = new N8NDocumentationMCPServer();
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
|
||||
const nodes = [
|
||||
'nodes-base.httpRequest',
|
||||
'nodes-base.webhook',
|
||||
'nodes-langchain.agent'
|
||||
];
|
||||
|
||||
for (const nodeType of nodes) {
|
||||
console.log(`Testing ${nodeType}...`);
|
||||
const start = Date.now();
|
||||
|
||||
try {
|
||||
const result = await server.executeTool('get_node_info', { nodeType });
|
||||
const elapsed = Date.now() - start;
|
||||
const size = JSON.stringify(result).length;
|
||||
|
||||
console.log(`✅ Success in ${elapsed}ms`);
|
||||
console.log(` Size: ${(size / 1024).toFixed(1)}KB`);
|
||||
console.log(` Properties: ${result.properties?.length || 0}`);
|
||||
console.log(` Operations: ${result.operations?.length || 0}`);
|
||||
|
||||
// Check for issues
|
||||
if (size > 50000) {
|
||||
console.log(` ⚠️ WARNING: Response over 50KB!`);
|
||||
}
|
||||
|
||||
// Check property quality
|
||||
const propsWithoutDesc = result.properties?.filter(p => !p.description && !p.displayName).length || 0;
|
||||
if (propsWithoutDesc > 0) {
|
||||
console.log(` ⚠️ ${propsWithoutDesc} properties without descriptions`);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
const elapsed = Date.now() - start;
|
||||
console.log(`❌ Failed after ${elapsed}ms: ${error.message}`);
|
||||
}
|
||||
|
||||
console.log('');
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Fatal error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
testNodeInfo().catch(console.error);
|
||||
Reference in New Issue
Block a user