Skip to main content
Glama
localseodata

Local SEO Data

Official

ai_top_sources

Read-only

Identify which websites AI models reference most for a keyword. Analyze AI visibility across ChatGPT and Google to see top cited domains.

Instructions

Get the top domains cited in AI model responses for a keyword. Shows which sites AI models reference most. Costs 5 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesKeyword to search for (e.g. "plumber near me")
locationNoLocation for results (e.g. "Seattle, WA"). Default: US
platformsNoPlatforms to query. Default: all
limitNoMax domains. Default: 10, max: 20

Implementation Reference

  • The handler function for the 'ai_top_sources' tool. It calls the API endpoint /v1/ai/top-sources with keyword, optional location, platforms, and limit parameters, then formats and returns the result.
    withErrorHandling(async ({ keyword, location, platforms, limit }) => {
      const result = await callApi(
        "/v1/ai/top-sources",
        { keyword, ...(location && { location }), ...(platforms && { platforms }), ...(limit && { limit }) },
        getAuth()
      );
      return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
    })
  • Input schema for 'ai_top_sources' tool: keyword (required string), location (optional string), platforms (optional array of 'chat_gpt' or 'google'), limit (optional number 1-20).
    {
      keyword: z.string().min(1).describe('Keyword to search for (e.g. "plumber near me")'),
      location: z.string().optional().describe('Location for results (e.g. "Seattle, WA"). Default: US'),
      platforms: z.array(z.enum(["chat_gpt", "google"])).optional().describe("Platforms to query. Default: all"),
      limit: z.number().int().min(1).max(20).optional().describe("Max domains. Default: 10, max: 20"),
    },
  • Registration of the 'ai_top_sources' tool via server.tool() within the registerAIVisibilityTools function. Includes the name, description, Zod schema, read-only flags, and the handler.
    server.tool(
      "ai_top_sources",
      "Get the top domains cited in AI model responses for a keyword. Shows which sites AI models reference most. Costs 5 credits.",
      {
        keyword: z.string().min(1).describe('Keyword to search for (e.g. "plumber near me")'),
        location: z.string().optional().describe('Location for results (e.g. "Seattle, WA"). Default: US'),
        platforms: z.array(z.enum(["chat_gpt", "google"])).optional().describe("Platforms to query. Default: all"),
        limit: z.number().int().min(1).max(20).optional().describe("Max domains. Default: 10, max: 20"),
      },
      READ_ONLY,
      withErrorHandling(async ({ keyword, location, platforms, limit }) => {
        const result = await callApi(
          "/v1/ai/top-sources",
          { keyword, ...(location && { location }), ...(platforms && { platforms }), ...(limit && { limit }) },
          getAuth()
        );
        return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
      })
    );
  • src/server.ts:13-13 (registration)
    Import of registerAIVisibilityTools from the ai-visibility module.
    import { registerAIVisibilityTools } from "./tools/ai-visibility.js";
  • src/server.ts:45-45 (registration)
    Call to registerAIVisibilityTools(server, getAuth) which registers the 'ai_top_sources' (and other AI visibility) tools on the MCP server.
    registerAIVisibilityTools(server, getAuth);
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true. The description adds 'Costs 5 credits', which is a valuable behavioral detail beyond annotations. No contradictions detected.

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?

Two succinct sentences with no wasted words. The first states the action and resource, the second adds what it shows and the credit cost. Perfectly front-loaded and efficient.

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 no output schema, the description could explain the return format (e.g., list of domains with counts). It lacks details on output structure or limits, making it adequate but not fully complete.

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. The tool description does not add any extra meaning or examples beyond what the schema provides, so it meets the baseline of 3.

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's purpose: getting top domains cited in AI model responses for a keyword. It uses a specific verb ('Get') and resource ('top domains cited in AI model responses'), and distinguishes from siblings like 'ai_top_pages' which likely returns pages rather than domains.

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

Usage Guidelines3/5

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

The description implies usage for researching AI model citations but provides no explicit guidance on when to use this tool versus alternatives like 'ai_llm_response' or 'ai_mentions'. The mention of credit cost is helpful but not sufficient for clear usage context.

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/localseodata/mcp-server'

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