download_skill
Download a skill package for your AI platform. Specify skill ID and platform to get an auto-converted package ready for use.
Instructions
Download a skill package. Specify 'platform' to get an auto-converted package for that platform (ClaudeCode, Cursor, CodexCLI, GeminiCLI, etc.). / 스킬 패키지 다운로드 (플랫폼별 자동 변환).
Args: skill_id: 다운로드할 스킬 ID platform: 플랫폼 (OpenClaw, ClaudeCode, ClaudeCodeAgentSkill, CustomAgent, Cursor, GeminiCLI, CodexCLI). 비워두면 원본(.skill) 다운로드. save_dir: 저장 디렉터리 경로 (비워두면 임시 디렉터리에 저장)
Returns: 저장된 파일 경로 또는 오류 메시지
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skill_id | Yes | ||
| platform | No | ||
| save_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_server/skill_store_mcp.py:337-337 (registration)The @mcp.tool() decorator registers download_skill as an MCP tool.
@mcp.tool() - mcp_server/skill_store_mcp.py:337-386 (handler)The download_skill function: downloads a skill package from SKILL_STORE_URL, optionally converting for a specific platform. Saves to a specified or temp directory. Returns the save path or error message.
@mcp.tool() @_log_tool def download_skill(skill_id: str, platform: str = "", save_dir: str = "") -> str: """ Download a skill package. Specify 'platform' to get an auto-converted package for that platform (ClaudeCode, Cursor, CodexCLI, GeminiCLI, etc.). / 스킬 패키지 다운로드 (플랫폼별 자동 변환). Args: skill_id: 다운로드할 스킬 ID platform: 플랫폼 (OpenClaw, ClaudeCode, ClaudeCodeAgentSkill, CustomAgent, Cursor, GeminiCLI, CodexCLI). 비워두면 원본(.skill) 다운로드. save_dir: 저장 디렉터리 경로 (비워두면 임시 디렉터리에 저장) Returns: 저장된 파일 경로 또는 오류 메시지 """ url = f"{SKILL_STORE_URL}/v1/agent/skills/{skill_id}/download" if platform: url += f"?platform={urllib.parse.quote(platform)}" try: req = urllib.request.Request(url) with urllib.request.urlopen(req, timeout=30) as resp: content_disposition = resp.headers.get("Content-Disposition", "") filename = f"{skill_id}.skill" if "filename=" in content_disposition: filename = content_disposition.split("filename=")[-1].strip().strip('"') fallback = resp.headers.get("X-Fallback-Platform", "") target_dir = save_dir if save_dir else tempfile.mkdtemp(prefix="skill_store_") os.makedirs(target_dir, exist_ok=True) save_path = os.path.join(target_dir, filename) with open(save_path, "wb") as f: f.write(resp.read()) msg = f"✅ 다운로드 완료: {save_path}" if platform: msg += f"\n 플랫폼: {platform}" if fallback: msg += f"\n ⚠️ 요청한 플랫폼 변환 불가 → {fallback} 형식으로 대체 제공됨" return msg except urllib.error.HTTPError as e: body = "" try: body = e.read().decode() body = json.loads(body).get("message", body) except Exception: pass return f"❌ 다운로드 실패: HTTP {e.code} — {body or e.reason}" except Exception as e: return f"❌ 오류: {str(e)}" - Function signature and docstring define the schema: skill_id (str, required), platform (str, optional default ''), save_dir (str, optional default '').
def download_skill(skill_id: str, platform: str = "", save_dir: str = "") -> str: """ Download a skill package. Specify 'platform' to get an auto-converted package for that platform (ClaudeCode, Cursor, CodexCLI, GeminiCLI, etc.). / 스킬 패키지 다운로드 (플랫폼별 자동 변환). Args: skill_id: 다운로드할 스킬 ID platform: 플랫폼 (OpenClaw, ClaudeCode, ClaudeCodeAgentSkill, CustomAgent, Cursor, GeminiCLI, CodexCLI). 비워두면 원본(.skill) 다운로드. save_dir: 저장 디렉터리 경로 (비워두면 임시 디렉터리에 저장) Returns: 저장된 파일 경로 또는 오류 메시지 """ - mcp_server/skill_store_mcp.py:337-337 (registration)The @_log_tool decorator wraps the function for logging on each call.
@mcp.tool() - mcp_server/skill_store_mcp.py:33-45 (helper)The _log_tool helper decorator that logs tool calls to stdout.
def _log_tool(fn): """각 MCP tool 호출을 stdout 에 한 줄 기록 — journalctl 에서 grep 가능. 형식: TOOL_CALL tool=<name> kw=<arg_keys> (PII 회피 위해 값은 로그 X) """ @_functools_tool.wraps(fn) def _wrapper(*args, **kwargs): try: kw_keys = list(kwargs.keys()) print(f"TOOL_CALL tool={fn.__name__} kw={kw_keys}", flush=True) except Exception: pass return fn(*args, **kwargs) return _wrapper