mcp-agent-selection/debug_agent_names.py
Ryan Malloy 997cf8dec4 Initial commit: Production-ready FastMCP agent selection server
Features:
- FastMCP-based MCP server for Claude Code agent recommendations
- Hierarchical agent architecture with 39 specialized agents
- 10 MCP tools with enhanced LLM-friendly descriptions
- Composed agent support with parent-child relationships
- Project root configuration for focused recommendations
- Smart agent recommendation engine with confidence scoring

Server includes:
- Core recommendation tools (recommend_agents, get_agent_content)
- Project management tools (set/get/clear project roots)
- Discovery tools (list_agents, server_stats)
- Hierarchy navigation (get_sub_agents, get_parent_agent, get_agent_hierarchy)

All tools properly annotated for calling LLM clarity with detailed
arguments, return values, and usage examples.
2025-09-09 09:28:23 -06:00

57 lines
1.8 KiB
Python

#!/usr/bin/env python3
"""
Debug agent names to understand the recommendation issue
"""
import asyncio
import os
from pathlib import Path
import sys
# Add the source directory to the path
sys.path.insert(0, str(Path(__file__).parent / "src"))
from agent_mcp_server.server import AgentLibrary
async def debug_agent_names():
"""Debug agent names"""
print("🔍 Debugging Agent Names")
print("=" * 40)
# Initialize agent library with local templates
templates_path = Path(__file__).parent / "agent_templates"
library = AgentLibrary(templates_path)
await library.initialize()
print(f"\n📋 All loaded agents:")
for name, agent in sorted(library.agents.items()):
print(f"{agent.agent_type:>10} | {agent.emoji} {name}")
if agent.parent_agent:
print(f" └─ Parent: {agent.parent_agent}")
if agent.sub_agents:
print(f" └─ Sub-agents: {agent.sub_agents}")
print(f"\n🔧 Testing specific keyword matches:")
# Test the keywords we expect to match
keywords_to_test = ["python testing", "html report", "testing framework", "testing"]
for keyword in keywords_to_test:
print(f"\n🎯 Testing keyword: '{keyword}'")
matching_agents = []
for name, agent in library.agents.items():
if keyword.lower().replace(" ", "") in name.lower().replace("-", ""):
matching_agents.append(f"{agent.emoji} {name} ({agent.agent_type})")
if matching_agents:
print(f" Matches found:")
for match in matching_agents:
print(f"{match}")
else:
print(f" No matches found")
if __name__ == "__main__":
asyncio.run(debug_agent_names())