Skip to main content
Glama

caddy_adapt

Read-onlyIdempotent

Convert Caddyfile, nginx, or yaml configs to Caddy JSON for preview or migration. Returns adapted JSON and warnings without loading the config into Caddy.

Instructions

Convert a config in any registered adapter format to Caddy JSON without loading it. Useful for previewing what a Caddyfile produces, or for porting from nginx/yaml configs when Caddy is built with the matching adapter module ('caddyfile' is built-in; 'nginx', 'yaml', etc. require their adapter modules to be compiled into the Caddy binary). Returns the adapted JSON and any warnings separately. One exception to 'without loading it': on Caddy <= 2.11.4 a Caddyfile 'order' global option is not preview-only. It mutates that Caddy process's directive order, so it carries into every later Caddyfile adapt or load there, and an 'order' line that FAILS (unknown target, bad positional, extra arg) still removes the directive it names -- later Caddyfiles using that directive then fail with "directive 'X' is not an ordered HTTP handler" until another 'order' line re-places it or Caddy restarts. Fixed upstream in caddyserver/caddy#7995, unreleased as of v2.11.4.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
configYesThe raw config text (e.g., Caddyfile contents, nginx.conf, yaml)
adapterNoConfig format adapter. Must match an adapter Caddy was built with. Built-in: 'caddyfile' (default). Common external adapters: 'nginx' (caddy-nginx-adapter), 'yaml' (caddy-yaml).caddyfile

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds a crucial behavioral caveat: on Caddy <= 2.11.4, the 'order' global option mutates the process's directive order despite the preview-only claim. This goes beyond annotations and is essential for correct usage. It also explains the return format (adapted JSON and warnings).

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?

The description is long, but every part earns its place: the core purpose, the usage context, and the version-specific caveat. It is front-loaded with the primary action, and the detailed exception is justified because it materially affects behavior. Slightly dense but not verbose.

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 tool with a subtle mutation risk, the description covers the version-specific behavior, the return value (adapted JSON plus warnings), and adapter requirements. There is no output schema, so the description correctly explains what the agent will receive. Nothing essential is missing for safe invocation.

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% with descriptions for both config and adapter, so the baseline is 3. The description adds context about adapter module availability (built-in vs. compiled external modules), which complements the schema and helps the agent choose the right adapter. Not a large addition but useful.

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 clear verb+resource: 'Convert a config in any registered adapter format to Caddy JSON without loading it.' It distinguishes itself from siblings like caddy_load by explicitly stating 'without loading it', so an agent can tell it apart immediately.

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 states when to use the tool ('previewing what a Caddyfile produces, or for porting from nginx/yaml configs') and specifies the adapter module prerequisite. It also warns about the 'order' mutation on older versions, effectively covering a when-not-to-trust-preview-only scenario.

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