caddy_add_route
Add a route to your Caddy server with full control over match conditions and handlers. Configure reverse proxies, file servers, redirects, headers, and more in one call.
Instructions
Add a route with full control over match conditions and handlers. Supports any Caddy handler (reverse_proxy, file_server, static_response, redirect, encode, headers, etc.).
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": {
"match": "<match>",
"handle": "<handle>"
},
"name": "caddy_add_route"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match | Yes | Array of match objects (e.g., [{ host: ['example.com'], path: ['/api/*'] }]) | |
| handle | Yes | Array of handler objects (e.g., [{ handler: 'file_server', root: '/var/www' }]) | |
| server | No | Caddy server name (default: srv0) | srv0 |
| terminal | No | Stop processing further routes after this one matches |