Skip to main content
Glama
the0807

geeknews-mcp-server

get_weekly_news

Fetch weekly tech news from GeekNews by specifying a weekly ID or retrieving the most recent edition.

Instructions

        GeekNews에서 주간 뉴스를 가져오는 도구
        
        Args:
            weekly_id: 주간 뉴스 ID (빈 문자열인 경우 가장 최근 주간 뉴스를 가져옴)
            
        Returns:
            Dict[str, Any]: 주간 뉴스 정보
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
weekly_idNo

Implementation Reference

  • Core handler function implementing the get_weekly_news tool logic: checks cache validity, loads from cache if valid, otherwise refreshes via scheduler, handles errors.
    def _get_weekly_news(self, weekly_id: str = "") -> Dict[str, Any]:
        """
        GeekNews에서 주간 뉴스를 가져옵니다.
        
        Args:
            weekly_id: 주간 뉴스 ID (빈 문자열인 경우 가장 최근 주간 뉴스를 가져옴)
            
        Returns:
            Dict[str, Any]: 주간 뉴스 정보
        """
        cache_id = weekly_id if weekly_id else "latest"
        
        try:
            # 캐시에서 데이터 로드 시도
            is_valid, cached_data = self.cache_manager.get_weekly_news_cache(cache_id)
            
            if is_valid and cached_data:
                logger.info(f"주간 뉴스 캐시 사용 (ID: {cache_id})")
                return cached_data
            
            # 캐시가 없거나 유효하지 않은 경우 데이터 갱신
            logger.info(f"주간 뉴스 데이터 갱신 (ID: {cache_id})")
            return self.scheduler.refresh_weekly_news(weekly_id)
        except Exception as e:
            logger.error(f"주간 뉴스 가져오기 실패: {e}", exc_info=True)
            return {
                "title": "GeekNews Weekly",
                "number": 0,
                "id": weekly_id if weekly_id else "",
                "content": "주간 뉴스를 가져오는 중 오류가 발생했습니다.",
                "url": f"{self.client.base_url}/weekly" + (f"/{weekly_id}" if weekly_id else ""),
                "items": []
            }
  • src/server.py:91-102 (registration)
    Registers the get_weekly_news tool with MCP server using @mcp.tool() decorator, defines input schema via args and docstring.
    @self.mcp.tool()
    def get_weekly_news(weekly_id: str = "") -> Dict[str, Any]:
        """
        GeekNews에서 주간 뉴스를 가져오는 도구
        
        Args:
            weekly_id: 주간 뉴스 ID (빈 문자열인 경우 가장 최근 주간 뉴스를 가져옴)
            
        Returns:
            Dict[str, Any]: 주간 뉴스 정보
        """
        return self._get_weekly_news(weekly_id)
  • Tool function signature and docstring defining input (weekly_id: str) and output schema.
    def get_weekly_news(weekly_id: str = "") -> Dict[str, Any]:
        """
        GeekNews에서 주간 뉴스를 가져오는 도구
        
        Args:
            weekly_id: 주간 뉴스 ID (빈 문자열인 경우 가장 최근 주간 뉴스를 가져옴)
            
        Returns:
            Dict[str, Any]: 주간 뉴스 정보
        """
        return self._get_weekly_news(weekly_id)
  • Helper function to load and validate weekly news cache data.
    def get_weekly_news_cache(self, weekly_id: str = "latest") -> Tuple[bool, Dict[str, Any]]:
        """
        주간 뉴스 캐시를 로드합니다.
        
        Args:
            weekly_id: 주간 뉴스 ID (빈 문자열인 경우 "latest" 사용)
            
        Returns:
            Tuple[bool, Dict[str, Any]]: (캐시 유효 여부, 주간 뉴스 정보)
        """
        cache_key = f"weekly_{weekly_id if weekly_id else 'latest'}"
        return self.load_cache(cache_key)
  • Dataclass defining the structure of WeeklyNews output.
    @dataclass
    class WeeklyNews:
        """
        GeekNews 주간 뉴스 클래스
        
        주간 뉴스의 제목, 번호, ID, 내용, URL 등의 정보를 저장합니다.
        """
        title: str
        number: int
        id: str
        content: str
        url: str
        items: List[Dict[str, Any]]
        
        def to_dict(self) -> Dict[str, Any]:
            """
            주간 뉴스를 딕셔너리로 변환
            
            Returns:
                Dict[str, Any]: 주간 뉴스 정보를 담은 딕셔너리
            """
            return asdict(self)
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 states the tool fetches weekly news but doesn't describe what '가져오는' entails (e.g., read-only operation, data format, potential errors, or rate limits). For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and safety profile.

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, with the core purpose stated first in a single sentence. The Args and Returns sections are structured clearly, though the inclusion of type hints like 'Dict[str, Any]' adds minor verbosity without schema support. Overall, it's efficient with minimal waste.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers the parameter semantics well but lacks behavioral details and usage guidelines relative to the sibling tool. Without annotations or output schema, more context on what the tool returns or how it behaves would improve 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 meaningful semantics beyond the input schema, which has 0% coverage. It explains that 'weekly_id' is a weekly news ID and specifies that an empty string fetches the most recent weekly news, clarifying the parameter's purpose and default behavior. This compensates well for the lack of schema documentation.

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: 'GeekNews에서 주간 뉴스를 가져오는 도구' (Get weekly news from GeekNews). It specifies the verb '가져오는' (get/fetch) and the resource '주간 뉴스' (weekly news). However, it doesn't explicitly differentiate from the sibling tool 'get_articles', which might also retrieve news content, leaving some ambiguity about when to use each.

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 alternatives like 'get_articles'. It mentions that an empty weekly_id fetches the most recent weekly news, which is a usage hint, but lacks explicit context, prerequisites, or exclusions for tool selection.

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/the0807/GeekNews-MCP-Server'

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