Skip to main content
Glama

Apply a rewrite rule

site_set_rewrite

Write a site's rewrite config and reload nginx, overwriting current rules. Read existing config first when updating live sites.

Instructions

Write the rewrite config for a site and reload nginx. Overwrites the current rule, so read the existing one first when changing something live.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesFull rewrite config content.
pathYesRewrite file path, e.g. /www/server/panel/vhost/rewrite/example.com.conf
encodingNoFile encoding.utf-8

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1-alpha.0

TDQS

A4.2/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing that the current rule is overwritten and that nginx is reloaded (an open-world side effect consistent with openWorldHint=true). It adds real value the annotations do not carry. Note the overwrite behavior sits somewhat uneasily with destructiveHint=false, but overwriting a config with new content is not a straight contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences with the action and its side effect front-loaded, followed by the safety caveat. Nothing is wasted and nothing is buried.

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 a mutation tool with no output schema, the description covers the key behaviors: overwrite semantics and the nginx reload. It omits rollback/failure behavior and any permission requirements, which would matter for a live-config write, but the essentials for calling it correctly are present.

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 description coverage is 100%, so all three parameters (path, data, encoding) are already documented in the schema. The description adds no syntax or format detail beyond that, so the 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 ('Write the rewrite config for a site') plus the operational side effect ('reload nginx'). It implicitly distinguishes itself from the read-side siblings (site_get_rewrite, site_rewrite_templates) by telling the agent to read the existing rule first.

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 clear operational context: use this when changing a live rule, and read the existing one first. It does not name the alternative tool (site_get_rewrite) explicitly, but the workflow guidance is strong and actionable.

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