Skip to main content
Glama

set_redirects

DestructiveIdempotent

Replace all of a site's user redirect rules in one call, all or nothing: pass either rules or text in the _redirects format, one from to [status] per line. Use this, or edit_redirects, for bulk work, such as moving a list of redirects from another host, rather than many add_redirect calls. Rules are checked in the order given, before the live deploy's file rules, and the status defaults to 301. A rule sent with the id of an existing rule keeps it. Pass the version from list_redirects to refuse the change if the rules changed since: the error is StaleVersion, with the latest version, so read the rules again and reapply the change. One invalid rule refuses the call with InvalidRules, listing each error by the rule's index or the text's line. The file rules don't change. Redirects apply only on the organization's own custom domains (CustomDomainRequired otherwise). Visitors get the change within about 5 minutes. Rules left out are deleted, and an empty list deletes them all: confirm with the user before dropping rules.

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>",
      "llm_model": "<llm_model>"
    },
    "name": "set_redirects"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoThe new list in the `_redirects` format, one `from to [status]` per line, such as `/old /new 301`. Pass this or `rules`.
rulesNoThe new list, in the order rules are checked. Pass this or `text`.
siteIdYesThe site ID (from `list_sites`).
versionNoThe `version` the rules were read at, from `list_redirects`. Omit to replace whatever the latest list is.
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.8/5.0
Behavior5/5

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

Annotations already flag this as destructive and idempotent, and the description goes well beyond them: all-or-nothing atomicity, rule ordering and precedence relative to the live deploy's file rules, default 301 status, id-based rule preservation, the `StaleVersion` conflict flow, `InvalidRules` error reporting by `index`/`line`, `CustomDomainRequired`, ~5 minute propagation, and that omitted rules are deleted. That is unusually rich disclosure for a destructive mutation.

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 and front-loaded — purpose first, then bulk-work routing, then ordering/defaults, then error and deletion semantics. Every sentence carries information, though the run of error codes and caveats makes it slightly heavy to scan in one pass.

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 7-parameter destructive bulk-replace tool with no output schema, the description covers the failure modes an agent must handle (stale version, invalid rules, missing custom domain), the timing of effects, and the data-loss risk. Nothing material needed to call it safely 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 the baseline is 3, but the description adds real meaning: `rules` and `text` are mutually exclusive representations of the same `_redirects` payload, and `version` is not just an integer but a concurrency guard whose failure surfaces as `StaleVersion` with the latest version. It adds value beyond the schema without fully re-specifying every field.

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?

The description opens with a precise verb and resource: 'Replace all of a site's user redirect rules in one call, all or nothing', and immediately distinguishes itself from `edit_redirects` and `add_redirect`. An agent can tell what this tool does and how it differs from siblings without inspecting any 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?

It explicitly routes the agent: use this or `edit_redirects` for bulk work such as migrating a redirect list from another host, rather than many `add_redirect` calls. It also states the precondition for the optimistic version check and instructs the agent to confirm with the user before dropping rules — genuine when-to-use and when-to-be-careful guidance.

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.