Skip to main content
Glama

add_redirect

Add a redirect rule to a site to forward a moved or renamed page to its new path, with an optional 301/302 status and ordering position. Check results with test_redirect.

Instructions

Add one user redirect rule to a site, such as forwarding a moved page to its new path. User rules are checked before the live deploy's _redirects, in list order: the rule goes at the end of the user rules, or at position. The status defaults to 301, a permanent move. It is added to the latest list, without a version. Returns the rule with its id, and the new version. Visitors get it within about 5 minutes; check it with test_redirect. Each call is a separate save, so for more than a few rules use set_redirects or edit_redirects. Redirects apply only on the organization's own custom domains (CustomDomainRequired otherwise).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "siteId": "<siteId>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "add_redirect"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesDestination: a path starting with `/`, or an http(s) URL. `:splat` fills in what `*` matched, and `:name` a placeholder's value. The request's query string is carried over.
fromYesSource path: exact (`/old-page`), with `:name` placeholders (`/blog/:year/:slug`), or ending in `/*` (`/docs/*`). No query string.
siteIdYesThe site ID (from `list_sites`).
statusNo301, 302, 303, 307 or 308. Defaults to 301, a permanent move. Use 302 or 307 for a temporary one.
positionNoWhere to add the rule among the user rules, from 0. Defaults to the end.
partitionNoData partition the site lives in. Omit to use the user's home partition.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.8.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations supply only destructiveHint=false, so the description carries the burden and does: it discloses ordering precedence over the deployed `_redirects`, that each call is a separate save, that the rule is added to the latest list without a version, the ~5 minute propagation window, and the returned id and new version.

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?

Dense but front-loaded: purpose first, then ordering, defaults, return value, propagation, and the bulk alternative. Sentences are information-bearing, though the blocking of behavior, provenance and propagation details makes it slightly crowded for a single-save write.

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?

There is no output schema, and the description compensates by stating what is returned (the rule with its id, and the new version). With no annotations beyond a title and a non-destructive hint, all behavioral facts an agent needs — ordering, defaults, propagation, domain restriction — are present.

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 meaning beyond it: it clarifies that `position` indexes into the user-rules list (defaulting to append at the end) and that `status` defaults to 301 permanent, with the rule-precedence context that makes the ordering choice meaningful.

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 ('Add one user redirect rule to a site') plus a concrete example of the operation. It immediately signals single-rule scope, which separates it from the bulk siblings set_redirects and edit_redirects that it names.

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?

Explicitly routes the agent: use set_redirects or edit_redirects when adding more than a few rules, and verify propagation with test_redirect. It also gives the precondition that redirects only apply on the organization's own custom domains, with the exact error code otherwise.

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