Pipe library / price-news-alert
price-news-alert
Coinbase prices under a USD threshold, then CoinDesk headlines that mention those coins. The news fetch runs only when at least one price is under the threshold.
Price and market Chained
api.coinbase.comwww.coindesk.com
Sub-pipes
CLI
pipes run examples/price-news-alert.pipe.yaml
MCP call
{
"name": "pipe__price-news-alert",
"arguments": {}
}
Pipe file
examples/price-news-alert.pipe.yaml
pipes: 0
name: price-news-alert
version: 0.1.0
description: Coinbase prices under a USD threshold, then CoinDesk headlines that mention those coins. The news fetch runs only when at least one price is under the threshold.
permissions:
network: [api.coinbase.com, www.coindesk.com]
inputs:
type: object
properties:
coins:
type: array
description: Ticker symbols in uppercase, such as BTC.
items: { type: string, pattern: "^[A-Z0-9]+$" }
minItems: 1
maxItems: 5
default: [BTC]
below:
type: number
description: USD threshold. Prices at or above this are left out, and no news is fetched.
exclusiveMinimum: 0
default: 1000000
required: [coins, below]
outputs:
type: object
properties:
text: { type: string }
count: { type: integer }
required: [text, count]
output:
text: "${steps.digest.text}"
count: "${steps.digest.count}"
steps:
- id: prices
block: pipe:crypto-price-threshold@^0.1
with:
coins: "${inputs.coins}"
below: "${inputs.below}"
- id: fetch
when: "${steps.prices.count}"
block: fetch_http
with:
url: https://www.coindesk.com/arc/outboundfeeds/rss/
max_bytes: 400000
timeout_ms: 15000
- id: stories
block: parse_rss
in: "${steps.fetch}"
- id: about
block: filter
in: "${steps.stories}"
with:
where: { field: title, op: contains_any, value: "${inputs.coins}" }
- id: ordered
block: sort
in: "${steps.about}"
with:
by: [{ field: published, desc: true }]
- id: capped
block: limit
in: "${steps.ordered}"
with: { n: 5 }
- id: digest
block: format
in: "${steps.capped}"
with:
header: "Prices\n${steps.prices.text}\n\nNews\n"
item_template: "- ${item.title} ${item.link}"
separator: "\n"
- id: print
block: emit_stdout
in: "${steps.digest.text}"
with: { format: text }