Skip to main content
Glama
Johnhyeon

StockLens

by Johnhyeon

screen_by_flow

Read-onlyIdempotent

Screen top stocks by trade value or volume for those with foreign and institutional net buying over recent days. Filter by market and consecutive buying days to find money-flow leaders.

Instructions

수급스크리닝 — 거래대금/거래량 상위 N개 중 외국인·기관이 최근 며칠 연속 순매수한 종목만 추립니다.

"거래대금 상위 중 외국인·기관 동반 매수", "이틀 연속 수급 들어온 종목" 같은 스크리닝 전용. 랭킹+수급을 서버에서 join해 매치 종목만 반환 → 토큰·시간 절감. 후보는 get_volume_ranking 과 같은 순위입니다 — trade_value 면 시장 전체 거래대금 상위 N개 (대형주 포함), volume 이면 시장 전체 거래량 상위 N개.

Args: top_n: 상위 후보 수 (기본 100, 최대 500). 클수록 정확하나 느림(500≈20~50초) market: "KOSPI"/"KOSDAQ"/"ALL" (기본 ALL) foreign_days: 최근 N일 모두 외국인 순매수여야 매치 (0=미적용) inst_days: 최근 N일 모두 기관 순매수여야 매치 (0=미적용) exclude_etf: ETF/ETN 제외 (기본 True) sort_by: "trade_value"(거래대금, 기본)/"volume"(거래량)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
marketNo
sort_byNo
inst_daysNo
exclude_etfNo
foreign_daysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.1.3
    • removedInput schema / properties / exclude_etf / default
      Removed value: -true
    • removedInput schema / properties / foreign_days / default
      Removed value: -2
    • removedInput schema / properties / inst_days / default
      Removed value: -2
    • removedInput schema / properties / market / default
      Removed value: -"ALL"
    • removedInput schema / properties / sort_by / default
      Removed value: -"trade_value"
    • removedInput schema / properties / top_n / default
      Removed value: -100
  2. Addedv0.5.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations indicate readOnlyHint and idempotentHint, which align with the description's mention of server-side join and filtering (no mutation). The description adds valuable behavioral context: performance trade-off (top_n=500 takes 20-50 seconds), and the filtering logic (consecutive days for foreign/institutional net buying). It doesn't contradict annotations.

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 well-structured: a concise summary, then a 'when to use' line, then parameter definitions. It's front-loaded with the key purpose. Minor redundancy: '랭킹+수급을 서버에서 join' is somewhat technical but serves a purpose. Overall efficient.

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?

The tool has 6 parameters and an output schema, but the description explains all parameter semantics and the core behavior. It doesn't describe the output format, but that's covered by the output schema. It could mention what happens when no matches are found, but the core usage is clear. Given the complexity, it's adequately complete.

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

Parameters5/5

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

The schema has zero description coverage, but the description provides detailed semantics for each parameter: top_n (default 100, max 500, performance impact), market (allowed values), foreign_days and inst_days (meaning of N days, 0 disables), exclude_etf (default True), sort_by (options and defaults). This fully compensates and adds beyond the schema.

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 screens top-N stocks by trade value/volume for consecutive foreign/institutional net buying. It distinguishes itself from get_volume_ranking by noting the server-side join of ranking and flow data, and explicitly mentions it handles phrases like '거래대금 상위 중 외국인·기관 동반 매수'.

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

Usage Guidelines4/5

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

It clearly explains when to use this tool (for screening based on flow and ranking) and mentions that the candidate list is the same as get_volume_ranking. However, it doesn't explicitly state when NOT to use it or name alternatives like get_flow or get_detailed_investor_flow for more granular flow analysis.

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