Skip to main content
Glama

caddy_reverse_proxy

Destructive

Create a reverse proxy route by mapping an incoming domain or path to one or more upstream addresses. Supply a stable id to update that route in place on repeat calls.

Instructions

Add a reverse proxy route. The most common operation — just specify where traffic comes from and where it goes. Example: from='api.local' to=['localhost:3000']. When id is OMITTED the route is appended to the server's routes array — calling the tool twice with the same args produces TWO duplicate routes (non-idempotent). When id is SUPPLIED the route is written via PATCH under that @id, so repeat calls REPLACE in place (idempotent). Strongly recommended: supply a stable id for any route managed from automation or production tooling. Note: @ids are config-global in Caddy (NOT route-scoped). If id collides with an @id used by a non-route object (TLS issuer, server, etc.) the call refuses with an error rather than clobbering it. Once an @id is registered to a route under one server, subsequent calls update that route in place regardless of the server argument. Upstream scheme is honored: an https:// upstream gets a TLS transport and defaults to port 443, anything else is dialed in the clear. A to list that MIXES https:// and non-https entries is refused — the TLS transport applies to the whole handler, not per-upstream — so split those into two routes or use caddy_add_route.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoOptional stable @id for the route. When set, repeat calls REPLACE the route in place (idempotent). When omitted, the route is APPENDED — calling twice with identical args creates a duplicate route. @ids are config-global in Caddy: if this id is already used by a non-route object the call refuses rather than clobbering it.
toYesUpstream addresses, at least one (e.g., ['localhost:3000', 'localhost:3001']). An 'https://' prefix dials the upstream over TLS (port 443 unless one is given); http:// and bare addresses are dialed in the clear. Do not mix https:// and non-https entries in one call.
fromYesDomain, path, or domain/path to match (e.g., 'api.local', '/api/*', 'app.local/ws')
serverNoCaddy server name (default: srv0)srv0

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.4.0
    • changedInput schema / properties / to / description
      Previous value: -"Upstream addresses (e.g., ['localhost:3000', 'localhost:3001'])"New value: +"Upstream addresses, at least one (e.g., ['localhost:3000', 'localhost:3001']). An 'https://' prefix dials the upstream over TLS (port 443 unless one is given); http:// and bare addresses are dialed in the clear. Do not mix https:// and non-https entries in one call."
    • addedInput schema / properties / to / items / minLength
      Added value: +1
    • addedInput schema / properties / to / minItems
      Added value: +1
  2. First observedv2.2.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations supply safety hints (destructiveHint=true, idempotentHint=false), and the description adds substantial context beyond them: conditional idempotency based on `id`, duplicate-route creation on repeat calls, refusal on non-route @id collision, server argument being ignored after @id registration, and TLS transport behavior. This is rich behavioral disclosure.

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 with the primary purpose and example first, then edge cases. It is on the long side and repeats several schema-documented facts, but every sentence contributes operational detail rather than filler.

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 destructive, non-idempotent mutation tool with no output schema, the description is thorough: it discloses idempotency semantics, collision refusal, cross-server @id behavior, and TLS handling. An agent has everything needed to call it correctly.

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 the schema already documents all four parameters, including the @id collision behavior and the mixed-scheme restriction. The description largely restates those semantics, adding only a concrete example; baseline 3 is appropriate when the schema carries the load.

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+resource ('Add a reverse proxy route') and immediately scopes it as the most common operation. It also names caddy_add_route as the alternative for the mixed-scheme case, distinguishing it from siblings.

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 covers when to omit vs supply `id`, gives a hard recommendation for automation/production, explains the config-global @id scope, and routes the mixed-scheme case to caddy_add_route. When-to-use and when-not-to-use are both present.

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