Skip to main content
Glama
rubatoyd

io.github.rubatoyd/kosis-openapi-mcp

by rubatoyd

kosis_data

Read-only

Fetches statistical values from KOSIS tables by automatically matching classification axis count and splitting time periods to retrieve full data even beyond 40,000 cells.

Instructions

통계표의 수치를 받는다.

🔴 분류축이 여럿인 표(예: 산업 × 규모)도 그냥 부르면 된다. KOSIS 는 요청의 분류축 개수가 표의 축 개수와 정확히 맞기를 요구하는데(모자라면 err 20 (objL), 넘치면 err 21) 축 개수를 알려 주는 메타가 없다. 그래서 이 도구가 축을 하나씩 늘려 가며 맞춘다 — 결과의 meta.obj_levels 에 확정된 축이 실린다.

Args: org_id: 기관 ID(예: '101'). tbl_id: 통계표 ID(예: 'DT_1B040A3'). prd_se: 수록주기 — Y(년)·H(반기)·Q(분기)·M(월)·D(일). kosis_meta(kind='PRD') 로 확인. start, end: 시점 범위(예: '202101''202512'). 🔴 이 방식이면 4만 셀을 넘어도 자동으로 기간을 쪼개 전수를 받는다. recent: 최근 N개 시점. start/end 대신 쓴다(이 방식은 자동 분할이 안 된다). obj_l1: 분류1 — 'ALL' 전체, '11' 특정, '11*' 하위 전체, '11+21' 여럿. obj_l2 ~ obj_l8: 분류28. 비워 두면 필요한 만큼 'ALL' 로 자동으로 채운다. 4만 셀(err 31)에 걸릴 때 특정 코드로 좁히는 자리이기도 하다. items: 항목 — 'ALL' 또는 항목 ID(kosis_meta(kind='ITM')). max_rows: 돌려줄 최대 행 수(파일로 받으려면 kosis_collect).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
itemsNoALL
startNo
obj_l1NoALL
obj_l2No
obj_l3No
obj_l4No
obj_l5No
obj_l6No
obj_l7No
obj_l8No
org_idYes
prd_seYes
recentNo
tbl_idYes
max_rowsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / obj_l2
      Added value: +{
      +  "default": "",
      +  "title": "Obj L2",
      +  "type": "string"
      +}
    • addedInput schema / properties / obj_l3
      Added value: +{
      +  "default": "",
      +  "title": "Obj L3",
      +  "type": "string"
      +}
    • addedInput schema / properties / obj_l4
      Added value: +{
      +  "default": "",
      +  "title": "Obj L4",
      +  "type": "string"
      +}
    • addedInput schema / properties / obj_l5
      Added value: +{
      +  "default": "",
      +  "title": "Obj L5",
      +  "type": "string"
      +}
    • addedInput schema / properties / obj_l6
      Added value: +{
      +  "default": "",
      +  "title": "Obj L6",
      +  "type": "string"
      +}
    • addedInput schema / properties / obj_l7
      Added value: +{
      +  "default": "",
      +  "title": "Obj L7",
      +  "type": "string"
      +}
    • addedInput schema / properties / obj_l8
      Added value: +{
      +  "default": "",
      +  "title": "Obj L8",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

The description richly discloses behaviors beyond annotations: it explains automatic axis-count matching (with error codes 20/21), automatic period splitting for >40,000 cells, auto-filling of obj_l2-8 with 'ALL', and the presence of meta.obj_levels in the result. It also notes the 40,000-cell limit (err 31). These are valuable behavioral traits not covered by the readOnlyHint/openWorldHint annotations.

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 well-structured: a one-line summary, a highlighted note about classification axes, then a bulleted Args list. Key behaviors are front-loaded with red emojis to draw attention. Every sentence adds value—no fluff or repetition. It is detailed but efficiently organized.

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?

Given the complexity (16 params, no output schema, no enums), the description is remarkably complete. It covers error conditions, parameter relationships, alternatives, and behavioral nuances. It mentions the result's meta.obj_levels, which gives insight into the return structure. An agent can reliably call this tool correctly without additional documentation.

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?

With 0% schema description coverage, the description fully compensates by documenting all 16 parameters. It explains each parameter's purpose, format (e.g., '101' for org_id, 'DT_1B040A3' for tbl_id), valid values (Y/H/Q/M/D for prd_se), and special behaviors (wildcards like '11*', multiple codes '11+21', and auto-fill logic). This is exceptional given the schema provides no help.

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 opens with a clear, specific verb and resource: 'Gets the numbers of a statistical table.' This unambiguously states the tool's purpose and inherently distinguishes it from siblings like kosis_meta (metadata) and kosis_search. It is not a tautology and adds concrete scope.

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?

The description provides explicit alternatives: it directs users to kosis_collect for file retrieval and to kosis_meta for validating prd_se and items. It also explains when to use start/end vs recent and the auto-fill behavior for obj_l2-8. However, it does not explicitly contrast with kosis_indicator_data, a sibling that might overlap, so it stops short of a perfect 5.

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