Skip to main content
Glama
Tech-curator

Korean Patent MCP

by Tech-curator

kipris_search_patents

Search Korean patents by applicant name using the KIPRIS API. Filter results by status and retrieve detailed patent information in markdown or JSON format.

Instructions

출원인명으로 한국 특허를 검색합니다.

Args:
    applicant_name: 출원인명 (필수, 예: '삼성전자', '카카오뱅크')
    page: 페이지 번호 (기본값: 1)
    page_size: 페이지당 결과 수 (기본값: 20, 최대: 100)
    status: 상태 필터 ('A': 공개, 'R': 등록, 'J': 거절, None: 전체)
    response_format: 응답 형식 ('markdown' 또는 'json')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applicant_nameYes
pageNo
page_sizeNo
statusNo
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler implementation including registration via @mcp.tool decorator, input schema definition through type hints and docstring, client initialization, API call, error handling, and response formatting.
    @mcp.tool(name="kipris_search_patents")
    async def kipris_search_patents(
        applicant_name: str,
        page: int = 1,
        page_size: int = 20,
        status: Optional[str] = None,
        response_format: str = "markdown"
    ) -> str:
        """출원인명으로 한국 특허를 검색합니다.
        
        Args:
            applicant_name: 출원인명 (필수, 예: '삼성전자', '카카오뱅크')
            page: 페이지 번호 (기본값: 1)
            page_size: 페이지당 결과 수 (기본값: 20, 최대: 100)
            status: 상태 필터 ('A': 공개, 'R': 등록, 'J': 거절, None: 전체)
            response_format: 응답 형식 ('markdown' 또는 'json')
        """
        # Get API key from session config or environment
        api_key = get_config_value("kiprisApiKey") or os.getenv("KIPRIS_API_KEY", "")
        if api_key:
            init_client_with_key(api_key)
        
        client = get_kipris_client()
        if client is None:
            error = get_init_error() or "API 클라이언트 초기화 실패. KIPRIS_API_KEY를 설정해주세요."
            return f"❌ 오류: {error}"
        
        try:
            result = await client.search_patents_by_applicant(
                applicant_name=applicant_name,
                page=page,
                page_size=min(page_size, 100),
                status=status or ""
            )
            
            if response_format == "json":
                return json.dumps(result, ensure_ascii=False, indent=2)
            return format_search_result_markdown(result)
        except Exception as e:
            return f"❌ 검색 오류: {str(e)}"
  • Core helper method in KiprisAPIClient that performs the actual KIPRIS API search request, XML parsing, data extraction, and structuring of patent search results.
    async def search_patents_by_applicant(
        self,
        applicant_name: str,
        page: int = 1,
        page_size: int = 20,
        status: str = ""
    ) -> Dict[str, Any]:
        """
        출원인명으로 특허 검색
        
        Args:
            applicant_name: 출원인명 (예: "삼성전자", "충북대학교 산학협력단")
            page: 페이지 번호 (1부터 시작)
            page_size: 페이지당 결과 수 (최대 500)
            status: 상태 필터 (A: 공개, R: 등록, J: 거절, 빈값: 전체)
            
        Returns:
            검색 결과 딕셔너리
        """
        params = {
            "applicant": applicant_name,
            "docsStart": str(page),
            "docsCount": str(min(page_size, 500)),
            "patent": "true",
            "utility": "false",
            "lastvalue": status
        }
        
        root = await self._make_request(
            self.ENDPOINTS["applicant_search"], 
            params
        )
        
        if root is None:
            return {"patents": [], "total_count": 0, "page": page}
        
        # 전체 건수
        total_elem = root.find(".//TotalSearchCount")
        total_count = int(total_elem.text) if (total_elem is not None and total_elem.text) else 0
        
        # 특허 정보 추출
        patents = []
        for item in root.findall(".//PatentUtilityInfo"):
            patent = self._parse_patent_info(item)
            patents.append(patent)
        
        return {
            "patents": patents,
            "total_count": total_count,
            "page": page,
            "page_size": len(patents),
            "has_more": (page * page_size) < total_count,
            "next_page": page + 1 if (page * page_size) < total_count else None
        }
  • Helper function to format the raw search results into a readable Markdown response.
    def format_search_result_markdown(result: dict) -> str:
        lines = []
        lines.append("## 검색 결과")
        lines.append("")
        lines.append(f"총 **{result['total_count']:,}**건 중 {len(result['patents'])}건 표시 (페이지 {result['page']})")
        lines.append("")
        
        if not result['patents']:
            lines.append("검색 결과가 없습니다.")
            return "\n".join(lines)
        
        for i, patent in enumerate(result['patents'], 1):
            lines.append("---")
            lines.append(f"**[{i}]** {patent.get('title', '제목 없음')}")
            lines.append(f"- 출원번호: `{patent.get('application_number', '-')}`")
            lines.append(f"- 출원인: {patent.get('applicant', '-')}")
            lines.append(f"- 상태: {patent.get('registration_status', '-')}")
            lines.append("")
        
        if result.get('has_more'):
            lines.append("---")
            lines.append(f"📄 다음 페이지: `page={result['next_page']}`")
        
        return "\n".join(lines)
  • Global singleton helper to lazily initialize and retrieve the KiprisAPIClient instance.
    def get_kipris_client() -> Optional[KiprisAPIClient]:
        """KIPRIS API 클라이언트 가져오기"""
        global _kipris_client, _init_error
        
        if _kipris_client is None and _init_error is None:
            try:
                config = KiprisConfig.from_env()
                _kipris_client = KiprisAPIClient(config)
            except ValueError as e:
                _init_error = str(e)
        
        return _kipris_client
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination (page, page_size) and response format options, which are useful. However, it lacks critical details like rate limits, authentication needs, error handling, or whether this is a read-only operation. For a search tool with 5 parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by a structured parameter list. Each sentence earns its place by providing essential details. It could be slightly more concise by integrating the parameter explanations more seamlessly, but overall it's efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (5 parameters, 1 required), no annotations, and the presence of an output schema, the description is reasonably complete. It covers all parameters with semantics and examples, and the output schema likely handles return values. However, it lacks behavioral context like rate limits or error cases, which slightly reduces completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains each parameter in Korean with examples (e.g., '삼성전자' for applicant_name), default values, and constraints (e.g., '최대: 100' for page_size). This compensates well for the schema's lack of descriptions, though it doesn't fully clarify the 'status' parameter's enum values beyond the listed codes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '출원인명으로 한국 특허를 검색합니다' (Search Korean patents by applicant name). It specifies the verb ('검색합니다' - search) and resource ('한국 특허' - Korean patents), though it doesn't explicitly differentiate from sibling tools like 'kipris_get_citing_patents' or 'kipris_get_patent_detail' beyond the search focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings. It mentions no alternatives, exclusions, or contextual prerequisites. The only implied usage is for searching patents by applicant name, but this is redundant with the purpose statement and offers no decision-making help.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tech-curator/korean-patent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server