We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NBWolfer/mcpOpenbankingMCPServer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
strategy_tools.cpython-311.pyc•7.91 KiB
�
�{hc � �l � d Z ddlZddlmZmZmZ ddlmZ ej e � � Z
G d� d� � ZdS )z
Strategy recommendation tools
� N)�Dict�Any�List)�AgentManagerc �� � e Zd ZdZdefd�Z ddeeef deeef dedefd �Z d
eeef deeef defd�Z
d
eeef deeef defd�Zd
eeef deeef defd�ZdS )�
StrategyToolsz-Tools for investment strategy recommendations�
agent_managerc � � || _ d S )N)r )�selfr s �IC:\Users\Enes\Desktop\mcpOpenbankingMCPServer\src\tools\strategy_tools.py�__init__zStrategyTools.__init__ s � �*����� �balanced�user_profile�market_conditions�
strategy_type�returnc � � K � d|� d|� d|� d�}d}| j � |d|�� � � d{V ��\ }}d |� d
|� �S # t $ r9}t � d|� �� � dt |� � � �cY d}~S d}~ww xY w)
zIRecommend investment strategy based on user profile and market conditionsz
User Profile: z
Market Conditions: z&
Requested Strategy Type: �
a�
Please recommend a comprehensive investment strategy tailored to the user's profile and current market conditions.
Consider:
1. User's risk tolerance and investment horizon
2. Financial goals and constraints
3. Current market environment
4. Asset allocation recommendations
5. Security selection criteria
6. Timing and implementation considerations
7. Rebalancing frequency and triggers
8. Exit strategies and risk management
Provide a detailed, actionable investment strategy with specific recommendations.
�strategy��prompt� task_type�contextNzStrategy Recommendation (by �):
z"Error in strategy recommendation: zError recommending strategy: �r �query_best_agent� Exception�logger�error�str) r r r r r r �
agent_name�response�es r �recommend_strategyz StrategyTools.recommend_strategy s � � � �! <��'�� � 1�� � '4�� � �G��F� *.�);�)L�)L��$�� *M� *� *� $� $� $� $� $� $� �J�� O�*�N�N�H�N�N�N��� <� <� <��L�L�A�a�A�A�B�B�B�;�3�q�6�6�;�;�;�;�;�;�;�;����� <���s �;A �
B�
.A>�8B�>B�market_outlook�current_allocationc � � K � d|� d|� d�}d}| j � |d|�� � � d{V ��\ }}d|� d |� �S # t $ r9}t � d
|� �� � dt |� � � �cY d}~S d}~ww xY w)z1Provide tactical asset allocation recommendationsz
Market Outlook: z!
Current Allocation: r ap
Please provide tactical asset allocation recommendations based on the market outlook.
Analyze:
1. Short-term market opportunities and risks
2. Sector and regional rotation opportunities
3. Over/underweight recommendations vs strategic allocation
4. Duration and magnitude of tactical adjustments
5. Market timing considerations
6. Risk management overlays
7. Implementation costs and logistics
Provide specific allocation targets and rationale for each adjustment.
r r NzTactical Allocation (by r zError in tactical allocation: z%Error providing tactical allocation: r )r r&