Define derived series
define_derivedCreate or replace a derived series, computed from other series every time it is read (always fresh, stores no points, counts toward the series limit). definition: {"op":"add"|"subtract"|"multiply"|"divide","a":series,"b":series} (matched by date) | {"op":"pct_change"|"diff"|"moving_average"|"rolling_min"|"rolling_max"|"shift","a":series,"n"?:1-1000} (shift: the value n points earlier) | {"op":"scale","a":series,"factor":number} | {"op":"resample","a":series,"to":"M"|"Q","how"?:"last"|"mean"|"sum"|"ffill"} (to month/quarter ends; ffill also fills gaps up to today) | {"op":"mean"|"sum","inputs":[2-20 series]} (dates all inputs have) | {"op":"status","a":series,"red"?:[rule],"yellow"?:[rule]} → text labels red/yellow/green (red if any red rule holds, else yellow if any yellow rule, else green); rule: {"series"?:name (default a; read as of each date of a),"above"|"below":number,"for"?:1-24 (holds for the last k points)} or {"all":[2-10 rules]}; at most 10 rules | {"op":"composite","inputs":[status series],"min_inputs"?:n} → 0-100 score (red 2, yellow 1, green 0) | {"op":"count","inputs":[status series],"value":"red"|"yellow"|"green","share"?:true (percent)}. Inputs may themselves be derived (up to 10 levels; one read may touch at most 200 stored series). Example: a yield-curve spread {"op":"subtract","a":"govt_10y","b":"tbill_3m"}.
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": {
"series": "<series>",
"definition": "<definition>"
},
"name": "define_derived"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| series | Yes | name for the derived series | |
| definition | Yes | definition |