Skip to main content
Glama
migusdn

KIS REST API MCP Server

inquery-stock-ask

Retrieve the ask price for Korean stocks using the KIS REST API MCP Server to check current selling prices for informed trading decisions.

Instructions

Get stock ask price from Korea Investment & Securities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Implementation Reference

  • The main execution logic for the 'inquery-stock-ask' tool, which queries the Korea Investment & Securities API for stock ask prices using the provided symbol.
    async def inquery_stock_ask(symbol: str):
        """
        Get stock ask price from Korea Investment & Securities
        
        Args:
            symbol: Stock symbol (e.g. "005930")
            
        Returns:
            Dictionary containing stock ask price information
        """
        async with httpx.AsyncClient() as client:
            token = await get_access_token(client)
            
            # Prepare request data
            request_data = {
                "FID_COND_MRKT_DIV_CODE": "J",  # 시장구분
                "FID_INPUT_ISCD": symbol,  # 종목코드
            }
            
            response = await client.get(
                f"{TrIdManager.get_domain('stock_ask')}{STOCK_ASK_PATH}",
                headers={
                    "content-type": CONTENT_TYPE,
                    "authorization": f"{AUTH_TYPE} {token}",
                    "appkey": os.environ["KIS_APP_KEY"],
                    "appsecret": os.environ["KIS_APP_SECRET"],
                    "tr_id": TrIdManager.get_tr_id("stock_ask")
                },
                params=request_data
            )
            
            if response.status_code != 200:
                raise Exception(f"Failed to get stock ask: {response.text}")
            
            return response.json()
  • server.py:605-608 (registration)
    Registers the 'inquery-stock-ask' tool with the MCP server using the @mcp.tool decorator.
    @mcp.tool(
        name="inquery-stock-ask",
        description="Get stock ask price from Korea Investment & Securities",
    )
  • Docstring providing input schema (symbol: str) and output description for the tool.
    """
    Get stock ask price from Korea Investment & Securities
    
    Args:
        symbol: Stock symbol (e.g. "005930")
        
    Returns:
        Dictionary containing stock ask price information
    """
  • API endpoint path constant used by the stock ask tool.
    STOCK_ASK_PATH = "/uapi/domestic-stock/v1/quotations/inquire-asking-price-exp-ccn"  # 주식호가조회
  • Transaction ID (TR_ID) for stock ask price inquiry in real account, defined in TrIdManager.
    "stock_ask": "FHKST01010200",  # 주식호가조회
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves ask prices but doesn't mention whether this is a read-only operation, requires authentication, has rate limits, returns real-time or delayed data, or handles errors. For a financial data tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of financial data queries, no annotations, no output schema, and incomplete parameter documentation, the description is inadequate. It doesn't explain what the ask price represents, the data format returned, or how it differs from related tools, leaving too many gaps for effective agent use.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the tool description provides no information about the 'symbol' parameter. It doesn't specify the expected format (e.g., ticker symbols for Korean stocks), examples, or constraints, failing to compensate for the lack of schema documentation.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('stock ask price') with specific source ('Korea Investment & Securities'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'inquery-stock-price' or 'inquery-overseas-stock-price', which likely provide similar price information but for different markets or price types.

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. With siblings like 'inquery-stock-price' and 'inquery-overseas-stock-price' available, there's no indication of whether this tool is for Korean stocks specifically, real-time vs. historical data, or ask price vs. other price types, leaving usage context unclear.

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/migusdn/KIS_MCP_Server'

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