feat: complete modular documentation system for all MCP tools (#60)

- Migrated all 40 MCP tools documentation to modular structure
- Created comprehensive documentation with both essentials and full details
- Organized tools by category: discovery, configuration, validation, templates, workflow_management, system, special
- Fixed all TODO placeholders with informative, precise content
- Each tool now has concise description, key tips, and full documentation
- Improved documentation quality: 30-40% more concise while maintaining usefulness
- Fixed TypeScript compilation issues and removed orphaned content
- All tools accessible via tools_documentation MCP endpoint
- Build successful with zero errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-07-17 18:39:29 +02:00
parent 8025d31e63
commit c1a6347d4f
53 changed files with 2744 additions and 1322 deletions

View File

@@ -0,0 +1,42 @@
import { ToolDocumentation } from '../types';
export const getDatabaseStatisticsDoc: ToolDocumentation = {
name: 'get_database_statistics',
category: 'discovery',
essentials: {
description: 'Node stats: 525 total, 263 AI tools, 104 triggers, 87% docs coverage. Verifies MCP working.',
keyParameters: [],
example: 'get_database_statistics()',
performance: 'Instant',
tips: [
'Use to verify MCP connection',
'Check doc coverage',
'See AI tool counts'
]
},
full: {
description: 'Returns comprehensive database statistics including node counts, AI tool availability, trigger nodes, documentation coverage, and package distribution. Useful for verifying MCP connectivity.',
parameters: {},
returns: 'Statistics object with total_nodes, ai_tools, triggers, docs_coverage, packages breakdown',
examples: [
'get_database_statistics() - Get all statistics'
],
useCases: [
'Verify MCP is working',
'Check documentation coverage',
'Audit available nodes',
'Monitor AI tool availability'
],
performance: 'Instant - Pre-calculated statistics',
bestPractices: [
'Use to verify connection',
'Check before bulk operations',
'Monitor after database updates'
],
pitfalls: [
'Stats cached until rebuild',
'May not reflect runtime changes'
],
relatedTools: ['list_nodes', 'list_ai_tools', 'search_nodes']
}
};

View File

@@ -0,0 +1,4 @@
export { searchNodesDoc } from './search-nodes';
export { listNodesDoc } from './list-nodes';
export { listAiToolsDoc } from './list-ai-tools';
export { getDatabaseStatisticsDoc } from './get-database-statistics';

View File

@@ -0,0 +1,24 @@
import { ToolDocumentation } from '../types';
export const listAiToolsDoc: ToolDocumentation = {
name: 'list_ai_tools',
category: 'discovery',
essentials: {
description: 'List AI-optimized nodes. Note: ANY node can be AI tool! Connect any node to AI Agent\'s tool port. Community nodes need N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true.',
keyParameters: [],
example: 'list_ai_tools()',
performance: 'Fast query',
tips: ['ANY node works as AI tool']
},
full: {
description: 'List nodes marked as AI tools. IMPORTANT: Any n8n node can be used as AI tool by connecting to AI Agent\'s tool port.',
parameters: {},
returns: 'Array of AI-optimized nodes with usage hints',
examples: ['list_ai_tools() - Get AI-optimized nodes'],
useCases: ['Find AI model integrations', 'Build agent toolchains'],
performance: 'Fast query, cached results',
bestPractices: ['Any node works as tool', 'Community nodes need env var'],
pitfalls: ['List not exhaustive - all nodes work'],
relatedTools: ['get_node_as_tool_info', 'search_nodes']
}
};

View File

@@ -0,0 +1,35 @@
import { ToolDocumentation } from '../types';
export const listNodesDoc: ToolDocumentation = {
name: 'list_nodes',
category: 'discovery',
essentials: {
description: 'List n8n nodes. Common: list_nodes({limit:200}) for all, list_nodes({category:"trigger"}) for triggers. Package: "n8n-nodes-base" or "@n8n/n8n-nodes-langchain". Categories: trigger/transform/output/input.',
keyParameters: ['category', 'package', 'limit', 'isAITool'],
example: 'list_nodes({limit:200})',
performance: 'Fast query',
tips: ['limit:200+ for all']
},
full: {
description: 'List n8n nodes with filtering. Returns array of nodes with metadata.',
parameters: {
category: { type: 'string', description: 'trigger|transform|output|input|AI', required: false },
package: { type: 'string', description: '"n8n-nodes-base" (core) or "@n8n/n8n-nodes-langchain" (AI)', required: false },
limit: { type: 'number', description: 'Max results (default 50, use 200+ for all)', required: false },
isAITool: { type: 'boolean', description: 'Filter AI-capable nodes', required: false },
developmentStyle: { type: 'string', description: 'Usually "programmatic"', required: false }
},
returns: 'Array with nodeType, displayName, description, category',
examples: [
'list_nodes({limit:200}) - All nodes',
'list_nodes({category:"trigger"}) - Webhook, Schedule, etc.',
'list_nodes({package:"@n8n/n8n-nodes-langchain"}) - AI/LangChain nodes',
'list_nodes({isAITool:true}) - Nodes usable as AI tools'
],
useCases: ['Browse by category', 'Find triggers', 'Get AI nodes'],
performance: 'Fast query, returns metadata only',
bestPractices: ['Use limit:200+ for full list', 'Category for focused search'],
pitfalls: ['No text search - use search_nodes'],
relatedTools: ['search_nodes', 'list_ai_tools']
}
};

View File

@@ -0,0 +1,45 @@
import { ToolDocumentation } from '../types';
export const searchNodesDoc: ToolDocumentation = {
name: 'search_nodes',
category: 'discovery',
essentials: {
description: 'Search nodes by keyword. Common nodes ranked first.',
keyParameters: ['query', 'mode'],
example: 'search_nodes({query: "webhook"})',
performance: 'Fast (<20ms)',
tips: [
'OR=any word, AND=all words, FUZZY=typos',
'Quotes for exact phrase'
]
},
full: {
description: 'Full-text search with relevance ranking. Common nodes (webhook, http) prioritized.',
parameters: {
query: { type: 'string', description: 'Use quotes for exact phrase', required: true },
limit: { type: 'number', description: 'Default: 20', required: false },
mode: { type: 'string', description: 'OR|AND|FUZZY', required: false }
},
returns: 'Nodes array sorted by relevance',
examples: [
'search_nodes({query: "webhook"}) - Finds Webhook node',
'search_nodes({query: "slak", mode: "FUZZY"}) - Finds Slack'
],
useCases: [
'Finding nodes by keyword',
'Typo-tolerant search',
'Multi-word searches'
],
performance: 'Fast - FTS5 search',
bestPractices: [
'Single words for best results',
'FUZZY for uncertain spelling',
'AND requires all terms anywhere'
],
pitfalls: [
'AND searches all fields not just names',
'Short queries + FUZZY = unexpected results'
],
relatedTools: ['list_nodes', 'get_node_essentials']
}
};