Skip to main content
Glama

gsc_list_sites

Read-onlyIdempotent

List all Google Search Console properties accessible with your authentication, returning site URLs and permission levels to use with other tools.

Instructions

List every Google Search Console property the authenticated user can access.

Returns a table of site URLs and permission levels. Use the exact siteUrl string returned here when calling other tools — the format matters (domain properties use 'sc-domain:example.com' prefix).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the gsc_list_sites tool. Offloads the synchronous API call to a thread, then formats the results.
    async def gsc_list_sites(params: ListSitesInput) -> str:
        """List every Google Search Console property the authenticated user can access.
    
        Returns a table of site URLs and permission levels. Use the exact siteUrl
        string returned here when calling other tools — the format matters (domain
        properties use 'sc-domain:example.com' prefix).
        """
        try:
            sites = await asyncio.to_thread(api.list_sites)
            return format_sites(sites, params.response_format)
        except Exception as exc:
            return format_api_error(exc)
  • Pydantic input schema for gsc_list_sites, with an optional response_format field.
    class ListSitesInput(BaseModel):
        model_config = ConfigDict(extra="forbid")
    
        response_format: ResponseFormat = Field(
            default=ResponseFormat.MARKDOWN,
            description="Output format: 'markdown' for a human-readable table, 'json' for raw data.",
        )
  • Registration of gsc_list_sites as an MCP tool via the @mcp.tool decorator with metadata annotations.
    @mcp.tool(
        name="gsc_list_sites",
        annotations={
            "title": "List verified Search Console sites",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
  • The actual Google Search Console API call to list verified sites via the sites().list() endpoint.
    def list_sites() -> list[dict[str, Any]]:
        """Return all Search Console properties the authenticated user owns."""
        response = get_service().sites().list().execute()
        return response.get("siteEntry", [])
  • Formats the list of sites into either a Markdown table or JSON output.
    def format_sites(sites: list[dict[str, Any]], fmt: ResponseFormat) -> str:
        if fmt == ResponseFormat.JSON:
            return json.dumps(sites, indent=2)
    
        if not sites:
            return "No verified sites found for the authenticated user."
    
        lines = [
            f"Found {len(sites)} verified site(s):",
            "",
            "| Site URL | Permission Level |",
            "| --- | --- |",
        ]
        for s in sites:
            lines.append(f"| `{s.get('siteUrl', '')}` | {s.get('permissionLevel', '')} |")
        return "\n".join(lines)
Behavior4/5

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

Annotations already indicate readOnly, non-destructive, idempotent. The description adds context about the returned table format and the critical siteUrl prefix detail, which is beyond annotations. No contradictions.

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

Conciseness5/5

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

Three concise sentences: purpose, return value, key usage tip. No unnecessary words, front-loaded with the action.

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?

The description covers the main purpose and a critical usage detail (siteUrl format). Given that an output schema exists (from context) and the tool is simple, it is nearly complete. Could mention potential edge cases like empty results.

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?

The input schema has a single parameter with a nested object. The schema description for 'response_format' is clear, but the tool description does not mention this parameter. Since schema coverage is low (0%), the description should compensate; it does not, so a score of 3 is appropriate.

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 the tool lists every Google Search Console property the authenticated user can access, returns a table with URLs and permissions, and distinguishes itself from sibling tools by highlighting the importance of the exact siteUrl format.

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

Usage Guidelines4/5

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

The description implicitly guides when to use (before other GSC tools) by stating to use the returned siteUrl for other tools, but does not explicitly compare with siblings or mention when not to use.

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/jayrockliffe-defused/gsc-mcp'

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