Skip to main content
Glama

topo_layout

Automatically arranges device coordinates in a .topo file using layout modes such as layered, tree, grid, ring, or custom zones. Removes the need to manually set x/y positions for each device.

Instructions

自动排布设备坐标,不用手工填 x/y。

Args: path: .topo 文件路径。 mode: 布局方式。

    - layered(默认):按连线关系自动分层,出口在上、终端在下,
      最贴近常见的园区网拓扑图。
    - tree:从 root 出发按层级展开。
    - grid:网格铺开,适合还没连线的时候。
    - ring:环形,适合环网。
groups: 只在 layered 下有效。手工指定每一层放哪些设备,
    例如 [["Internet"], ["AR1"], ["Core1","Core2"]]。
    没列进去的设备会自动补到最后一层。
root: 只在 tree 下有效,指定树根设备名。省略则挑连线最多的那台。
columns: 只在 grid 下有效,每行几台。省略则自动取平方根。
zones: 可选的分区列表。每项包含 title(或 name)、devices,可选
    color(#RRGGBB)和 columns。给了 zones 后会使用分区布局,
    mode/groups/root/columns 不再参与排布。
replace_annotations: 拓扑已有背景图形或文字时,是否明确清空并按 zones
    重建。默认拒绝覆盖,因为 eNSP 标注没有稳定 ID,无法可靠区分手工项。
include_unassigned: zones 未包含的设备是否自动放入“未分区”背景框,默认是。
zone_columns: 整体画布每行放几个分区;0 表示自动。
allow_annotation_desync: 普通布局遇到已有标注时是否仍移动设备。默认否,
    避免背景框和文字留在旧位置;仅在确认标注无需同步时才设为 true。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNolayered
pathYes
rootNo
zonesNo
groupsNo
columnsNo
zone_columnsNo
include_unassignedNo
replace_annotationsNo
allow_annotation_desyncNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: default mode is layered, defaults for missing parameters (root picks most connected device, columns uses square root), zones override other layout params, replace_annotations defaults to false to avoid overwriting due to unstable eNSP annotation IDs, include_unassigned defaults true, and allow_annotation_desync defaults false. It also explains why certain defaults exist (annotation ID instability). However, it doesn't explicitly state what happens to existing device positions when layout is applied (does it move all devices? only some?) or whether it returns any success/failure info, though the output schema may cover that. Slight gap but not a contradiction.

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 comprehensive but well-organized: starts with a one-line purpose, then breaks down each parameter with clear formatting (indented bullets and lists). It is longer than necessary for a simple tool but given the 10-parameter complexity, the structure is appropriate. It front-loads the core purpose and then details parameters in logical order. No redundant sentences, but could be slightly tightened (e.g., mode list could be more compact). Still, it earns high marks for structure.

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?

This is a complex tool with 10 parameters, 0% schema description coverage, and no annotations. The description covers every parameter, all modes, interactions, defaults, and safety concerns (annotation handling). It addresses edge cases (unassigned devices, annotation desync, default refusal to overwrite). Given the complexity, the description is remarkably complete – an agent can confidently select the right parameters and understand the tool's behavior without needing external info. The output schema exists, so return values are likely covered there.

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?

Schema description coverage is 0%, so the description must fully compensate. It does: each parameter gets a detailed explanation of its effect, valid values (mode enum with descriptions), constraints (only in certain modes), defaults, and examples (groups example). It also explains interaction between parameters (zones override mode/groups/root/columns). The description adds substantial meaning beyond the bare schema types, making it easy for an agent to know exactly what to pass.

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 automates device coordinate layout, avoiding manual x/y entry. It explicitly contrasts with manual placement and names the resource (.topo file). The verb '排布' (arrange/layout) plus '设备坐标' (device coordinates) and the distinction from manual entry make the purpose specific and unambiguous.

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 provides extensive usage guidance: it explains each mode with concrete scenarios (layered for typical campus networks, tree from root, grid for pre-connection, ring for ring networks), clarifies parameter applicability (groups only in layered, root only in tree, columns only in grid), and gives explicit when-not-to-use guidance (e.g., 'avoid overwriting annotations unless needed'). It even warns about annotation desync and default refusal, covering both when and when-not to use specific flags.

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