Skip to main content
Glama
sharozdawa

ai-visibility-mcp

check_single_query

Monitor brand mentions for specific queries on AI platforms like ChatGPT, Perplexity, Claude, and Gemini to track visibility, sentiment, and competitor presence.

Instructions

Check if a brand is mentioned for a specific query on a specific AI platform. Returns mention status, position, context snippet, sentiment, and competitor mentions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
brandYesThe brand name to check
queryYesThe exact query to check (e.g., 'What are the best SEO tools?')
platformYesThe AI platform to check on

Implementation Reference

  • The registration and handler implementation for the check_single_query tool. It uses Zod for input validation and returns a simulated result for a given brand, query, and AI platform.
    server.tool(
      "check_single_query",
      "Check if a brand is mentioned for a specific query on a specific AI platform. Returns mention status, position, context snippet, sentiment, and competitor mentions.",
      {
        brand: z.string().describe("The brand name to check"),
        query: z
          .string()
          .describe(
            "The exact query to check (e.g., 'What are the best SEO tools?')"
          ),
        platform: z
          .enum(["chatgpt", "perplexity", "claude", "gemini"])
          .describe("The AI platform to check on"),
      },
      async ({ brand, query, platform }) => {
        const timeBucket = Math.floor(Date.now() / 3600000);
        const rng = seededRandom(`${brand}-${query}-${platform}-${timeBucket}`);
    
        // Infer keywords from query
        const queryWords = query
          .toLowerCase()
          .split(/\s+/)
          .filter((w: string) => w.length > 3);
        const result = simulateCheck(brand, query, platform, queryWords, rng);
    
        const platformInfo = PLATFORMS.find((p) => p.id === platform)!;
    
        const output = {
          brand,
          query,
          platform: platformInfo.name,
          mentioned: result.mentioned,
          position: result.position,
          context: result.context,
          sentiment: result.sentiment,
          competitorsFound: result.competitors,
          checkedAt: new Date().toISOString(),
          note: "Result is simulated for demonstration. Connect real AI platform APIs for production data.",
        };
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(output, null, 2),
            },
          ],
        };
      }
    );

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/sharozdawa/ai-visibility'

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