@mytheo-my/portfolio 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +1 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -91,4 +91,4 @@ AI: [Calls tool with product_id="USDPORT", account_name="My Investment Account",
|
|
|
91
91
|
**Example 2 - Other Products:**
|
|
92
92
|
User: "I want the MYTHEO Global ESG portfolio"
|
|
93
93
|
AI: [Immediately calls tool with product_id="USDESGLGP" without asking for confirmation]
|
|
94
|
-
AI: "Great! I've created your MYTHEO Global ESG portfolio account. Here are the details: [shows account info]"`,inputSchema:{product_id:Oe.z.string().describe("The product ID from list_available_products"),account_name:Oe.z.string().optional().describe("Account name (required for USDPORT only)"),risk_tolerance:Oe.z.
|
|
94
|
+
AI: "Great! I've created your MYTHEO Global ESG portfolio account. Here are the details: [shows account info]"`,inputSchema:{product_id:Oe.z.string().describe("The product ID from list_available_products"),account_name:Oe.z.string().optional().describe("Account name (required for USDPORT only)"),risk_tolerance:Oe.z.string().optional().describe("Risk tolerance: low, medium, or high (USDPORT only)"),invest_duration:Oe.z.number().int().min(1).max(30).optional().describe("Investment duration in years 1-30 (USDPORT only)"),access_token:Oe.z.string().nullable().optional()}},async a=>{let{product_id:i,account_name:t,risk_tolerance:n,invest_duration:o,access_token:s}=a;if(!s)return{content:[{type:"text",text:JSON.stringify({error:"Unauthorized",message:"You are not allow to access this information."},null,2)}]};try{if(!this.config.API_KEY||this.config.API_KEY!==Xs)return{content:[{type:"text",text:JSON.stringify({error:"Unauthorized",message:"Invalid or missing API key. Please provide a valid API_KEY."},null,2)}]};if(i==="USDPORT"){if(!t||!n||!o)return{content:[{type:"text",text:JSON.stringify({error:"Missing required parameters for USDPORT",message:"USDPORT requires account_name, risk_tolerance, and invest_duration",required_parameters:{account_name:'string (e.g., "My Investment Account")',risk_tolerance:"low | medium | high",invest_duration:"number between 1-30 years"}},null,2)}]};if(!["low","medium","high"].includes(n))return{content:[{type:"text",text:JSON.stringify({error:"Invalid risk_tolerance",message:`risk_tolerance must be 'low', 'medium', or 'high'. Received: ${n}`},null,2)}]};if(o<1||o>30)return{content:[{type:"text",text:JSON.stringify({error:"Invalid invest_duration",message:`invest_duration must be between 1 and 30 years. Received: ${o}`},null,2)}]}}let r=await dt.createPortfolioAccount(i,t||void 0,n||void 0,o||void 0);return{content:[{type:"text",text:JSON.stringify({success:!0,message:"Portfolio account created successfully! Visit https://theo.silverlakedigitalinx.com/mytheoweb/home to check your portfolio",account_details:r},null,2)}]}}catch(r){let u=r instanceof Error?r.message:"Unknown error occurred";return{content:[{type:"text",text:JSON.stringify({error:"Failed to create portfolio account",message:u},null,2)}]}}})}setupErrorHandling(){process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}async run(){let a=new Zs.StdioServerTransport;await this.server.connect(a),this.logger.info("Portfolio MCP server running on stdio")}};var er=new Ke("portfolio");async function pu(){er.info("Starting Portfolio MCP server...");try{await new Ya().run()}catch(e){er.error("Failed to start Portfolio MCP server",e),process.exit(1)}}pu().then(e=>"");
|