fix: remove faulty auto-generated examples from MCP tools

- Remove examples from get_node_essentials responses
- Remove examples from validate_node_operation when errors occur
- Update documentation to reflect removal of examples
- Keep helpful format hints in get_node_for_task (different purpose)

The auto-generated examples were misleading AI agents with incorrect
configurations (e.g., Slack "channel" vs "select" property). Tools
now focus on validation and error messages instead of examples.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-07-17 21:17:35 +02:00
parent 24d775960b
commit ba7f8f9ea6
6 changed files with 47 additions and 146 deletions

View File

@@ -4,48 +4,54 @@ export const getNodeEssentialsDoc: ToolDocumentation = {
name: 'get_node_essentials',
category: 'configuration',
essentials: {
description: 'Returns only the most commonly-used properties for a node (10-20 fields) with working examples. Response is 95% smaller than get_node_info (5KB vs 100KB+). Essential properties include required fields, common options, and authentication settings.',
description: 'Returns only the most commonly-used properties for a node (10-20 fields). Response is 95% smaller than get_node_info (5KB vs 100KB+). Essential properties include required fields, common options, and authentication settings. Use validate_node_operation for working configurations.',
keyParameters: ['nodeType'],
example: 'get_node_essentials({nodeType: "nodes-base.slack"})',
performance: '<10ms, ~5KB response',
tips: [
'Always use this before get_node_info',
'Includes ready-to-use examples',
'Perfect for configuring nodes quickly'
'Use validate_node_operation for examples',
'Perfect for understanding node structure'
]
},
full: {
description: 'Returns a curated subset of node properties focusing on the most commonly-used fields. Essential properties are hand-picked for each node type and include: required fields, primary operations, authentication options, and the most frequent configuration patterns. Each response includes working examples you can copy and modify.',
description: 'Returns a curated subset of node properties focusing on the most commonly-used fields. Essential properties are hand-picked for each node type and include: required fields, primary operations, authentication options, and the most frequent configuration patterns. NOTE: Examples have been removed to avoid confusion - use validate_node_operation to get working configurations with proper validation.',
parameters: {
nodeType: { type: 'string', description: 'Full node type with prefix, e.g., "nodes-base.slack", "nodes-base.httpRequest"', required: true }
},
returns: `Object containing:
{
"nodeType": "nodes-base.slack",
"essentialProperties": {
"resource": ["channel", "message", "user"],
"operation": ["post", "update", "delete"],
"authentication": ["accessToken", "oAuth2"],
"channel": "Channel ID or name",
"text": "Message content",
"blocks": "Advanced formatting (optional)"
},
"examples": {
"postMessage": {
"resource": "message",
"operation": "post",
"channel": "#general",
"text": "Hello from n8n!"
"displayName": "Slack",
"description": "Consume Slack API",
"category": "output",
"version": "2.3",
"requiredProperties": [], // Most nodes have no strictly required fields
"commonProperties": [
{
"name": "resource",
"displayName": "Resource",
"type": "options",
"options": ["channel", "message", "user"],
"default": "message"
},
"withBlocks": {
"resource": "message",
"operation": "post",
"blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": "Hello"}}]
}
},
"authentication": {
"required": true,
"options": ["accessToken", "oAuth2"]
{
"name": "operation",
"displayName": "Operation",
"type": "options",
"options": ["post", "update", "delete"],
"default": "post"
},
// ... 10-20 most common properties
],
"operations": [
{"name": "Post", "description": "Post a message"},
{"name": "Update", "description": "Update a message"}
],
"metadata": {
"totalProperties": 121,
"isAITool": false,
"hasCredentials": true
}
}`,
examples: [
@@ -55,18 +61,18 @@ export const getNodeEssentialsDoc: ToolDocumentation = {
'// Workflow: search → essentials → validate',
'const nodes = search_nodes({query: "database"});',
'const mysql = get_node_essentials({nodeType: "nodes-base.mySql"});',
'validate_node_minimal("nodes-base.mySql", mysql.examples.select);'
'validate_node_operation("nodes-base.mySql", {operation: "select"}, "minimal");'
],
useCases: [
'Quickly configure nodes without information overload',
'Get working examples for common operations',
'Quickly understand node structure without information overload',
'Identify which properties are most important',
'Learn node basics before diving into advanced features',
'Build workflows faster with curated property sets'
],
performance: '<10ms response time, ~5KB payload (vs 100KB+ for full schema)',
bestPractices: [
'Always start with essentials, only use get_node_info if needed',
'Copy examples as configuration starting points',
'Use validate_node_operation to get working configurations',
'Check authentication requirements first',
'Use search_node_properties if specific property not in essentials'
],