Skip to main content
Glama
localseodata

Local SEO Data

Official

ai_mentions

Read-only

Find keyword mentions in AI model outputs from ChatGPT and Google AI. Returns mention context and sources.

Instructions

Find where a keyword appears in AI model outputs (ChatGPT, Google AI). Returns mention context and sources. Costs 5 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesKeyword to search for (e.g. "best plumber in Buffalo")
locationNoLocation for results (e.g. "Portland, OR"). Default: US
platformsNoPlatforms to query. Default: all
limitNoMax mentions. Default: 10, max: 100

Implementation Reference

  • The handler function for the 'ai_mentions' tool. Calls the API endpoint '/v1/ai/mentions' with keyword, location, platforms, and limit parameters, then formats and returns the result.
    withErrorHandling(async ({ keyword, location, platforms, limit }) => {
      const result = await callApi(
        "/v1/ai/mentions",
        { keyword, ...(location && { location }), ...(platforms && { platforms }), ...(limit && { limit }) },
        getAuth()
      );
      return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
    })
  • Zod schema definitions for the 'ai_mentions' tool inputs: keyword (required string), location (optional string), platforms (optional array of 'chat_gpt' or 'google'), and limit (optional int 1-100).
    {
      keyword: z.string().min(1).describe('Keyword to search for (e.g. "best plumber in Buffalo")'),
      location: z.string().optional().describe('Location for results (e.g. "Portland, OR"). Default: US'),
      platforms: z.array(z.enum(["chat_gpt", "google"])).optional().describe("Platforms to query. Default: all"),
      limit: z.number().int().min(1).max(100).optional().describe("Max mentions. Default: 10, max: 100"),
    },
  • Registration of the 'ai_mentions' tool via server.tool() with its name, description, schema, read-only flags, and handler.
    server.tool(
      "ai_mentions",
      "Find where a keyword appears in AI model outputs (ChatGPT, Google AI). Returns mention context and sources. Costs 5 credits.",
      {
        keyword: z.string().min(1).describe('Keyword to search for (e.g. "best plumber in Buffalo")'),
        location: z.string().optional().describe('Location for results (e.g. "Portland, OR"). Default: US'),
        platforms: z.array(z.enum(["chat_gpt", "google"])).optional().describe("Platforms to query. Default: all"),
        limit: z.number().int().min(1).max(100).optional().describe("Max mentions. Default: 10, max: 100"),
      },
      READ_ONLY,
      withErrorHandling(async ({ keyword, location, platforms, limit }) => {
        const result = await callApi(
          "/v1/ai/mentions",
          { keyword, ...(location && { location }), ...(platforms && { platforms }), ...(limit && { limit }) },
          getAuth()
        );
        return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
      })
    );
  • src/server.ts:45-45 (registration)
    Registration of the registerAIVisibilityTools function in the MCP server setup, which is how the 'ai_mentions' tool gets included in the server.
    registerAIVisibilityTools(server, getAuth);
  • The 'withErrorHandling' wrapper that catches errors thrown by the ai_mentions handler and formats them as MCP error content.
    export function withErrorHandling<T>(
      fn: (args: T) => Promise<ToolResult>
    ): (args: T) => Promise<ToolResult> {
      return async (args) => {
        try {
          return await fn(args);
        } catch (err) {
          const message = err instanceof Error ? err.message : String(err);
          console.error(`[mcp] Tool error: ${message}`);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
          };
        }
      };
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds cost (5 credits) and return type (mention context and sources), providing some value beyond annotations but not extensive behavioral context.

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 with front-loaded purpose. No wasted words; each sentence adds essential information (function, return, cost).

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?

Covers purpose, cost, and return type. Missing explicit mention of parameter defaults and output format details, but schema covers defaults. Adequate for a read-only search tool with 4 parameters.

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 coverage is 100% with all parameters described. Description does not add parameter-specific meaning beyond what the schema already provides, so baseline 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 verb 'Find', the resource 'keyword mentions in AI model outputs', and specifies the platforms (ChatGPT, Google AI). It distinctly separates from siblings like 'ai_compare' and 'brand_mentions' by focusing on AI outputs.

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?

No explicit guidance on when to use this tool versus alternatives like 'ai_keyword_data' or 'ai_compare'. Usage is only implied; no when-not-to-use or prerequisite context is provided.

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