Skip to main content
Glama
jun7680

Kakao Moment MCP

by jun7680

list_adgroups

Retrieve ad groups for a specific campaign, including bid price, daily budget, execution period, and device targeting.

Instructions

특정 캠페인 내 광고그룹 목록(입찰가·일예산·집행기간·디바이스) 조회.

이런 질문에 사용하세요: • "캠페인 X 의 광고그룹 보여줘" / "X 안에 어떤 그룹 있어?" • "광고그룹 입찰가 얼마야?" / "그룹 일예산 얼마로 잡혀있어?" • "그룹 집행기간 언제까지야?" ⚠️ 광고그룹 ID 만 알고 캠페인 ID 모르면, 먼저 list_campaigns 로 캠페인을 찾으세요.

Args: campaign_id: 특정 캠페인의 광고그룹만 조회 (필수에 가까움) with_details: True(기본) 면 광고그룹별 detail 로 입찰가/일예산/기간 보강.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idNo
with_detailsNo

Implementation Reference

  • Core handler function `list_adgroups` that calls the Kakao Momentum API at /openapi/v4/adGroups, optionally fetches per-group details (bid, budget, schedule), merges results, computes summary stats, and returns items with count and summary text.
    async def list_adgroups(
        client: KakaoMomentClient,
        campaign_id: str | None = None,
        *,
        with_details: bool = True,
    ) -> dict[str, Any]:
        """광고그룹 목록.
    
        Args:
            campaign_id: 특정 캠페인의 광고그룹만 필터. 카카오모먼트는 campaign_id 가
                         없으면 KakaoMomentException(-813) 을 던지므로 필수에 가깝습니다.
            with_details: True 면 광고그룹별 detail 을 동시 호출해 일예산/입찰가/기간 보강.
        """
        if not campaign_id:
            raise ValueError(
                "list_adgroups 는 campaign_id 가 필요합니다. "
                "list_campaigns 로 ID 를 먼저 얻어 전달하세요."
            )
        params: dict[str, Any] = {"campaignId": campaign_id}
        data = await client.get("/openapi/v4/adGroups", params=params)
        rows = extract_rows(data)
    
        details: dict[Any, dict[str, Any]] = {}
        if with_details and rows:
            details = await fetch_details(
                client,
                "/openapi/v4/adGroups/{id}",
                [r.get("id") for r in rows],
            )
    
        items: list[dict[str, Any]] = []
        for r in rows:
            merged = {**r, **details.get(r.get("id"), {})}
            schedule = merged.get("schedule")
            begin_date = (
                schedule.get("beginDate") if isinstance(schedule, dict) else None
            )
            end_date = schedule.get("endDate") if isinstance(schedule, dict) else None
            items.append(
                {
                    "id": merged.get("id"),
                    "name": merged.get("name"),
                    "campaign_id": (
                        merged.get("campaign", {}).get("id")
                        if isinstance(merged.get("campaign"), dict)
                        else merged.get("campaignId")
                    )
                    or campaign_id,
                    "status": merged.get("config") or merged.get("status"),
                    "daily_budget": merged.get("dailyBudgetAmount")
                    or merged.get("dailyBudget"),
                    "bid_amount": merged.get("bidAmount"),
                    "bid_strategy": merged.get("bidStrategy"),
                    "pricing_type": merged.get("pricingType"),
                    "pacing": merged.get("pacing"),
                    "begin_date": begin_date,
                    "end_date": end_date,
                    "creative_count": merged.get("creativeCount"),
                    "status_description": merged.get("statusDescription"),
                    "created_at": merged.get("createdDate"),
                }
            )
    
        on_count = sum(1 for it in items if str(it.get("status", "")).upper() == "ON")
        off_count = sum(
            1 for it in items if str(it.get("status", "")).upper() in ("OFF", "PAUSED")
        )
        total_budget = sum(
            float(it.get("daily_budget") or 0) for it in items if it.get("daily_budget")
        )
        summary = (
            f"광고그룹 {len(items)}개 (진행 {on_count} · 일시정지 {off_count})"
            f" · 일예산 합계 {int(total_budget):,}원"
        )
        return {
            "count": len(items),
            "items": items,
            "summary": summary,
            "raw": data,
        }
  • Imports `extract_rows` and `fetch_details` helpers from `._common` which are used by `list_adgroups` to parse API responses and fetch per-group details.
    from ._common import extract_rows, fetch_details
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains that with_details=True (default) adds bid/budget/period details, implying a read operation. However, it does not explicitly state that the tool is idempotent or non-destructive, though the context strongly suggests it.

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 well-structured with a summary line, usage examples, a warning, and parameter explanations. It is slightly long but every sentence adds value; no redundancy.

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 two parameters, no output schema, and no annotations, the description covers purpose, parameters, and usage guidance adequately. It could be more explicit about the return format (e.g., array of objects), but the with_details parameter implies the structure. Overall fairly complete for a list tool.

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

Parameters5/5

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

Schema description coverage is 0%, but the description explains both parameters: campaign_id is 'close to required' for filtering by campaign, and with_details (default true) reinforces details per ad group. This adds significant meaning beyond the schema types and defaults.

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

Purpose5/5

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

The description clearly states it lists ad groups within a specific campaign with details like bid, daily budget, execution period, and device. It provides example questions that illustrate its purpose, and distinguishes from sibling list_campaigns by focusing on ad groups.

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

Usage Guidelines5/5

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

Explicit usage guidance is given with example questions (e.g., 'show ad groups of campaign X') and a clear warning: if only ad group ID is known, first use list_campaigns to find the campaign. This directly helps the agent decide when to use this tool.

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/jun7680/kakao-moment-mcp'

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