Files
n8n-mcp/docs/SLACK_DOCUMENTATION_FIX.md
czlonkowski 3d7fdeba02 feat: Complete overhaul to enhanced documentation-only MCP server
- Removed all workflow execution capabilities per user requirements
- Implemented enhanced documentation extraction with operations and API mappings
- Fixed credential code extraction for all nodes
- Fixed package info extraction (name and version)
- Enhanced operations parser to handle n8n markdown format
- Fixed documentation search to prioritize app nodes over trigger nodes
- Comprehensive test coverage for Slack node extraction
- All node information now includes:
  - Complete operations list (42 for Slack)
  - API method mappings with documentation URLs
  - Source code and credential definitions
  - Package metadata
  - Related resources and templates

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 11:07:51 +00:00

2.6 KiB

Slack Documentation Fix Summary

Issues Fixed

1. Documentation Fetcher Was Getting Wrong Files

Problem: When searching for Slack node documentation, the fetcher was finding credential documentation instead of node documentation.

Root Cause:

  • Documentation files in n8n-docs repository are named with full node type (e.g., n8n-nodes-base.slack.md)
  • The fetcher was searching for just the node name (e.g., slack.md)
  • This caused it to find slack.md in the credentials folder first

Fix Applied:

  • Updated getNodeDocumentation() to search for full node type first
  • Added logic to skip credential documentation files by checking:
    • If file path includes /credentials/
    • If content has "credentials" in title without "node documentation"
  • Fixed search order to prioritize correct documentation

2. Node Source Extractor Case Sensitivity

Problem: Slack node source code wasn't found because the directory is capitalized (Slack/) but search was case-sensitive.

Root Cause:

  • n8n node directories use capitalized names (e.g., Slack/, If/)
  • Extractor was searching with lowercase names from node type

Fix Applied:

  • Added case variants to try when searching:
    • Original case
    • Capitalized first letter
    • All lowercase
    • All uppercase
  • Now properly finds nodes regardless of directory naming convention

3. Missing Information in Database

Problem: Node definitions weren't being properly parsed from compiled JavaScript.

Fix Applied:

  • Improved parseNodeDefinition() to extract individual fields using regex
  • Added extraction for:
    • displayName
    • description
    • icon
    • category/group
    • version
    • trigger/webhook detection

Test Results

After applying fixes:

  • Slack node source code is correctly extracted
  • Slack node documentation (not credentials) is fetched
  • Documentation URL points to correct page
  • All information is properly stored in database

Files Modified

  1. /src/utils/documentation-fetcher.ts

    • Fixed path searching logic
    • Added credential documentation filtering
    • Improved search order
  2. /src/utils/node-source-extractor.ts

    • Added case-insensitive directory searching
    • Improved path detection for different node structures
  3. /src/services/node-documentation-service.ts

    • Enhanced node definition parsing
    • Better extraction of metadata from source code

Verification

Run the test to verify the fix:

node tests/test-slack-fix.js

This should show:

  • Source code found at correct location
  • Documentation is node documentation (not credentials)
  • All fields properly extracted and stored