Skip to main content
Glama
Johnhyeon

StockLens

by Johnhyeon

scan_to_excel

Export selected stock data into a single Excel sheet. Choose tickers and fields like price, financials, and sector to build a filtered market overview for analysis.

Instructions

시장스캔 — 원하는 항목만 골라 여러 종목을 Excel 한 장으로 저장.

로컬 캐시 패턴: 한 번 스캔 → 이후 query_excel(파일경로, 조건)로 즉시 반복 필터링.

fields — 넣을 항목을 직접 고른다

값

들어가는 열

추가 조회 비용

price

현재가·거래량

기본 (항상 수집)

chart

기간 최고/최저·낙폭·기간수익률·평균거래량·집계봉수

기본 (항상 수집)

financial

PER·PBR·EPS·BPS·ROE·배당수익률·시가총액·재무기준기간

종목당 1회

flow

기관·외국인 순매매 누적(20일)

30종목당 1회

sector

업종

종목당 1회

indicators

이평배열·RSI·거래량배수

100종목당 1회

생략하면 ["price", "chart", "financial"] 이 들어갑니다(기존과 동일). 필요 없는 항목을 빼면 그만큼 조회가 줄어 빨라집니다.

무엇을 넣을지 사용자와 정하는 법

사용자가 "엑셀로 만들어줘"라고만 하면 바로 기본 세트로 만들지 말고, 무엇에 쓸 파일인지 한 번 물어보세요. 목적에 따라 넣을 항목이 달라집니다.

"어떤 걸 보시려고 하시나요? 아래처럼 목적을 말씀해 주시면 맞춰 담아드릴게요. — 싼 종목 고르기 / 수급 흐름 보기 / 차트 흐름 보기 / 업종 안에서 비교 / 전부"

목적별 추천 구성

사용자가 하려는 일

fields

싸게 거래되는 종목 고르기

["price", "financial", "sector"]

외국인·기관이 사는 종목 보기

["price", "flow"]

많이 빠진 종목 훑기

["price", "chart"]

추세·과열 상태 보기

["price", "chart", "indicators"]

같은 업종끼리 비교

["price", "financial", "sector"]

일단 다 담기 (느림)

["price","chart","financial","flow","sector","indicators"]

이미 사용자가 목적을 밝혔다면 다시 묻지 말고 위 표대로 골라 담으세요. 종목이 30개를 넘으면 항목이 많을수록 눈에 띄게 느려지므로, 그때는 필요한 것만 담고 나중에 더 필요하면 다시 부르는 편이 낫다고 안내하세요.

Args: codes: 종목코드 리스트 (최대 500개) fields: 넣을 항목. 위 표의 값들 중에서 고릅니다. 생략 시 기본 세트. days: 차트 통계 과거 일수 (기본 260 = 52주) include_financial: (구버전 호환) fields 를 안 줬을 때만 적용됩니다. filename: 파일명 (비우면 자동 생성)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
codesYes
fieldsNo
filenameNo
include_financialNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.1.3
    • removedInput schema / properties / days / default
      Removed value: -260
    • removedInput schema / properties / fields / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / fields / default
      Removed value: -null
    • addedInput schema / properties / fields / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / fields / type
      Added value: +"array"
    • removedInput schema / properties / filename / default
      Removed value: -""
    • removedInput schema / properties / include_financial / default
      Removed value: -true
  2. Changed1 schema field changedv1.0.1
    • addedInput schema / properties / fields
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Fields"
      +}
  3. First observedv0.4.0

TDQS

A4.7/5.0
Behavior5/5

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

The description adds substantial behavioral detail beyond the annotations: per-field additional query costs, the default field set, the local cache pattern, and the performance warning for large stock lists. This fully discloses cost and latency behavior, while the annotations are not contradicted.

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 long but well structured with tables and a clear hierarchy from purpose to parameter details. Front-loading the core action and cache pattern helps, though there is slight redundancy between the fields table and the include_financial note.

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

Completeness5/5

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

For a tool with five parametersable to accept up to 500 codes and six optional field categories, the description covers all invocation-relevant aspects: cost trade-offs, defaults, maximums, compatibility behavior, and even user interaction guidance. Since an output schema exists, the description need not explain return values, leaving no major gap.

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?

Schema coverage is 0%, so the description carries the full burden, and it excels: each parameter is explained with constraints, defaults, and allowed values. The fields parameter gets a full table of valid values and their meanings, days has a default of 260, and include_financial is explicitly scoped to when fields is omitted.

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 opens with a specific verb and resource: scan the market and save selected items from multiple stocks into a single Excel sheet. It is clearly distinguishable from many siblings by the local cache pattern and the query_excel follow-up, though it does not explicitly name an alternative tool such as export_to_excel.

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

Usage Guidelines5/5

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

The description gives rich when-to-use guidance: ask the user for their purpose if they only say 'make an Excel', do not ask again if the purpose is already known, and recommend minimal fields when more than 30 stocks are involved. It also provides a purpose-to-fields mapping table, making the selection process explicit.

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