Skip to main content
Glama
Leonamin

Naver Mail MCP Server

by Leonamin

list_mails_paginated

Retrieve paginated email lists from Naver Mail accounts with configurable page size and output format for efficient mail management.

Instructions

페이징을 지원하는 메일 목록 조회

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_sizeNo한 페이지당 메일 개수
last_uidNo이전 페이지의 마지막 UID (다음 페이지 요청시 사용)
formatNo출력 형태 (json: JSON 형태, text: 읽기 쉬운 텍스트(내용은 없음))text

Implementation Reference

  • The core logic for paginated mail retrieval using UID-based filtering and mailbox fetching.
    def get_mails_paginated(self, page_size: int = 10, last_uid: str = None) -> dict:
        """
        UID 기반 페이징으로 메일을 가져옵니다.
    
        Args:
            page_size: 한 페이지당 메일 개수
            last_uid: 이전 페이지의 마지막 UID (다음 페이지를 가져올 때 사용)
    
        Returns:
            {
                'mails': list[MailMessage],
                'last_uid': str,  # 다음 페이지 요청시 사용할 UID
                'has_more': bool  # 다음 페이지가 있는지
            }
        """
        with self._get_mailbox_client() as mailbox:
            # 검색 조건 설정
            if last_uid:
                # 특정 UID보다 작은 메일들만 가져오기 (reverse=True이므로)
                criteria = AND(uid=f"1:{last_uid}")
                # UID로 정렬하여 last_uid보다 작은 것들 중에서 최신순으로
                mails = list(mailbox.fetch(
                    criteria=criteria,
                    limit=page_size + 1,  # +1로 다음 페이지 존재 여부 확인
                    reverse=True
                ))
                # last_uid는 제외
                mails = [mail for mail in mails if mail.uid != last_uid]
            else:
                # 첫 페이지
                mails = list(mailbox.fetch(
                    limit=page_size + 1,
                    reverse=True
                ))
    
            # 다음 페이지 존재 여부 확인
            has_more = len(mails) > page_size
            if has_more:
                mails = mails[:page_size]
  • server.py:319-343 (registration)
    The MCP tool handler in server.py that invokes the mail_service's paginated retrieval and formats the response.
    elif name == "list_mails_paginated":
        page_size = args.get("page_size", 10)
        last_uid = args.get("last_uid")
        output_format = args.get("format", "text")
    
        result = mail_service.get_mails_paginated(
            page_size=page_size,
            last_uid=last_uid
        )
    
        mails = result['mails']
        page_info = {
            'last_uid': result['last_uid'],
            'has_more': result['has_more']
        }
    
        if output_format == "json":
            content = mails_to_json(mails, page_info)
        else:
            content = mails_to_text(mails, page_info)
    
        return [TextContent(type="text", text=content)]
    
    elif name == "get_mail_detail":
        uid = args.get("uid")
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 support but fails to describe critical behaviors: whether this is a read-only operation, how pagination works (e.g., token-based vs. offset), what the return format includes, error conditions, or rate limits. The description is too minimal for a tool with mutation siblings like delete_mails.

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 a single, efficient sentence that gets straight to the point with no wasted words. It's appropriately sized for a simple retrieval tool, though it could be more front-loaded with key differentiators from siblings.

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

Completeness2/5

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

Given the tool's complexity (pagination logic) and lack of both annotations and output schema, the description is incomplete. It doesn't explain what the tool returns, how pagination tokens work, or error handling. For a paginated query tool among mutation siblings, this leaves significant gaps for an AI agent.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema (e.g., it doesn't explain pagination mechanics or format implications). Baseline 3 is appropriate when the schema does the heavy lifting.

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 as '페이징을 지원하는 메일 목록 조회' (pagination-supported mail list retrieval), which specifies the verb (retrieve/list), resource (mails), and key capability (pagination). It distinguishes from the sibling 'list_mails' by explicitly mentioning pagination support, though it doesn't fully explain how it differs functionally beyond that.

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 'list_mails' or 'get_mail_detail'. It mentions pagination support but doesn't specify scenarios where pagination is necessary (e.g., large datasets) or when to prefer non-paginated versions. No prerequisites or exclusions are stated.

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/Leonamin/NaverMail-MCP-Server'

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