Skip to main content
Glama

add_redirect

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>",
      "llm_model": "<llm_model>"
    },
    "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.
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess.
partitionNoData partition the site lives in. Omit to use the user's home partition.
conversation_idNoPass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only supply destructiveHint=false, so the description carries the load and does it well: evaluation order (user rules before the live deploy's `_redirects`, in list order), insertion point behavior, that the write lands on the latest list without creating a version, the ~5 minute propagation window, and the domain restriction error. This is materially more than the annotations provide.

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 purpose, then ordered into behavior, return value, latency, and alternatives — no filler. It is dense but each sentence carries operational information; only the deployment-order sentence is slightly longer than it needs to be.

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 an 8-parameter mutation tool with no output schema, the description covers what is returned (`id` plus new version), how the change propagates, the error case, and how it relates to sibling tools. Nothing an agent needs to call it correctly is missing.

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 coverage is 100%, so the schema already defines every parameter including status codes, position bounds, and the placeholder syntax. The description adds contextual meaning for `position` (where it lands relative to user rules) and clarifies the versionless behavior, but does not add syntax or format detail beyond the schema; baseline 3 applies.

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 with scope: "Add one user redirect rule to a site," and gives a concrete example (forwarding a moved page). The opening also implicitly separates it from the bulk siblings by emphasizing "one" rule.

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?

Explicitly routes bulk work to `set_redirects` or `edit_redirects` and verification to `test_redirect`, and names the CustomDomainRequired precondition. It lacks an explicit statement of when a caller should prefer `edit_redirects` over `set_redirects`, but the when-to-use boundary for this tool itself is clear.

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.