Skip to main content
Glama

get_segment_port_for_vm

Read-onlyIdempotent

Find the NSX segment ports attached to a VM by matching its VIFs, turning a VM name into its network topology to troubleshoot connectivity issues.

Instructions

[READ] Find which segment(s) a VM is attached to via its VIF attachments.

Start here for "why can this VM not reach the network?" — it is the only tool mapping a VM name onto NSX topology. Looks the VM up in the fabric inventory, fetches its VIFs, and matches segment ports by lport_attachment_id. Returns one dict (not the list envelope): VM info (external_id, host, power state) and matched_ports (segment id/name, port id/name). Matching is on exact display name, and empty matched_ports means no VIF is attached, not that the VM is missing.

Then get_logical_port_status on the segment it names. VM power and placement are not managed here — use vmware-aiops.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNoNSX Manager target from config (default if omitted).
vm_display_nameYesVM display name as shown in vCenter/NSX inventory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.8.16
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / target / description
      Added value: +"NSX Manager target from config (default if omitted)."
    • addedInput schema / properties / vm_display_name / description
      Added value: +"VM display name as shown in vCenter/NSX inventory."
  2. Changed3 schema fields changedv1.6.0
    • addedInput schema / properties / vm_display_name
      Added value: +{
      +  "title": "Vm Display Name",
      +  "type": "string"
      +}
    • removedInput schema / properties / vm_id
      Removed value: -{
      -  "title": "Vm Id",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "vm_id"
      -]New value: +[
      +  "vm_display_name"
      +]
  3. First observedv1.3.2

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the read-only annotations, the description discloses the return shape ('one dict, not the list envelope'), the exact-looking matching on display name, and the important empty-result semantics: empty matched_ports means no VIF is attached, not that the VM is missing. It also outlines the lookup/fetch/match mechanics.

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 dense but every sentence earns its place: the READ label, usage trigger, uniqueness claim, return format, matching rule, empty-result caveat, next step, and explicit exclusion. It is front-loaded with the core purpose and avoids filler.

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 no output schema, the description tells the agent what the returned dict contains and its structure. It also covers common interpretation pitfalls and routes the agent to the right follow-up tool, making the description complete for correct invocation and result handling.

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

Parameters4/5

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

The input schema already covers vm_display_name and target with 100% coverage, so the baseline is 3 from the schema. The description adds meaningful semantic value by emphasizing exact display-name matching and explaining what a missing match means, which helps the agent interpret the parameter's output behavior.

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 states a specific action and resource: exactly which segment port(s) a VM maps to via VIF attachments. It also differentiates itself from siblings by calling itself 'the only tool mapping a VM name onto NSX topology.'

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?

It explicitly frames when to start: 'Start here for "why can this VM not reach the network?"' It also tells the agent what to do next with get_logical_port_status, and explicitly excludes VM power/placement concerns by directing to vmware-aiops.

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