clear_cache
Clear cached data to ensure access to current information from the Independence Activist Merits Record MCP server.
Instructions
캐시된 데이터를 모두 초기화합니다
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "clear_cache"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gonghun_mcp/tools.py:335-346 (handler)Handler logic for the clear_cache tool in the call_tool dispatcher. Clears the cache via cache_manager and returns a success response.
elif name == "clear_cache": # 캐시 초기화 cache_manager.clear() return [ TextContent( type="text", text=format_response({ "success": True, "message": "캐시가 성공적으로 초기화되었습니다." }) ) ] - src/gonghun_mcp/tools.py:197-204 (schema)Schema definition for the clear_cache tool: no input parameters required.
Tool( name="clear_cache", description="캐시된 데이터를 모두 초기화합니다", inputSchema={ "type": "object", "properties": {} } ) - src/gonghun_mcp/tools.py:17-229 (registration)Registration of all tools including clear_cache via the @app.list_tools() decorator.
@app.list_tools() async def list_tools() -> List[Tool]: """ 사용 가능한 독립유공자 공훈록 관련 도구들을 나열합니다. Returns: 도구 목록 """ try: return [ Tool( name="get_merit_list", description="독립유공자 공훈록 목록을 조회합니다", inputSchema={ "type": "object", "properties": { "page_index": { "type": "integer", "description": "페이지 번호", "default": 1 }, "count_per_page": { "type": "integer", "description": "페이지 당 데이터 건수 (최대 50건)", "default": 10, "maximum": 50 }, "mng_no": { "type": "string", "description": "관리번호" }, "name_ko": { "type": "string", "description": "성명(한글)" }, "name_ch": { "type": "string", "description": "성명(한자)" }, "diff_name": { "type": "string", "description": "이명" }, "birthday": { "type": "string", "description": "생년월일 (YYYYMMDD, 년(1945), 년월(194501), 년월일(19450101))" }, "lastday": { "type": "string", "description": "사망년월일 (YYYYMMDD, 년(1945), 년월(194501), 년월일(19450101))" }, "sex": { "type": "string", "description": "성별 (0: 여, 1: 남)", "enum": ["0", "1"] }, "register_large_div": { "type": "string", "description": "본적대분류" }, "register_mid_div": { "type": "string", "description": "본적중분류" }, "judge_year": { "type": "string", "description": "포상년도" }, "hunkuk": { "type": "string", "description": "훈격", "enum": list(HUNKUK_CODES.keys()) }, "workout_affil": { "type": "string", "description": "운동계열", "enum": list(WORKOUT_AFFIL_CODES.keys()) }, "achivement": { "type": "string", "description": "공훈록" } } } ), Tool( name="get_public_report", description="독립유공자 공적조서를 조회합니다", inputSchema={ "type": "object", "properties": { "page_index": { "type": "integer", "description": "페이지 번호", "default": 1 }, "count_per_page": { "type": "integer", "description": "페이지 당 데이터 건수 (최대 50건)", "default": 10, "maximum": 50 }, "mng_no": { "type": "string", "description": "관리번호" }, "name_ko": { "type": "string", "description": "성명(한글)" }, "name_ch": { "type": "string", "description": "성명(한자)" }, "diff_name": { "type": "string", "description": "이명" }, "birthday": { "type": "string", "description": "생년월일 (YYYYMMDD, 년(1945), 년월(194501), 년월일(19450101))" }, "lastday": { "type": "string", "description": "사망년월일 (YYYYMMDD, 년(1945), 년월(194501), 년월일(19450101))" }, "sex": { "type": "string", "description": "성별 (0: 여, 1: 남)", "enum": ["0", "1"] }, "register_large_div": { "type": "string", "description": "본적대분류" }, "register_mid_div": { "type": "string", "description": "본적중분류" }, "judge_year": { "type": "string", "description": "포상년도" }, "hunkuk": { "type": "string", "description": "훈격", "enum": list(HUNKUK_CODES.keys()) }, "workout_affil": { "type": "string", "description": "운동계열", "enum": list(WORKOUT_AFFIL_CODES.keys()) }, "achivement": { "type": "string", "description": "공적개요" }, "achivement_ko": { "type": "string", "description": "공적개요 국한문병기" } } } ), Tool( name="get_hunkuk_codes", description="훈격 코드 정보를 조회합니다", inputSchema={ "type": "object", "properties": {} } ), Tool( name="get_workout_affil_codes", description="운동계열 코드 정보를 조회합니다", inputSchema={ "type": "object", "properties": {} } ), Tool( name="clear_cache", description="캐시된 데이터를 모두 초기화합니다", inputSchema={ "type": "object", "properties": {} } ) ] except Exception as e: logger.error(f"도구 목록 생성 중 오류 발생: {str(e)}") # 최소한의 기본 도구라도 반환 return [ Tool( name="get_merit_list", description="독립유공자 공훈록 목록을 조회합니다", inputSchema={ "type": "object", "properties": { "page_index": { "type": "integer", "description": "페이지 번호", "default": 1 }, "count_per_page": { "type": "integer", "description": "페이지 당 데이터 건수 (최대 50건)", "default": 10 } } } ) ] - src/gonghun_mcp/cache.py:55-59 (helper)CacheManager.clear() method that implements the actual cache clearing logic used by the tool handler.
def clear(self) -> None: """모든 캐시를 초기화합니다.""" self.last_cache_time.clear() self.cache_data.clear() logger.info("캐시가 초기화되었습니다.")