Skip to main content
Glama

create_redirect

Create a redirect rule from old paths, prefixes, or URLs to new pages or URLs, preventing broken links with permanent, temporary, or gone status codes.

Instructions

Create a redirect rule. source: a path ("/old-page"), a prefix ("/blog/*" — the rest of the path is carried over) or a full URL on the old site (reduced to its path). Target: EITHER targetDocumentId (+ optional targetLocale) to follow a page wherever it moves, OR target = a path or https:// URL — a path that names a published page is stored as that page. status: 301 (default, permanent — passes link equity), 302/307 temporary, 308 permanent, 410 gone (no target). A target that is itself redirected is collapsed to the final destination; loops are refused. Publishing a new slug or moving a page creates 301s automatically — check list_redirects before adding one by hand.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoFree-text note for editors, e.g. 'old WordPress URL'.
siteNoSite slug or id to act in (multisite). Omit to use this server's default site. Call list_sites to see what exists — an empty tree or search usually means the wrong site, not missing content.
sourceYesOld path ('/old-page'), prefix ('/blog/*') or full URL on the old site.
statusNo301 permanent (default), 302/307 temporary, 308 permanent, 410 gone (no target).
targetNoDestination path or https:// URL. Use this OR targetDocumentId.
keepQueryNoCarry the request's query string over to the target.
targetLocaleNoLocale of targetDocumentId to send visitors to. Omit for the site default.
targetDocumentIdNodocumentId of the destination page; the rule follows it if it moves. Use this OR target.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.1.3
    • addedInput schema / properties / keepQuery / description
      Added value: +"Carry the request's query string over to the target."
    • addedInput schema / properties / note / description
      Added value: +"Free-text note for editors, e.g. 'old WordPress URL'."
    • addedInput schema / properties / source / description
      Added value: +"Old path ('/old-page'), prefix ('/blog/*') or full URL on the old site."
    • addedInput schema / properties / status / description
      Added value: +"301 permanent (default), 302/307 temporary, 308 permanent, 410 gone (no target)."
    • addedInput schema / properties / target / description
      Added value: +"Destination path or https:// URL. Use this OR targetDocumentId."
    • addedInput schema / properties / targetDocumentId / description
      Added value: +"documentId of the destination page; the rule follows it if it moves. Use this OR target."
    • addedInput schema / properties / targetLocale / description
      Added value: +"Locale of targetDocumentId to send visitors to. Omit for the site default."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly=false, destructive=false, idempotent=false), and the description adds genuinely non-obvious behavior: chained redirects are collapsed to the final destination, loops are refused, and auto-generated 301s may already exist. It stops short of stating whether the rule takes effect immediately or whether it requires a publish step.

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 action, then the two argument families, then status semantics, then the routing tip to list_redirects. Dense and mostly waste-free, though the long em-dashed clauses make it slightly harder to scan than ideal.

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?

For an 8-parameter mutation tool with no output schema, the description covers source/target semantics, status codes, and redirect-resolution behavior well. The remaining gap is the return value and whether creation is immediate or requires publishing, which the agent would otherwise need from elsewhere.

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 goes beyond the schema: it explains that a full old-site URL is reduced to its path, that a target path naming a published page is stored as that page, and that 301 'passes link equity' while 410 requires no target. These are semantics the schema does not convey.

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?

Opens with a specific verb+resource ('Create a redirect rule') and then defines the two core concepts (source forms, target forms) precisely enough to distinguish it from siblings like update_redirect and delete_redirects. It also explicitly contrasts itself with list_redirects ('check list_redirects before adding one by hand'), which the agent would otherwise have to infer.

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 real when-not guidance: publishing a new slug or moving a page already creates 301s automatically, so check list_redirects first. It does not, however, mention when to prefer update_redirect or delete_redirects over creating a new rule, leaving one sibling gap.

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