Every method of client.alert() in the Rust SDK.
arm#
Arm an alert again · tool alert_arm
Arms an alert again from nothing — a paused one resumed, a fired or expired one re-armed — as its row's Resume and Re-arm do. Answers the alert.
Declaration
client.alert()
pub fn arm(&self, args: AlertArmArgs) -> Result<ValueParameters
| Name | Type | What it is | |
|---|---|---|---|
alert | impl Into<String> | required | The alert's uri. |
Returns
Result<Value, Error> — the tool’s answer as a serde_json::Value.
What it answers
Answers the alert.
Example
client.alert().arm(mcp::AlertArmArgs::new(alert.clone()))?create#
Make an alert · tool alert_create
Makes an alert on a workbench's market, as the alert editor's Create does — on a laboratory bench it runs on that bench's clock — and refuses one the editor would not make, in its terms. Answers the alert as filed, with its uri.
Declaration
client.alert()
pub fn create(&self, args: AlertCreateArgs) -> Result<ValueParameters
| Name | Type | What it is | |
|---|---|---|---|
bench | impl Into<String> | required | The workbench's uri: a laboratory bench's alert runs on its clock; a real bench's on its feed. |
symbol | impl Into<String> | required | |
spec | impl Into<Value> | required | The alert as it is filed: conditions (each a source, an operator, a value or a pair, an interval), trigger, expires_ms, message, channels, driver. |
Returns
Result<Value, Error> — the tool’s answer as a serde_json::Value.
What it answers
Recorded from a running Bentrix 0.1.382 on a laboratory of generated markets (long lists cut to their first rows):
{
"alert": {
"bench": [
1,
2
],
"created_ms": 1793397599999,
"id": 8,
"market": "SYN-DOCS",
"run": {
"seats": [],
"state": "armed"
},
"spec": {
"channels": [
"toast"
],
"conditions": [
{
"interval": "H1",
"source": {
"price": "bid"
},
"test": {
"compare": {
"op": "crossing_up",
"operand": {
"value": 1.2
}
}
}
}
],
"message": {
"text": "SYN-DOCS crossed 1.2"
},
"trigger": "once_only"
}
},
"uri": "bentrix://alert/alert-8"
}Example
client.alert().create(mcp::AlertCreateArgs::new(bench.clone(), "SYN-DOCS", "…"))?edit#
Edit an alert · tool alert_edit
Gives an alert a new specification, as the editor's Save does; an edit arms it again from nothing. Answers the alert.
Declaration
client.alert()
pub fn edit(&self, args: AlertEditArgs) -> Result<ValueParameters
| Name | Type | What it is | |
|---|---|---|---|
alert | impl Into<String> | required | The alert's uri. |
spec | impl Into<Value> | required | The whole specification it is to have, as alert_create takes it. |
Returns
Result<Value, Error> — the tool’s answer as a serde_json::Value.
What it answers
Answers the alert.
Example
client.alert().edit(mcp::AlertEditArgs::new(alert.clone(), "…"))?pause#
Pause an alert · tool alert_pause
Pauses an alert, as its row's Pause does. Answers the alert.
Declaration
client.alert()
pub fn pause(&self, args: AlertPauseArgs) -> Result<ValueParameters
| Name | Type | What it is | |
|---|---|---|---|
alert | impl Into<String> | required | The alert's uri. |
Returns
Result<Value, Error> — the tool’s answer as a serde_json::Value.
What it answers
Answers the alert.
Example
client.alert().pause(mcp::AlertPauseArgs::new(alert.clone()))?remove#
Remove an alert · tool alert_remove
Removes an alert, as its row's x does. Answers the alerts left.
Declaration
client.alert()
pub fn remove(&self, args: AlertRemoveArgs) -> Result<ValueParameters
| Name | Type | What it is | |
|---|---|---|---|
alert | impl Into<String> | required | The alert's uri. |
Returns
Result<Value, Error> — the tool’s answer as a serde_json::Value.
What it answers
Answers the alerts left.
Example
client.alert().remove(mcp::AlertRemoveArgs::new(alert.clone()))?