velocity
Identify which news concepts experienced the sharpest tone shifts between the last 48 hours and the most recent 24 hours, revealing where narratives are turning.
Instructions
Concepts whose tone distribution shifted the most sharply between the prior 48h and the most recent 24h. Useful for 'where is the narrative turning?' questions. Ranked by shape-normalized L2 distance, so a uniform volume rise doesn't count as a shift.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/overtone_news_mcp/server.py:152-161 (handler)The velocity MCP tool function. Accepts a limit parameter (1-100, default 10) and delegates to the _post helper with the 'velocity' API endpoint.
@mcp.tool() def velocity( limit: Annotated[int, Field(ge=1, le=100)] = 10, ) -> dict[str, Any]: """Concepts whose tone distribution shifted the most sharply between the prior 48h and the most recent 24h. Useful for 'where is the narrative turning?' questions. Ranked by shape-normalized L2 distance, so a uniform volume rise doesn't count as a shift.""" return _post("velocity", {"limit": limit}) - src/overtone_news_mcp/server.py:152-152 (registration)Registration of the velocity function as an MCP tool via the @mcp.tool() decorator on the FastMCP instance.
@mcp.tool() - The _post helper function that velocity() calls. Sends an HTTP POST to the Overtone API with the X-API-Key header and JSON body, returning the parsed response.
def _post(path: str, body: dict[str, Any]) -> dict[str, Any]: with httpx.Client(timeout=HTTP_TIMEOUT) as client: resp = client.post( f"{API_URL}/{path}", headers={"X-API-Key": _load_api_key()}, json=body, ) resp.raise_for_status() return resp.json() - Input schema for the velocity tool: a single integer 'limit' parameter constrained between 1 and 100, defaulting to 10.
limit: Annotated[int, Field(ge=1, le=100)] = 10, ) -> dict[str, Any]: