data_go_kr_query
Query Korean government open data from data.go.kr for real estate transactions, weather, transportation, demographics, and other public datasets using service IDs and parameters.
Instructions
Query Korean government open data from data.go.kr (공공데이터포털). Covers real estate transactions, weather, transportation, demographics, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service_id | Yes | Public data service ID | |
| params | No | Service-specific query parameters | |
| page | No | Page number (default 1) | |
| per_page | No | Results per page (default 10) |
Implementation Reference
- src/tools/data-go-kr.ts:4-16 (registration)The tool "data_go_kr_query" is defined as a ToolDef object in data-go-kr.ts, specifying its input schema and API endpoint.
export const dataGoKrTools: ToolDef[] = [ { name: "data_go_kr_query", description: "Query Korean government open data from data.go.kr (공공데이터포털). Covers real estate transactions, weather, transportation, demographics, and more.", inputSchema: z.object({ service_id: z.string().describe("Public data service ID"), params: z.record(z.string()).optional().describe("Service-specific query parameters"), page: z.number().optional().describe("Page number (default 1)"), per_page: z.number().optional().describe("Results per page (default 10)"), }), endpoint: "/v1/data-go-kr/query", }, ]; - src/index.ts:14-39 (handler)The tool logic is handled generically in src/index.ts. It registers tools defined in `allTools` and executes them by calling the gatewayRequest function with the tool's configured endpoint.
// Register all tools for (const tool of allTools) { server.tool( tool.name, tool.description, tool.inputSchema.shape, async (params) => { const method = tool.method || "POST"; const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>); if (result.error) { return { content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }], isError: true, }; } const text = typeof result.data === "string" ? result.data : JSON.stringify(result.data, null, 2); return { content: [{ type: "text" as const, text }], }; }, );