Skip to main content
Glama
AutomateLab-tech

automatelab-ai-seo

Official

Rewrite for Answer Engine Optimization

rewrite_aeo
Read-only

Rewrite content blocks for Answer Engine Optimization by adding BLUF openings, FAQ structure, schema, and question-shaped headings tuned for ChatGPT, Perplexity, and Google AI Overviews.

Instructions

Rewrite a content block for Answer Engine Optimization. Adds a BLUF opening, FAQ structure, schema additions, and concise question-shaped headings tuned for ChatGPT / Perplexity / Google AI Overviews.

Read-only when given url (one HTTP GET). Zero network when given text. The tool does NOT write back to the URL - it only returns the rewritten content as a string. No side effects on the source.

This tool delegates the actual rewrite to the calling LLM via MCP sampling - it does not call any external API itself. The MCP host's model produces the rewrite. Same input may produce different output across runs (model-dependent).

When to use: optimizing content for direct-answer surfaces (definitions, how-tos, FAQs). For Generative Engine Optimization (entity-rich, comparison-ready synthesis), use rewrite_geo instead.

Either url or text must be provided. target_query is required.

Input Schema

NameRequiredDescriptionDefault
urlNoPublic URL whose content should be fetched and rewritten. Either this OR `text` is required.
textNoRaw content (markdown or HTML) to rewrite directly. Either this OR `url` is required.
formatNoOutput shape. `article` for prose-with-headings. `faq` for Q&A list. `howto` for numbered-step procedural content with HowTo schema hints. `comparison` for X-vs-Y tables. Default `article`.article
max_wordsNoSoft word budget for the rewrite. Default 1500. Range 100-5000. The rewrite tries to stay under this; very small budgets may force truncation.
target_queryYesThe user query the rewrite should answer (e.g. `what is RAG`, `how to deploy Ghost to Docker`). Required - drives heading shape and BLUF wording.
respect_robotsNoIf true (default), respect robots.txt when fetching `url`. Ignored when `text` is used.

Output Schema

NameRequiredDescriptionDefault
modeYes
after_scoreYes
before_scoreYes
changes_madeYes
rewritten_textYes
schema_additionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changed
    • addedOutput schema / properties / after_score
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / before_score
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / changes_made
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • removedOutput schema / properties / format
      Removed value: -{
      -  "description": "Output format (article, faq, howto, comparison).",
      -  "type": "string"
      -}
    • addedOutput schema / properties / mode
      Added value: +{
      +  "enum": [
      +    "sampling",
      +    "prompt_template"
      +  ],
      +  "type": "string"
      +}
    • removedOutput schema / properties / notes
      Removed value: -{
      -  "description": "Notes from the rewrite (e.g. truncations, format adjustments).",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedOutput schema / properties / rewritten
      Removed value: -{
      -  "description": "The rewritten content. The caller decides where to publish it.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / rewritten_text
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / schema_additions
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / source
      Removed value: -{
      -  "enum": [
      -    "url",
      -    "text"
      -  ],
      -  "type": "string"
      -}
    • removedOutput schema / properties / target_query
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / url
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "source",
      -  "url",
      -  "target_query",
      -  "rewritten",
      -  "notes"
      -]New value: +[
      +  "rewritten_text",
      +  "schema_additions",
      +  "changes_made",
      +  "before_score",
      +  "after_score",
      +  "mode"
      +]
  2. Addedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: it discloses that the url path performs exactly one HTTP GET, that the text path makes zero network calls, that nothing is written back to the source, and that the rewrite is delegated to the calling LLM via MCP sampling so output is non-deterministic across runs. The idempotentHint=false annotation is now explained rather than merely asserted.

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?

Purpose and mechanism are front-loaded, then network behavior, then routing guidance, then input constraints - a sensible order. Every sentence carries information, though the network/side-effect paragraph is slightly repetitive ('does NOT write back', 'No side effects on the source').

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 6-parameter, open-world rewrite tool with an output schema present, the description covers what an agent needs: transformation scope, network/side-effect profile, non-determinism, input requirements, and sibling routing. Return-value explanation is correctly omitted since the output schema exists.

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 the baseline is 3, but the description adds a genuine cross-parameter constraint the schema does not encode: 'Either `url` or `text` must be provided' (required is only `target_query`). It also confirms target_query drives heading shape and BLUF wording, which explains why it is required rather than just restating it.

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 resource ('Rewrite a content block for Answer Engine Optimization') and immediately enumerates the concrete transformations (BLUF opening, FAQ structure, schema additions, question-shaped headings). It also names the sibling it is not (`rewrite_geo`), so an agent can separate the two rewrite tools without opening either schema.

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

Usage Guidelines5/5

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

Provides an explicit when-to-use clause ('optimizing content for direct-answer surfaces (definitions, how-tos, FAQs)') plus an explicit alternative with its own selection condition ('For Generative Engine Optimization ... use `rewrite_geo` instead'). Input prerequisites are also stated ('Either `url` or `text` must be provided. `target_query` is required').

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