docker_list_networks
View Docker network configurations to manage container connectivity and inspect driver and scope details.
Instructions
List Docker networks with driver and scope
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "docker_list_networks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/docker/networks.ts:4-21 (handler)The handler function that executes the docker_list_networks tool logic.
export async function listNetworks(): Promise<string> { const docker = getDockerClient(); const networks = await docker.listNetworks(); if (networks.length === 0) { return "No Docker networks found."; } const headers = ["NAME", "ID", "DRIVER", "SCOPE"]; const rows = networks.map((n) => [ n.Name, n.Id.substring(0, 12), n.Driver || "N/A", n.Scope || "N/A", ]); return `Docker networks:\n\n${formatTable(headers, rows)}`; } - src/tools/docker/index.ts:97-100 (registration)The registration of the docker_list_networks tool in the main index file.
name: "docker_list_networks", description: "List Docker networks with driver and scope", inputSchema: { type: "object" as const, properties: {} }, },