Skip to main content
Glama

caddy_reverse_proxy

Destructive

Add a reverse proxy route by specifying a source and upstream destinations; supply a stable id to update it idempotently or omit it to append.

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.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "caddy_reverse_proxy"
  }
}

Input 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. An http(s):// entry with a path, query or fragment is refused: a dial is host and port only, so rewrite the path with a separate handler instead.
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. Changed1 schema field changedv2.6.4
    • changedInput schema / properties / to / description
      Previous 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."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. An http(s):// entry with a path, query or fragment is refused: a dial is host and port only, so rewrite the path with a separate handler instead."
  2. 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
  3. First observedv2.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations, which only say readOnly=false, destructive=true, idempotent=false, openWorld=false. The description explains exactly how duplication arises, how replace-in-place works under an @id, that @ids are config-global and collisions with non-route objects cause a refusal rather than a clobber, that a registered @id makes the server argument irrelevant on later calls, and how https:// upstreams get a TLS transport on port 443. The annotation idempotentHint=false is consistent with the id-omitted default, so there is no contradiction.

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-loads the purpose and an example, then layers the idempotency rules, then edge cases, which is a sensible order for a dense topic. It is long and repeats some id/scheme semantics already present in the schema descriptions, but nearly every sentence carries operational consequence, so the length is defensible rather than padded.

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 4-parameter mutation tool with no output schema, the description covers everything an agent needs: idempotency behavior, duplicate-route hazard, @id collision refusal, cross-server update behavior, TLS/scheme handling, port defaults, and the mixed-scheme refusal with remediation. No meaningful gap remains that would cause a misinvocation.

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, and the description earns above that by adding meaning the schema does not: the concrete from/to example and the non-obvious fact that once an @id is bound to a route, later calls update it regardless of the server argument. It largely restates the id and to semantics already in the schema rather than adding new detail there, so it stops short of 5.

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?

Opens with a specific verb and resource ('Add a reverse proxy route') and immediately frames it as the primary entry point, distinguishing it from caddy_add_route which is mentioned as the fallback for mixed-scheme cases. An agent knows exactly what this tool creates without opening the 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?

Gives explicit when-to-use guidance ('The most common operation'), a concrete invocation example, a decision rule for the id parameter (omit = append/duplicate, supply = replace in place), and a recommendation ('Strongly recommended: supply a stable id for any route managed from automation'). It also names a sibling alternative for the mixed-scheme case, so the routing decision is fully specified.

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