Skip to main content
Glama

add_middleware

Add a new middleware to the Traefik dynamic middlewares file; Traefik hot-reloads the configuration automatically.

Instructions

Add a new middleware to traefik/dynamic/middlewares.yml (Traefik hot-reloads automatically)

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": {
      "name": "<name>",
      "type": "<type>",
      "config": "<config>"
    },
    "name": "add_middleware"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesMiddleware name
typeYesMiddleware type (headers, rateLimit, stripPrefix, etc.)
configYesConfiguration object for the middleware type

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden but does partially meet it: it discloses the persistence target and that Traefik hot-reloads automatically, so no restart is needed. It omits important mutation behavior — what happens if the name already exists, whether the targets file must pre-exist, and whether the config is validated before writing.

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?

A single front-loaded sentence with the target file and the hot-reload note; nothing is wasted or buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a write tool with no annotations, no output schema, and a free-form nested config object, the definition covers the target and reload semantics but leaves an agent guessing about duplicate-name behavior and how to determine a valid config shape.

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 coverage is 100%, so all three parameters are already documented in the schema, making 3 the baseline. The description adds no meaning beyond it, notably failing to note that the nested `config` object's shape depends on the chosen `type`.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (add a new middleware) plus the exact file it writes to, traefik/dynamic/middlewares.yml. That is far more concrete than a generic 'add' tool, though it does not explicitly distinguish itself from siblings like list_middlewares or list_middleware_types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no when-to-use guidance and no alternatives — it never points to list_middleware_types for discovering valid `type` values or to list_middlewares for checking existing entries. The only implied usage is the verb 'add' itself.

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