|
27 | 27 | <parameter name="enableJSONOnly">true</parameter> |
28 | 28 | <parameter name="disableSOAP">true</parameter> |
29 | 29 | <operation name="portfolioVariance"> |
| 30 | + <parameter name="mcpDescription">Calculate portfolio variance using O(n²) covariance matrix multiplication. Returns variance, volatility, annualized volatility. Supports up to 2000 assets with optional weight normalization and custom annualization periods (252 for equity, 365 for crypto, 12 for monthly).</parameter> |
| 31 | + <parameter name="mcpInputSchema">{ |
| 32 | + "type": "object", |
| 33 | + "required": ["nAssets", "weights", "covarianceMatrix"], |
| 34 | + "properties": { |
| 35 | + "nAssets": {"type": "integer", "minimum": 2, "maximum": 2000, "description": "Number of assets in the portfolio"}, |
| 36 | + "weights": {"type": "array", "items": {"type": "number"}, "description": "Portfolio weights. Must sum to 1.0 unless normalizeWeights=true"}, |
| 37 | + "covarianceMatrix": {"type": "array", "items": {"type": "array", "items": {"type": "number"}}, "description": "n×n covariance matrix (2D array)"}, |
| 38 | + "covarianceMatrixFlat": {"type": "array", "items": {"type": "number"}, "description": "Alternative: flattened n×n covariance matrix (row-major, length = nAssets²)"}, |
| 39 | + "normalizeWeights": {"type": "boolean", "default": false, "description": "Rescale weights to sum to 1.0"}, |
| 40 | + "nPeriodsPerYear": {"type": "integer", "default": 252, "description": "Trading periods for annualizing. 252=equity, 365=crypto, 12=monthly"}, |
| 41 | + "requestId": {"type": "string", "description": "Optional request ID echoed in response for tracing"} |
| 42 | + } |
| 43 | + }</parameter> |
30 | 44 | <messageReceivers> |
31 | 45 | <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" |
32 | 46 | class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/> |
|
35 | 49 | </messageReceivers> |
36 | 50 | </operation> |
37 | 51 | <operation name="monteCarlo"> |
| 52 | + <parameter name="mcpDescription">Monte Carlo VaR simulation using Geometric Brownian Motion. Returns VaR at caller-specified percentiles, CVaR (expected shortfall), max drawdown, probability of profit, and throughput metrics. All parameters have sensible defaults — an empty request body is valid.</parameter> |
| 53 | + <parameter name="mcpInputSchema">{ |
| 54 | + "type": "object", |
| 55 | + "required": [], |
| 56 | + "properties": { |
| 57 | + "nSimulations": {"type": "integer", "default": 10000, "maximum": 1000000, "description": "Number of simulation paths (max 1M)"}, |
| 58 | + "nPeriods": {"type": "integer", "default": 252, "description": "Time steps per path (252 = 1 trading year)"}, |
| 59 | + "initialValue": {"type": "number", "default": 1000000, "description": "Starting portfolio value in currency units"}, |
| 60 | + "expectedReturn": {"type": "number", "default": 0.08, "description": "Annualized expected return (0.08 = 8%)"}, |
| 61 | + "volatility": {"type": "number", "default": 0.20, "description": "Annualized volatility (0.20 = 20%)"}, |
| 62 | + "randomSeed": {"type": "integer", "default": 0, "description": "RNG seed for reproducibility. 0 = non-deterministic"}, |
| 63 | + "nPeriodsPerYear": {"type": "integer", "default": 252, "description": "Periods per year for GBM dt calculation"}, |
| 64 | + "percentiles": {"type": "array", "items": {"type": "number"}, "default": [0.01, 0.05], "description": "VaR percentiles, e.g. [0.01, 0.05] for 99% and 95%"}, |
| 65 | + "requestId": {"type": "string", "description": "Optional request ID echoed in response"} |
| 66 | + } |
| 67 | + }</parameter> |
38 | 68 | <messageReceivers> |
39 | 69 | <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" |
40 | 70 | class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/> |
|
43 | 73 | </messageReceivers> |
44 | 74 | </operation> |
45 | 75 | <operation name="scenarioAnalysis"> |
| 76 | + <parameter name="mcpDescription">Probability-weighted scenario analysis with hash table vs linear scan benchmarking. Computes expected return, upside potential, downside risk across user-defined price scenarios per asset.</parameter> |
| 77 | + <parameter name="mcpInputSchema">{ |
| 78 | + "type": "object", |
| 79 | + "required": ["assets"], |
| 80 | + "properties": { |
| 81 | + "assets": {"type": "array", "description": "Portfolio assets with scenario prices and probabilities", "items": { |
| 82 | + "type": "object", |
| 83 | + "required": ["assetId", "currentPrice", "positionSize", "scenarios"], |
| 84 | + "properties": { |
| 85 | + "assetId": {"type": "integer", "description": "Unique asset identifier"}, |
| 86 | + "currentPrice": {"type": "number", "description": "Current market price (must be > 0)"}, |
| 87 | + "positionSize": {"type": "number", "description": "Number of shares/units held"}, |
| 88 | + "scenarios": {"type": "array", "description": "Price scenarios with probabilities (must sum to 1.0)", "items": { |
| 89 | + "type": "object", |
| 90 | + "properties": { |
| 91 | + "price": {"type": "number", "description": "Scenario price"}, |
| 92 | + "probability": {"type": "number", "description": "Scenario probability (0-1)"} |
| 93 | + } |
| 94 | + }} |
| 95 | + } |
| 96 | + }}, |
| 97 | + "useHashLookup": {"type": "boolean", "default": true, "description": "Use HashMap for O(1) lookups vs ArrayList O(n) scan"}, |
| 98 | + "probTolerance": {"type": "number", "default": 0.0001, "description": "Tolerance for probability sum validation"}, |
| 99 | + "requestId": {"type": "string", "description": "Optional request ID echoed in response"} |
| 100 | + } |
| 101 | + }</parameter> |
46 | 102 | <messageReceivers> |
47 | 103 | <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" |
48 | 104 | class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/> |
|
0 commit comments