Skip to main content
Glama

network_prune

DestructiveIdempotent

Remove unused Docker networks that have no active container endpoints, excluding built-in networks. Use filters like age or label to target specific networks for cleanup.

Instructions

Remove networks that have no active container endpoints.

Built-in networks (bridge, host, none) are never removed. Only networks with zero connected containers are eligible. Valid filter keys: until (RFC3339 timestamp or duration - removes networks created before that point), label (key or key=value). Use network_remove to delete one specific network instead.

Args: filters: Narrow which networks to remove; omit to remove all unused custom networks

Returns: dict: {"NetworksDeleted": [...]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filtersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already mark destructiveHint and idempotentHint. The description adds valuable behavioral context: built-in networks are never removed, only networks with zero connected containers are eligible, and filter semantics. This goes beyond the annotations by clarifying safety and selection criteria, though it doesn't mention permission requirements or rate limits, which are less critical for this tool.

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 efficient and well-structured: it leads with the core purpose, then safety and selection rules, then filters and alternative, then args and return. It's a bit longer than the minimum but every sentence adds value and it's not redundant. Slight room for tightening, but overall very good.

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?

Given there is no output schema, the description includes the return format ({"NetworksDeleted": [...]}). It also covers the filter options, the safety exclusions, and the alternative tool. This is complete for an agent to invoke the tool correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has one object parameter with no description (0% coverage). The description fully compensates by explaining the filter keys: 'until' (with format details) and 'label' (key or key=value), and that omitting filters removes all unused custom networks. This gives the agent everything needed to use the parameter correctly.

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 clearly states the tool removes networks with no active container endpoints, and explicitly differentiates from network_remove which deletes one specific network. It also clarifies the scope (only custom networks, built-ins are exempt), making the purpose unambiguous and distinguishable 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?

The description gives explicit when-to-use guidance: it's for pruning unused custom networks, and directly tells the agent to use network_remove for deleting a single specific network. It also explains the optional filters and how omitting them removes all unused custom networks, covering both use cases and alternatives.

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

Deploy Server

Other Tools