MCP-Slicer

list_nodes

Retrieve MRML node information (names, IDs, or properties) using the Slicer Web Server API. Filter nodes by class name, name, or ID for precise data retrieval.

Instructions

List MRML nodes via the Slicer Web Server API.

The filter_type parameter specifies the type of node information to retrieve. Possible values include "names" (node names), "ids" (node IDs), and "properties" (node properties). The default value is "names".

The class_name, name, and id parameters are optional and can be used to further filter nodes. The class_name parameter allows filtering nodes by class name. The name parameter allows filtering nodes by name. The id parameter allows filtering nodes by ID.

Examples:

  • List the names of all nodes: {"tool": "list_nodes", "arguments": {"filter_type": "names"}}
  • List the IDs of nodes of a specific class: {"tool": "list_nodes", "arguments": {"filter_type": "ids", "class_name": "vtkMRMLModelNode"}}
  • List the properties of nodes with a specific name: {"tool": "list_nodes", "arguments": {"filter_type": "properties", "name": "MyModel"}}
  • List nodes with a specific ID: {"tool": "list_nodes", "arguments": {"filter_type": "ids", "id": "vtkMRMLModelNode123"}}

Returns a dictionary containing node information. If filter_type is "names" or "ids", the returned dictionary contains a "nodes" key, whose value is a list containing node names or IDs. Example: {"nodes": ["node1", "node2", ...]} or {"nodes": ["id1", "id2", ...]} If filter_type is "properties", the returned dictionary contains a "nodes" key, whose value is a dictionary containing node properties. Example: {"nodes": {"node1": {"property1": "value1", "property2": "value2"}, ...}} If an error occurs, a dictionary containing an "error" key is returned, whose value is a string describing the error.

Input Schema

NameRequiredDescriptionDefault
class_nameNo
filter_typeNonames
idNo
nameNo

Input Schema (JSON Schema)

{ "properties": { "class_name": { "default": null, "title": "Class Name", "type": "string" }, "filter_type": { "default": "names", "title": "Filter Type", "type": "string" }, "id": { "default": null, "title": "Id", "type": "string" }, "name": { "default": null, "title": "Name", "type": "string" } }, "title": "list_nodesArguments", "type": "object" }

You must be authenticated.

Other Tools from MCP-Slicer

Related Tools

ID: kn2cl0hh2g