Skip to main content
Glama

set_link_state

Simulate physical link failure by suspending or restoring a link between network nodes. Use network_id to target the link and boolean to set its state, enabling fault injection testing.

Instructions

Bring a link up or down at the topology layer (physical-style fault injection). up=True restores the link, up=False suspends it. This is not the same as disabling an interface inside the device CLI -- the device sees its port go down, matching a real cable pull. Only affects running nodes.

Use the network_id from connect_nodes / get_lab. Current state is readable from get_lab (each ethernet has a suspend field: 1=suspended).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
upYes
network_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses key behaviors: up=True restores, up=False suspends, the device sees the port go down like a cable pull, and current state can be checked via get_lab's suspend field. This provides meaningful context beyond the bare schema, though it does not detail persistence behaviors or effects on stopped nodes beyond the 'only running nodes' note.

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?

The description is well-structured and front-loaded with the core purpose. Every sentence adds value: the up=True/False semantics, the contrast with CLI interface actions, the running-node caveat, and the get_lab state-check tip. It is concise without being under-specified.

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?

Despite having an output schema (which reduces the need to describe return values), the description fully covers the tool's context: what it does, how to execute it (param semantics), what to expect (port down / cable pull), and how to verify the result via get_lab. For a two-parameter tool, this is complete and self-sufficient.

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 input schema has only parameter names and types, with no descriptions. The description compensates fully by explaining the meaning of 'up' (True restores, False suspends) and the source of network_id (from connect_nodes / get_lab). This transforms the parameters from opaque flags into actionable instructions.

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's purpose: 'Bring a link up or down at the topology layer (physical-style fault injection).' It specifies the action (up/down), the resource (link), and the domain (topology layer), and distinguishes it from interface-level CLI operations, which establishes its unique role.

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

Usage Guidelines4/5

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

The description gives concrete guidance on when to use this tool (fault injection at topology layer) and where to get the required network_id ('Use the network_id from connect_nodes / get_lab'). It also contrasts with a non-sibling alternative (device CLI interface disable) and notes the limitation 'Only affects running nodes.' However, it does not explicitly mention sibling tools like set_link_quality as alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raybiko-lab/pnetlab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server