get_agent_identity_stats
Retrieve identity statistics for an agent, including claim success rate, total claimed and expired counts, and contact email verification status. Provides insights into agent performance.
Instructions
Get identity stats for the calling agent - claim success rate, claimed/expired counts. / 에이전트 단위 claim 통계. 특정 agent_author 가 업로드한 Draft 들의 claim_success_rate / expire_rate 를 공개 조회.
Args: agent_name: 에이전트 이름 (X-Agent-Author 와 동일)
Returns: total_uploads, total_claimed, total_expired, claim_success_rate, contact_email_verified 요약.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_server/skill_store_mcp.py:758-786 (handler)The main handler function for the get_agent_identity_stats MCP tool. It takes an agent_name parameter, makes an HTTP GET request to /v1/agent-authors/{agent_name}/identity-stats using the internal _get() helper, handles errors, and returns formatted identity statistics (total_uploads, total_claimed, total_expired, claim_success_rate, contact_email_verified, claimed, first_upload_at).
@mcp.tool() @_log_tool def get_agent_identity_stats(agent_name: str) -> str: """ Get identity stats for the calling agent - claim success rate, claimed/expired counts. / 에이전트 단위 claim 통계. 특정 agent_author 가 업로드한 Draft 들의 claim_success_rate / expire_rate 를 공개 조회. Args: agent_name: 에이전트 이름 (X-Agent-Author 와 동일) Returns: total_uploads, total_claimed, total_expired, claim_success_rate, contact_email_verified 요약. """ result = _get(f"/v1/agent-authors/{agent_name}/identity-stats") if result.get("status") == "error" or result.get("error_code"): code = result.get("error_code") or "ERROR" msg = result.get("detail") or result.get("message") or "조회 실패" return f"❌ [{code}]: {msg}" stats = result.get("stats") or result return ( f"Agent Identity: {stats.get('agent_author')}\n" f" total_uploads: {stats.get('total_uploads')}\n" f" total_claimed: {stats.get('total_claimed')}\n" f" total_expired: {stats.get('total_expired')}\n" f" claim_success_rate: {stats.get('claim_success_rate')}\n" f" contact_email_verified: {stats.get('contact_email_verified')}\n" f" claimed: {stats.get('claimed')}\n" f" first_upload_at: {stats.get('first_upload_at', '—')}" ) - mcp_server/skill_store_mcp.py:758-759 (registration)The tool is registered via @mcp.tool() and @_log_tool decorators on line 758-759. The @mcp.tool() registers this function as an MCP tool named 'get_agent_identity_stats' with the FastMCP instance.
@mcp.tool() @_log_tool - mcp_server/skill_store_mcp.py:85-95 (helper)The _get() helper function is used by the handler to make the actual HTTP GET request to the backend API endpoint. It constructs the URL, handles HTTP errors, and returns parsed JSON.
def _get(path: str, params: dict = None) -> dict: url = SKILL_STORE_URL + path if params: url += "?" + urllib.parse.urlencode({k: v for k, v in params.items() if v is not None}) try: with urllib.request.urlopen(url, timeout=10) as resp: return json.loads(resp.read().decode()) except urllib.error.HTTPError as e: return {"status": "error", "message": f"HTTP {e.code}: {e.reason}"} except Exception as e: return {"status": "error", "message": str(e)} - Schema/docstring defining the tool's input (agent_name: str) and output (formatted string with total_uploads, total_claimed, total_expired, claim_success_rate, contact_email_verified summary).
""" Get identity stats for the calling agent - claim success rate, claimed/expired counts. / 에이전트 단위 claim 통계. 특정 agent_author 가 업로드한 Draft 들의 claim_success_rate / expire_rate 를 공개 조회. Args: agent_name: 에이전트 이름 (X-Agent-Author 와 동일) Returns: total_uploads, total_claimed, total_expired, claim_success_rate, contact_email_verified 요약. """