Skip to main content
Glama

Write robots.txt rules for AI crawlers

generate_ai_robots_txt
Read-onlyIdempotent

Write robots.txt lines for AI crawlers: start from a preset (allow every AI crawler, block training only, or block them all), override any crawler by its user-agent token, add paths to keep every crawler out of, a sitemap and Content Signals (search, ai-input, ai-train). Answers the file's text, which crawlers it blocks and allows, and any input it ignored with why. Nothing is fetched or stored; Googlebot and Bingbot are never named, so search indexing is unchanged.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate_ai_robots_txt"
  }
}

Input Schema

NameRequiredDescriptionDefault
presetNoWhere to start: "allow_all" (the default), "block_training" (block crawlers that collect for AI training, keep AI search) or "block_all".
crawlersNoPer-crawler choices over the preset, by user-agent token: { "GPTBot": "block", "OAI-SearchBot": "allow" }.
sitemapUrlNoThe sitemap's absolute https:// address, written last.
disallowPathsNoPaths every crawler stays out of, each starting with "/" ("/admin").
contentSignalsNoContent Signals to state; leave out for none.

Output Schema

NameRequiredDescriptionDefault
toolYes
allowedYes
blockedYes
droppedYes
toolUrlYes
robotsTxtYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Adds real behavior beyond the annotations: nothing is fetched or stored (consistent with readOnly/openWorld), Googlebot and Bingbot are never emitted so search indexing is unaffected, and the response explains both the resulting file and any ignored input with a reason. That is exactly the operational context an agent needs before calling.

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

Conciseness4/5

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

Front-loaded with the verb and resource, then details in a logical order, ending with the behavior guarantees. It is dense and parenthetical-heavy in the first sentence, but every clause carries information rather than repeating the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-optional-parameter, nested-object tool with an output schema and rich annotations, the definition covers defaults, ordering, side-effect freedom, and output reporting. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, and the description still adds value: it spells out what each preset means, that overrides are keyed by user-agent token, that disallow paths apply to every crawler, and that the sitemap is written last. Content Signals are named in human terms (search, ai-input, ai-train) matching the nested object.

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?

States a specific verb and artifact (write robots.txt lines for AI crawlers) plus the full range of what it can produce: preset, per-crawler override, disallow paths, sitemap, Content Signals. The closing clause ('Nothing is fetched or stored') separates it from the testing/fetching siblings such as test_robots_txt without naming them.

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?

Gives clear usage context: start from one of three named presets, then override per crawler by user-agent token, add paths, sitemap and signals. It doesn't explicitly say when to use this versus test_robots_txt, so the workflow boundary is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources