geo-figure-mcp 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/data.js +6 -1
- package/src/tools.js +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"title": "Geo Figure (지리 시험 지도·그래프)",
|
|
5
5
|
"description": "지리 시험용 지도·그래프를 실제 통계로, 도형 하나하나 고칠 수 있는 PPTX·HWPX로 만든다.",
|
|
6
6
|
"repository": { "url": "https://github.com/skyblue3925-svg/geo-figure-mcp", "source": "github" },
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.5",
|
|
8
8
|
"packages": [
|
|
9
9
|
{
|
|
10
10
|
"registryType": "npm",
|
|
11
11
|
"identifier": "geo-figure-mcp",
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.5",
|
|
13
13
|
"transport": { "type": "stdio" },
|
|
14
14
|
"environmentVariables": [
|
|
15
15
|
{ "name": "GEO_FIGURE_OUT", "description": "만든 파일을 저장할 폴더 (기본: 문서/지리시험자료)", "isRequired": false, "isSecret": false }
|
package/src/data.js
CHANGED
|
@@ -79,11 +79,16 @@ export async function findData({ source, indicators = [], regions = [], year, ye
|
|
|
79
79
|
}
|
|
80
80
|
if (source === 'seoul-daytime') {
|
|
81
81
|
const d = load('seoul-daytime-2020.json');
|
|
82
|
+
const requested = new Set(indicators);
|
|
83
|
+
const unknown = indicators.find((name) => !d.columns.includes(name));
|
|
84
|
+
if (unknown !== undefined) throw new Error(`없는 서울 주간 인구 지표: ${unknown}. 선택 가능: ${d.columns.join(', ')}`);
|
|
85
|
+
const columns = d.columns.map((name, i) => [name, i])
|
|
86
|
+
.filter(([name]) => !requested.size || requested.has(name));
|
|
82
87
|
const pick = regions.length ? regions : Object.keys(d.rows).filter((k) => k !== '서울특별시');
|
|
83
88
|
return { title: '서울 자치구 상주·주간 인구', unit: '명, 지수', cite: SOURCES['seoul-daytime'].cite, year: '2020', rows: pick.map((n) => {
|
|
84
89
|
const v = d.rows[n];
|
|
85
90
|
if (!v) throw new Error(`없는 자치구: ${n}`);
|
|
86
|
-
return { id: n, name: n, values: Object.fromEntries(
|
|
91
|
+
return { id: n, name: n, values: Object.fromEntries(columns.map(([name, i]) => [name, v[i]])) };
|
|
87
92
|
}) };
|
|
88
93
|
}
|
|
89
94
|
if (source === 'kosis') return kosisData(arguments[0].kosis || {});
|
package/src/tools.js
CHANGED
|
@@ -82,7 +82,7 @@ server.tool('list_sources', '쓸 수 있는 통계 자료원과 지표 예시를
|
|
|
82
82
|
|
|
83
83
|
server.tool('find_data', '실제 통계를 찾는다. 결과에 출처(cite)와 연도가 붙는다. 숫자를 지어내지 말고 이 결과만 쓴다.', {
|
|
84
84
|
source: z.enum(remote ? Object.keys(SOURCES).filter((k) => k !== 'kosis') : Object.keys(SOURCES)).describe(remote ? '자료원 (원격 서버에서는 KOSIS 직접 조회를 쓰지 않는다 — 내장 자료 bundle 을 쓴다)' : '자료원'),
|
|
85
|
-
indicators: z.array(z.string()).default([]).describe('지표 코드 또는 열
|
|
85
|
+
indicators: z.array(z.string()).default([]).describe('지표 코드 또는 열 이름. 서울 주간 인구는 예: ["주간인구지수"]. 비우면 서울 지표 전체'),
|
|
86
86
|
regions: z.array(z.string()).default([]).describe('나라 ISO3(KOR, JPN…, 세계=WLD) / 기후: 기출 지점 한글 이름·관측소 영문 이름·"위도,경도" / 서울 자치구 이름'),
|
|
87
87
|
kosis: z.object({ orgId: z.string().optional(), tblId: z.string().optional(), itmId: z.string().optional(), objL1: z.string().optional(), objL2: z.string().optional(), year: z.number().optional() }).passthrough().optional().describe('source 가 kosis 일 때: { orgId, tblId, itmId, objL1:"ALL", objL2, year }'),
|
|
88
88
|
bundle: z.object({ key: z.string(), items: z.array(z.string()).optional(), period: z.coerce.string().optional(), where: z.object({}).passthrough().optional() }).passthrough().optional().describe('source 가 bundle 일 때: { key, items:[항목], period, where:{ C1:"총인구" } }'),
|