Skip to main content
Glama

get_orderbook

Fetch current order book data for financial instruments to analyze market depth and liquidity. This tool provides institutional-grade quantitative finance capabilities for trading strategy development.

Instructions

Fetches the current order book. 
NOTE: yfinance does not provide Level 2 data. This is a placeholder to demonstrate tool registration.

Args:
    symbol: The ticker symbol.
    
Returns:
    Message indicating unavailability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that implements the get_orderbook tool. It serves as a placeholder since yfinance does not provide Level 2 order book data.
    def get_orderbook(symbol: str) -> str:
        """
        Fetches the current order book. 
        NOTE: yfinance does not provide Level 2 data. This is a placeholder to demonstrate tool registration.
        
        Args:
            symbol: The ticker symbol.
            
        Returns:
            Message indicating unavailability.
        """
        return f"Order book data (Level 2) is not available via free API for {symbol}."
  • server.py:370-373 (registration)
    Registration of the get_orderbook tool (with other market data tools) in the main MCP server using the register_tools helper.
    register_tools(
        [get_price, get_fundamentals, get_orderbook],
        "Market Data"
    )
  • app.py:286-286 (registration)
    Inclusion of get_orderbook in the tools_map dictionary used for organizing tools in the Gradio UI interface, which also supports MCP.
    "Market Data": [get_price, get_fundamentals, get_orderbook],
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: it's a read operation ('fetches'), it has limitations ('does not provide Level 2 data'), and it's essentially non-functional ('placeholder', 'returns message indicating unavailability'). This gives the agent important context about what to expect.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the core purpose. The note about limitations is important context. The Args/Returns sections are structured but could be more integrated with the main description.

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 an output schema (though not shown here), the description doesn't need to detail return values. It adequately explains the tool's purpose, limitations, and parameters for a simple placeholder tool. The completeness is reasonable for this context.

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

Parameters3/5

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

Schema description coverage is 0%, but the description adds the meaning of the single parameter: 'symbol: The ticker symbol.' This compensates somewhat for the schema gap. However, it doesn't provide format examples or constraints beyond what's obvious from the parameter name.

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

Purpose3/5

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

The description states 'Fetches the current order book' which is a clear verb+resource combination, but it doesn't distinguish this from potential sibling tools like 'get_price' or 'get_crypto_market_data'. The purpose is understandable but lacks differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. While it mentions that 'yfinance does not provide Level 2 data' and calls it a 'placeholder', this doesn't help an agent decide when to invoke it versus other data-fetching tools in the sibling list.

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/N-lia/MonteWalk'

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