Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ads_mcp/tools/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Tools for exposing simple, core API methods to the MCP server."""

from typing import List
import json
from ads_mcp.coordinator import mcp

import ads_mcp.utils as utils
Expand All @@ -25,14 +25,15 @@


@mcp.tool()
def list_accessible_customers() -> List[str]:
def list_accessible_customers() -> str:
"""Returns ids of customers directly accessible by the user authenticating the call."""
ga_service = utils.get_googleads_service("CustomerService")
accessible_customers: ListAccessibleCustomersResponse = (
ga_service.list_accessible_customers()
)
# remove customer/ from the start of each resource
return [
customer_ids = [
cust_rn.removeprefix("customers/")
for cust_rn in accessible_customers.resource_names
]
return json.dumps({"customer_ids": customer_ids, "count": len(customer_ids)}, indent=2)