Skip to main content
Glama

check_bot_status

Determine if a specific bot is blocked or allowed on a website by analyzing its robots.txt file.

Instructions

Check if a specific bot is blocked or allowed on a given website by fetching and analyzing its robots.txt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe website URL to check (e.g. https://example.com)
bot_nameYesThe bot user-agent string to check (e.g. 'GPTBot', 'ClaudeBot'). Use list_ai_bots to see available names.

Implementation Reference

  • The `check_bot_status` tool fetches a robots.txt file, parses it, and determines if a specified bot is allowed or blocked based on the rules found.
    // Tool 5: check_bot_status
    server.tool(
      "check_bot_status",
      "Check if a specific bot is blocked or allowed on a given website by fetching and analyzing its robots.txt.",
      {
        url: z
          .string()
          .url()
          .describe("The website URL to check (e.g. https://example.com)"),
        bot_name: z
          .string()
          .describe(
            "The bot user-agent string to check (e.g. 'GPTBot', 'ClaudeBot'). Use list_ai_bots to see available names."
          ),
      },
      async ({ url, bot_name }) => {
        try {
          const parsedUrl = new URL(url);
          const robotsUrl = `${parsedUrl.protocol}//${parsedUrl.host}/robots.txt`;
    
          const response = await fetch(robotsUrl, {
            headers: {
              "User-Agent": "robotstxt-ai-mcp/1.0",
            },
            signal: AbortSignal.timeout(10000),
          });
    
          if (!response.ok) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Could not fetch robots.txt from ${robotsUrl}: HTTP ${response.status}. If no robots.txt exists, the bot is allowed by default.`,
                },
              ],
            };
          }
    
          const content = await response.text();
          const parsed = parseRobotsTxt(content);
          const statuses = analyzeBots(parsed);
    
          // Find the specific bot
          const botStatus = statuses.find(
            (s) =>
              s.bot.userAgent.toLowerCase() === bot_name.toLowerCase() ||
              s.bot.name.toLowerCase() === bot_name.toLowerCase()
          );
    
          if (!botStatus) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Bot "${bot_name}" is not in the known bot database. Use list_ai_bots to see available bots.\n\nHowever, I can check the raw rules. Here are the user-agent directives found:\n${parsed.rules.map((r) => `- User-agent: ${r.userAgent}`).join("\n")}`,
                },
              ],
            };
          }
    
          const status = botStatus.blocked ? "BLOCKED" : "ALLOWED";
          const rulesInfo =
            botStatus.rules.length > 0
              ? `\nMatching rules:\n${botStatus.rules.map((r) => `  - ${r}`).join("\n")}`
              : "\nNo specific rules found for this bot (allowed by default).";
    
          return {
            content: [
              {
                type: "text" as const,
                text: `# Bot Status: ${botStatus.bot.name} on ${parsedUrl.host}\n\n**Status: ${status}**\n\n- Bot: ${botStatus.bot.name}\n- User-Agent: \`${botStatus.bot.userAgent}\`\n- Company: ${botStatus.bot.company}\n- Type: ${botStatus.bot.type}${rulesInfo}`,
              },
            ],
          };
        } catch (error) {
          const message =
            error instanceof Error ? error.message : String(error);
          return {
            content: [
              {
                type: "text" as const,
                text: `Error checking bot status: ${message}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the core behavior (fetching and analyzing robots.txt to determine bot status) but lacks details about error handling, rate limits, authentication needs, or what specific analysis is performed. The description doesn't contradict any annotations since none exist.

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?

The description is a single, well-structured sentence that efficiently conveys the tool's purpose and method. Every word earns its place with no redundancy or unnecessary elaboration.

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?

For a tool with 2 parameters, 100% schema coverage, and no output schema, the description provides adequate context about what the tool does. However, as a read operation with no annotations, it could benefit from more behavioral details (like error cases or analysis specifics) to be 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 fully documents both parameters. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., it doesn't explain URL format requirements or bot name conventions beyond the schema's examples). The baseline of 3 is appropriate when the schema does the heavy lifting.

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 specific action ('Check if a specific bot is blocked or allowed'), the resource ('on a given website'), and the method ('by fetching and analyzing its robots.txt'). It distinguishes from sibling tools like 'analyze_robots' or 'fetch_robots' by focusing on bot-specific status checking rather than general analysis or raw fetching.

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 provides clear context for when to use this tool (to check bot status via robots.txt analysis). It implicitly references an alternative ('list_ai_bots') in the parameter description, but doesn't explicitly state when to choose this tool over siblings like 'analyze_robots' or 'fetch_robots' for similar robots.txt-related tasks.

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

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