get_rsi
Calculates the Relative Strength Index (RSI) for a stock ticker using a configurable period (default 14) to identify overbought or oversold conditions.
Instructions
Relative Strength Index values for a stock. Default window 14.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | ||
| timespan | No | day | |
| window | No | ||
| series_type | No | close | |
| timestamp | No | ||
| limit | No | ||
| cursor | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The `get_rsi` tool handler, decorated with @mcp.tool(), sends a GET request to /v1/indicators/rsi/{ticker} with common query params (timespan, window, series_type, etc).
@mcp.tool() async def get_rsi( ticker: str, timespan: Timespan = "day", window: int = 14, series_type: Series = "close", timestamp: str | None = None, limit: int = 50, cursor: str | None = None, ) -> dict[str, Any]: """Relative Strength Index values for a stock. Default window 14.""" return await client.get( f"/v1/indicators/rsi/{ticker}", _common(timespan, window, series_type, timestamp, limit, cursor), ) - The `_common` helper function builds the shared query parameter dict used by get_rsi (and other indicators).
def _common( timespan: Timespan, window: int, series_type: Series, timestamp: str | None, limit: int, cursor: str | None, ) -> dict[str, Any]: return { "timespan": timespan, "window": window, "series_type": series_type, "timestamp": timestamp, "limit": limit, "cursor": cursor, "order": "desc", } - src/massive_mcp/server.py:37-48 (registration)Registration: indicators module's `register()` is called in the build_server() loop, which registers all tools (including get_rsi) onto the FastMCP instance.
for module in ( aggregates, quotes, snapshots, tickers, news, reference, indicators, corporate, financials, ): module.register(mcp, client) - Type aliases used by get_rsi's parameters (Timespan and Series literals) for input validation.
Timespan = Literal["minute", "hour", "day", "week", "month", "quarter", "year"] Series = Literal["open", "high", "low", "close"]