Skip to main content
Glama

MCP Agent Tracker

by Big0290
diagnose_goals_flow.py•5.33 kB
#!/usr/bin/env python3 """ šŸ” Diagnostic Script: Check Goals Flow and Updates """ def diagnose_goals_flow(): """Diagnose why the goals flow is broken""" print("šŸ” DIAGNOSING GOALS FLOW AND UPDATES") print("=" * 60) try: # Test 1: Check if prompt generator is working print("1ļøāƒ£ Testing prompt generator availability...") from prompt_generator import PromptGenerator generator = PromptGenerator() print("āœ… PromptGenerator available") # Test 2: Check context gathering print("\n2ļøāƒ£ Testing context gathering...") try: context = generator._gather_context_data("test goals flow", "smart") print("āœ… Context gathering successful") print(f"šŸ“‹ Context type: {type(context)}") # Check specific fields print(f"šŸ’¬ Conversation summary: {hasattr(context, 'conversation_summary')}") print(f"šŸ“ Action history: {hasattr(context, 'action_history')}") print(f"šŸŽÆ Project plans: {hasattr(context, 'project_plans')}") if hasattr(context, 'project_plans'): print(f"šŸŽÆ Project plans content: {context.project_plans[:100]}...") else: print("āŒ Project plans field missing!") except Exception as e: print(f"āŒ Context gathering failed: {e}") return # Test 3: Check optimized prompt generator print("\n3ļøāƒ£ Testing optimized prompt generator...") try: from optimized_prompt_generator import OptimizedPromptGenerator opt_generator = OptimizedPromptGenerator() print("āœ… OptimizedPromptGenerator available") # Test context conversion context_dict = opt_generator._context_to_dict(context) print(f"āœ… Context conversion successful") print(f"šŸ“‹ Available keys: {list(context_dict.keys())}") print(f"šŸŽÆ Project plans in dict: {'project_plans' in context_dict}") except Exception as e: print(f"āŒ Optimized prompt generator failed: {e}") return # Test 4: Check intent classification print("\n4ļøāƒ£ Testing intent classification...") try: if opt_generator.intent_selector: relevant_context, intent_analysis = opt_generator.intent_selector.select_relevant_context( "test goals flow and updates", context_dict ) print(f"āœ… Intent classification successful") print(f"šŸŽÆ Intent: {intent_analysis.primary_intent.value}") print(f"šŸ“‹ Context requirements: {intent_analysis.context_requirements}") print(f"šŸ”§ Selected context: {list(relevant_context.keys())}") print(f"šŸŽÆ Project plans in selected: {'project_plans' in relevant_context}") else: print("āš ļø Intent selector not available") except Exception as e: print(f"āŒ Intent classification failed: {e}") # Test 5: Check conversation context formatting print("\n5ļøāƒ£ Testing conversation context formatting...") try: conversation_context = opt_generator._format_phase1_conversation_context(context_dict) print(f"āœ… Conversation context formatting successful") print(f"šŸ“‹ Result length: {len(conversation_context)}") print(f"šŸ’¬ Contains context: {'šŸ’¬ CONTEXT:' in conversation_context}") print(f"šŸ“ Contains recent: {'šŸ“ RECENT:' in conversation_context}") print(f"šŸŽÆ Contains goals: {'šŸŽÆ GOALS:' in conversation_context}") print(f"šŸ“‹ Formatted result:\n{conversation_context}") except Exception as e: print(f"āŒ Conversation context formatting failed: {e}") # Test 6: Check essential context safeguard print("\n6ļøāƒ£ Testing essential context safeguard...") try: # Create a filtered context that's missing some sections filtered_context = {'user_preferences': 'test', 'agent_metadata': 'test'} safeguarded_context = opt_generator._ensure_essential_context(filtered_context, context_dict) print(f"āœ… Essential context safeguard successful") print(f"šŸ“‹ Safeguarded keys: {list(safeguarded_context.keys())}") print(f"šŸŽÆ Project plans safeguarded: {'project_plans' in safeguarded_context}") except Exception as e: print(f"āŒ Essential context safeguard failed: {e}") print("\n" + "=" * 60) print("šŸ” DIAGNOSIS COMPLETE") # Final assessment if 'šŸŽÆ GOALS:' in conversation_context: print("šŸŽ‰ SUCCESS: Goals flow is working!") else: print("āŒ FAILURE: Goals flow is broken!") print("šŸ” Check the diagnostic output above for issues") except Exception as e: print(f"āŒ Error during diagnosis: {e}") import traceback traceback.print_exc() if __name__ == "__main__": diagnose_goals_flow()

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Big0290/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server