Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Complete Solution: Missing dispatch_workflow Tools + Similar Tool Suggestions

Summary

Implemented a comprehensive solution for the issue where dispatch_workflow tools don't appear in the MCP server's available tools list, plus added intelligent tool suggestions when tools are missing.

Problems Addressed

  1. Original Issue: dispatch_workflow tools not appearing despite being configured
  2. New Requirement: Suggest similar tools when MCP tool not found (typos, misspellings)

Solutions Delivered

Part 1: Enhanced Diagnostic Logging ✅

Files: actions/setup/js/safe_outputs_tools_loader.cjs, docs/troubleshooting-dispatch-workflow.md

Features:

  • Detect and log all dispatch_workflow tools during loading
  • Show registration decisions with detailed context
  • WARNING messages when tools can't register
  • Display available config keys for comparison

Example Log Output:

Found 3 dispatch_workflow tools:
  - add_name (workflow: add-name)
  
Found dispatch_workflow tool: add_name (_workflow_name: add-name)
  WARNING: dispatch_workflow config is missing or falsy - tool will NOT be registered
  Config keys: missing_tool, noop
  config.dispatch_workflow value: undefined

Part 2: Similar Tool Suggestions ✅

Files: actions/setup/js/mcp_server_core.cjs, actions/setup/js/mcp_server_core.test.cjs

Implementation:

  • Levenshtein distance algorithm for similarity calculation
  • Smart filtering (only suggests reasonably similar tools)
  • Ranking by similarity (closest first)
  • Handles tool name normalization (dashes ↔ underscores)

Example Error Messages:

Before: Tool 'dispatch-add-name' not found
After:  Tool 'dispatch-add-name' not found. Did you mean one of these: add_name, add_comment?

Before: Tool 'add_comentt' not found
After:  Tool 'add_comentt' not found. Did you mean one of these: add_comment, add_name?

Testing

Comprehensive Test Suite: ✅ 42/42 tests passing

New Tests Added:

  • Levenshtein distance calculations (4 tests)
  • Similar tool finding (5 tests)
  • Enhanced error messages (2 tests)

Test Coverage:

  • Identical strings, typos, partial matches
  • Normalization (dashes/underscores)
  • No matches (completely different)
  • Suggestion limits and ranking

Benefits

  1. Diagnostic Power: Immediately identify why tools aren't registering
  2. User Experience: Instant feedback with helpful suggestions
  3. Typo Detection: Catches common misspellings automatically
  4. Discoverability: Helps users find correct tool names
  5. Context Awareness: Shows related tools when specific ones are missing

Files Changed

  • actions/setup/js/safe_outputs_tools_loader.cjs - Enhanced logging
  • actions/setup/js/mcp_server_core.cjs - Similarity matching + error messages
  • actions/setup/js/mcp_server_core.test.cjs - Comprehensive tests
  • docs/troubleshooting-dispatch-workflow.md - Complete troubleshooting guide

Code Quality

✅ All tests passing (42/42)
✅ Code formatted
✅ No linting errors
✅ Well-documented functions
✅ Code review completed

Next Steps

When users report this issue:

  1. Check MCP logs for WARNING messages (shows exact cause)
  2. See similar tool suggestions in error messages
  3. Follow troubleshooting guide for resolution
  4. Most common fix: Recompile workflow with gh aw compile
Original prompt

Stil not finding workflows (mentioned in dispatch_workflow safe output) under mcp tools:
Available MCP Tools:

Based on the system information provided, I have access to the following safe-output tools:

  • safeoutputs-add_comment: Add comments to issues/PRs
  • safeoutputs-missing_data: Report missing data
  • safeoutputs-missing_tool: Report missing tools/capabilities
  • safeoutputs-noop: Log transparency messages

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 31, 2026 09:36
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Report missing workflows under MCP tools Add diagnostic logging for dispatch_workflow tool registration failures Jan 31, 2026
Copilot AI requested a review from mnkiefer January 31, 2026 09:44
Copilot AI and others added 2 commits January 31, 2026 09:51
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review January 31, 2026 10:00
@mnkiefer mnkiefer merged commit 67d415e into main Jan 31, 2026
56 checks passed
@mnkiefer mnkiefer deleted the copilot/report-missing-tools branch January 31, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants