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:
czlonkowski
2025-06-16 12:37:45 +02:00
parent 4cfc3cc5c8
commit 1884d5babf
28 changed files with 8122 additions and 4 deletions

View File

@@ -101,6 +101,106 @@ export const n8nDocumentationToolsFinal: ToolDefinition[] = [
properties: {},
},
},
{
name: 'get_node_essentials',
description: `Get only the 10-20 most important properties for a node (95% size reduction). USE THIS INSTEAD OF get_node_info for basic configuration! Returns: required properties, common properties, working examples. Perfect for quick workflow building. Same nodeType format as get_node_info (e.g., "nodes-base.httpRequest"). Reduces 100KB+ responses to <5KB focused data.`,
inputSchema: {
type: 'object',
properties: {
nodeType: {
type: 'string',
description: 'Full node type WITH prefix: "nodes-base.httpRequest", "nodes-base.webhook", etc. Same format as get_node_info.',
},
},
required: ['nodeType'],
},
},
{
name: 'search_node_properties',
description: `Search for specific properties within a node. Find authentication options, body parameters, headers, etc. without parsing the entire schema. Returns matching properties with their paths and descriptions. Use this when you need to find specific configuration options like "auth", "header", "body", etc.`,
inputSchema: {
type: 'object',
properties: {
nodeType: {
type: 'string',
description: 'Full node type WITH prefix (same as get_node_info).',
},
query: {
type: 'string',
description: 'Property name or keyword to search for. Examples: "auth", "header", "body", "json", "timeout".',
},
maxResults: {
type: 'number',
description: 'Maximum number of results to return. Default 20.',
default: 20,
},
},
required: ['nodeType', 'query'],
},
},
{
name: 'get_node_for_task',
description: `Get pre-configured node settings for common tasks. USE THIS to quickly configure nodes for specific use cases like "post_json_request", "receive_webhook", "query_database", etc. Returns ready-to-use configuration with clear indication of what user must provide. Much faster than figuring out configuration from scratch.`,
inputSchema: {
type: 'object',
properties: {
task: {
type: 'string',
description: 'The task to accomplish. Available tasks: get_api_data, post_json_request, call_api_with_auth, receive_webhook, webhook_with_response, query_postgres, insert_postgres_data, chat_with_ai, ai_agent_workflow, transform_data, filter_data, send_slack_message, send_email. Use list_tasks to see all available tasks.',
},
},
required: ['task'],
},
},
{
name: 'list_tasks',
description: `List all available task templates. Use this to discover what pre-configured tasks are available before using get_node_for_task. Tasks are organized by category (HTTP/API, Webhooks, Database, AI, Data Processing, Communication).`,
inputSchema: {
type: 'object',
properties: {
category: {
type: 'string',
description: 'Optional category filter: HTTP/API, Webhooks, Database, AI/LangChain, Data Processing, Communication',
},
},
},
},
{
name: 'validate_node_config',
description: `Validate a node configuration before use. Checks for missing required properties, type errors, security issues, and common mistakes. Returns specific errors, warnings, and suggestions to fix issues. USE THIS before executing workflows to catch errors early.`,
inputSchema: {
type: 'object',
properties: {
nodeType: {
type: 'string',
description: 'The node type to validate (e.g., "nodes-base.httpRequest")',
},
config: {
type: 'object',
description: 'The node configuration to validate',
},
},
required: ['nodeType', 'config'],
},
},
{
name: 'get_property_dependencies',
description: `Analyze property dependencies and visibility conditions for a node. Shows which properties control the visibility of others, helping you understand the configuration flow. Optionally provide a partial config to see what would be visible/hidden with those settings.`,
inputSchema: {
type: 'object',
properties: {
nodeType: {
type: 'string',
description: 'The node type to analyze (e.g., "nodes-base.httpRequest")',
},
config: {
type: 'object',
description: 'Optional partial configuration to check visibility impact',
},
},
required: ['nodeType'],
},
},
];
/**