update_portfolio_weights
Update the weight distribution of assets in a portfolio and recalculate performance metrics such as Sharpe ratio.
Instructions
Update the allocation weights of an existing portfolio.
Changes the weight distribution across assets in a portfolio and recalculates all metrics.
Args: name: The portfolio name. weights: New allocation weights per symbol. Must sum to 1.0.
Returns: Updated portfolio information with new metrics.
Example:
result = update_portfolio_weights( name="tech_stocks", weights={"GOOG": 0.5, "AMZN": 0.3, "AAPL": 0.2} ) print(f"New Sharpe: {result['metrics']['sharpe_ratio']}")
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"weights": "<weights>"
},
"name": "update_portfolio_weights"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| weights | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||