Skip to main content
Glama

list_nodes

Read-onlyIdempotent

Lists ROS 2 graph nodes with names, namespaces, lifecycle status, and duplicate detection so agents can inspect the available ROS 2 node topology.

Instructions

ROS 2 graph only; on a DDS-only setup use list_participants. List the nodes on the ROS 2 graph (or the mock graph) from one ros2 node list call as a NodeListing: name, namespace, full_name, duplicate_count, lifecycle (managed node; state not read, lifecycle_note if unknown), by_namespace counts. duplicates lists full names used by several nodes (a per-node tool then answers for one of them, unidentified). Nodes starting with an underscore are hidden and a node on another ROS_DOMAIN_ID is invisible. Empty nodes when the graph has none. Use get_node_info for one node's interfaces. Raises an MCP error without a ros2 CLI. Cheap (two CLI calls). Duration: ROS lock, one call at a time, ends within 45 s; busy if held.

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": "list_nodes"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
noteNoOne sentence of context, or `None`.
nodesYesNodes on the graph, one entry per distinct full name, sorted by name.
totalYesDistinct node names on the graph (no cap applies).
returnedYesLength of `nodes`.
truncatedYesTrue when `returned` is less than `total` because of a cap.
duplicatesYesFull names that appear more than once on the graph. Empty when every name is unique.
by_namespaceNoDistinct full names per namespace (`/` is the root), sorted by namespace.
lifecycle_noteNoWhy `lifecycle` could not be determined (service list failed), else `None`.
mode_effectiveYes`live` or `mock` (fixtures).
lifecycle_countNoNodes with `lifecycle` true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • changedOutput schema / $defs / NodeListItem / properties / duplicate_count / description
      Previous value: -"Nodes using this exact full name; above 1, name-based tools answer for one of them."New value: +"Nodes using this exact full name (1: unique); above 1, name-based tools answer for one of them."
  2. Changed1 schema field changedv0.9.0
    • changedOutput schema / $defs / NodeListItem / properties / lifecycle / description
      Previous value: -"True when the graph has `<full_name>/get_state` of type `lifecycle_msgs/srv/GetState` (a managed node). The state itself is never read."New value: +"True when the graph has `<full_name>/get_state` (`lifecycle_msgs/srv/GetState`). The state itself is never read."
  3. Changed8 schema fields changedv0.8.0
    • addedOutput schema / $defs / NodeListItem / properties / lifecycle
      Added value: +{
      +  "description": "True when the graph has `<full_name>/get_state` of type `lifecycle_msgs/srv/GetState` (a managed node). The state itself is never read.",
      +  "type": "boolean"
      +}
    • removedOutput schema / description
      Removed value: -"Envelope returned by `list_nodes`."
    • addedOutput schema / properties / by_namespace
      Added value: +{
      +  "additionalProperties": {
      +    "type": "integer"
      +  },
      +  "description": "Distinct full names per namespace (`/` is the root), sorted by namespace.",
      +  "type": "object"
      +}
    • addedOutput schema / properties / lifecycle_count
      Added value: +{
      +  "description": "Nodes with `lifecycle` true.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / lifecycle_note
      Added value: +{
      +  "description": "Why `lifecycle` could not be determined (service list failed), else `None`.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • removedOutput schema / properties / note / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedOutput schema / properties / note / default
      Removed value: -null
    • addedOutput schema / properties / note / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  4. Addedv0.7.1

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the read-only/idempotent annotations: underscore-prefixed nodes are hidden, nodes on other `ROS_DOMAIN_ID`s are invisible, an empty `nodes` array means an empty graph, and the tool raises an MCP error without a `ros2` CLI. It also discloses the ROS lock (one call at a time, 45 s bound, `busy` when held), which is exactly the operational context annotations cannot carry.

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?

Front-loaded with the discriminating fact (ROS 2 vs DDS) and organized as scope, return shape, visibility caveats, errors, then cost. It is dense but nearly every clause carries signal; the bolded fragments and the stacked `Duration`/`Cheap` details read slightly crammed, costing a point.

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?

Even though an output schema exists, the description still explains the listing's shape, the `lifecycle`/`lifecycle_note` distinction, `duplicates` semantics, and what an empty result means. Combined with the hidden-node and CLI-dependency caveats, an agent has everything needed to call it and interpret the outcome.

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 tool takes no parameters and the schema is empty, so there is no parameter semantics to add; baseline for a zero-param tool applies. The description correctly spends its space on scope and failure modes instead of inventing inputs.

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?

States a specific verb and resource: lists ROS 2 graph nodes from one `ros2 node list` call into a `NodeListing`. It immediately distinguishes itself from `list_participants` for DDS-only setups and from `get_node_info` for single-node detail, so an agent can choose it without opening another schema.

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?

Explicit routing: ROS 2 graph only, use `list_participants` on a DDS-only setup, use `get_node_info` when you need one node's interfaces. It also names the case where a child tool answers for only one of several duplicate full names, which tells the agent when this listing is the right starting point.

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