Skip to main content
Glama

why_best_path

Read-onlyIdempotent

Identify the BGP best path for a node and prefix from saved lab state and return the recorded selection reason; when no reason exists, it reports null instead of guessing.

Instructions

For one node and prefix, give the BGP best path and the reason stored in the data (FRR selectionReason, or the IOS-XE collector's derived reason). If the data has no reason, reason is null and a note says so; nothing is guessed. Read-only.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "node": "<node>",
      "prefix": "<prefix>"
    },
    "name": "why_best_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
vrfNoVRF, only needed when the prefix is in several VRFs
nodeYesNode name, e.g. r1
pathNoSame input as lab_state (optional here: the server was started with /app/demo/bgp-lp/frameB.json)
prefixYesPrefix, e.g. 8.8.8.0/24 (the length may be omitted when unambiguous)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / path / description
      Previous value: -"Same input as lab_state (optional here: the server was started with /app/demo/compose-bgp-lp/web/xray-states.js)"New value: +"Same input as lab_state (optional here: the server was started with /app/demo/bgp-lp/frameB.json)"
  2. Changed2 schema fields changed
    • changedInput schema / properties / path / description
      Previous value: -"Same input as lab_state"New value: +"Same input as lab_state (optional here: the server was started with /app/demo/compose-bgp-lp/web/xray-states.js)"
    • changedInput schema / required
      Previous value: -[
      -  "path",
      -  "node",
      -  "prefix"
      -]New value: +[
      +  "node",
      +  "prefix"
      +]
  3. First observedv1.4.3

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so the closing 'Read-only' adds little. However, the description adds real behavior beyond annotations: it discloses the provenance of the reason, that reason is null when absent, and that nothing is guessed. That no-fabrication guarantee is the kind of contract an agent needs before trusting the answer.

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?

Two compact sentences, front-loaded with the action and scope, then the reason semantics. 'Read-only' is redundant with annotations and could be trimmed, but nothing else is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only, four-parameter lookup with full schema coverage and no output schema, the description covers scope, data provenance, and the null-reason case. The absence of an output schema means the exact response shape is not described, but the key field semantics are stated. That is close to complete for this complexity.

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

Parameters3/5

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

Schema description coverage is 100%, so node, prefix, vrf, and path are already documented with examples. The description adds the one-node-one-prefix scope and that vrf matters only when the prefix appears in several VRFs, which is a small but genuine supplement. Most semantic weight still sits in the schema.

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 verb and resource: give the BGP best path for one node and prefix, plus the stored selection reason. It names the concrete data sources (FRR selectionReason, IOS-XE derived reason), which distinguishes it clearly from siblings like route_lookup or why_path.

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

Usage Guidelines3/5

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

The scope is implied: one node, one prefix, read-only explanation. There is no explicit statement of when to prefer this over why_path or route_lookup, and no exclusions. The agent can infer usage from the single-node/single-prefix framing, but the definition never routes between alternatives.

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