Skip to main content
Glama
horustechltd

horus-flow-mcp

by horustechltd

get_macro_blocks

Analyze US equity market macro trends and track recent institutional block trades over $200K to monitor where large money is flowing.

Instructions

Get US equity market macro trend and recent institutional block trades.

Returns SPY macro climate (market mode, buy ratio) and list of recent
block trades over $200K with symbol, direction, and size.
Use this to understand where institutional money is flowing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_macro_blocks' tool. It fetches macro block trade data from the /v1/flow/equity/macro-blocks endpoint, parses the SPY macro climate and recent block trades, and formats a human-readable summary string with emoji indicators.
    async def get_macro_blocks() -> str:
        """Get US equity market macro trend and recent institutional block trades.
        
        Returns SPY macro climate (market mode, buy ratio) and list of recent
        block trades over $200K with symbol, direction, and size.
        Use this to understand where institutional money is flowing.
        """
        data = await _fetch("/v1/flow/equity/macro-blocks")
        if data.get("error"):
            return json.dumps(data, indent=2)
        
        climate = data.get("spy_macro_climate", {})
        blocks = data.get("recent_block_trades", [])
        
        result = f"🦅 SPY MACRO CLIMATE: {climate.get('market_mode')} (Buy Ratio: {climate.get('spy_buy_ratio')})\n\n"
        result += f"🐋 RECENT BLOCK TRADES (>200k) (Total: {data.get('block_count')}):\n"
        
        if not blocks:
            result += "- None in the last 5 minutes.\n"
        else:
            for b in blocks:
                action = "SELL 🔴" if b["is_sell"] else "BUY 🟢"
                result += f"- {b['symbol']} | {action} | ${b['notional']:,.2f} | {b['seconds_ago']}s ago\n"
                
        return result
  • The tool is registered via the @mcp.tool() decorator from FastMCP, which automatically registers 'get_macro_blocks' as an MCP tool.
    @mcp.tool()
  • The docstring serves as the schema/description for the tool. It has no parameters (empty signature) and returns a formatted string with SPY macro climate and block trade info.
    """Get US equity market macro trend and recent institutional block trades.
    
    Returns SPY macro climate (market mode, buy ratio) and list of recent
    block trades over $200K with symbol, direction, and size.
    Use this to understand where institutional money is flowing.
    """
  • The _fetch helper function is used by get_macro_blocks to make HTTP requests to the RapidAPI endpoint, handling auth errors, rate limiting, and network issues.
    async def _fetch(endpoint: str) -> dict:
        """Fetch data from the live RapidAPI endpoint."""
        async with httpx.AsyncClient(timeout=10.0) as client:
            try:
                resp = await client.get(
                    f"{RAPIDAPI_BASE_URL}{endpoint}",
                    headers=HEADERS,
                )
                if resp.status_code == 200:
                    return resp.json()
                elif resp.status_code in [401, 403]:
                    return {
                        "error": True,
                        "signal": "UNAUTHORIZED",
                        "detail": "Invalid or missing RAPIDAPI_KEY. Please verify your RapidAPI subscription."
                    }
                elif resp.status_code == 429:
                    return {
                        "error": True,
                        "signal": "RATE_LIMITED",
                        "detail": "You have exceeded your RapidAPI quota. Please upgrade your plan."
                    }
                return {
                    "error": True,
                    "status_code": resp.status_code,
                    "detail": resp.text,
                }
            except Exception as e:
                return {
                    "error": True,
                    "detail": f"Network Error: {str(e)}"
                }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavioral traits. It states the tool returns macro climate and block trades, implying a read operation. However, it lacks details on data recency, update frequency, or any limitations, which would be helpful for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences with no wasted words. It front-loads the purpose, details the output, and provides a use case, making it highly efficient for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters and an output schema exists, the description adequately covers the output structure and threshold. It could mention whether data is historical or real-time, but overall it is complete for agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so the baseline is 4. The description does not need to explain parameters, and it does not add any parameter info, which is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves US equity market macro trend and institutional block trades. It specifies the output includes SPY macro climate (market mode, buy ratio) and block trades with details. This sets it apart from sibling tools like get_equity_flow and get_market_climate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description suggests using the tool 'to understand where institutional money is flowing', providing a use case. However, it does not explicitly mention when not to use it or compare it with alternative tools among the siblings, leaving some ambiguity for an AI agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/horustechltd/horus-flow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server