| validate_x3dA | Validate an X3D XML string against the official X3D 4.0 schema. Use this tool to check if X3D XML content is valid before presenting it to users
or writing it to files. Catches errors in node names, attribute types, hierarchy
violations, and other schema constraint violations.
Args:
x3d_xml: A complete X3D XML document string, including the XML declaration
and X3D root element. Example minimal document:
<?xml version="1.0" encoding="UTF-8"?>
<X3D profile="Interchange" version="4.0"
xmlns:xsd="https://www.w3.org/2001/XMLSchema-instance"
xsd:noNamespaceSchemaLocation="https://www.web3d.org/specifications/x3d-4.0.xsd">
<Scene/>
</X3D>
|
| validate_x3d_file_toolA | Validate an X3D file on disk against the official X3D 4.0 schema. Use this tool to check existing .x3d files for schema compliance.
Only XML-encoded X3D files (.x3d extension) are supported.
Args:
filepath: Absolute path to a .x3d file on disk.
|
| x3d_node_infoA | Get detailed specification info about an X3D node. Returns the node's component, inheritance, all fields with types/defaults/constraints,
and a link to the official specification. Use this before generating X3D content
to ensure correct field names, types, and allowed values.
Args:
node_name: Exact X3D node name (case-sensitive). Examples: Box, Material,
Transform, IndexedFaceSet, Appearance, Viewpoint, DirectionalLight.
|
| x3d_search_nodesA | Search for X3D nodes by name or description. Use this when you don't know the exact node name. Searches both node names
and their descriptions in the X3D 4.0 spec.
Args:
query: Search term. Examples: "light", "texture", "animation", "sensor",
"geometry", "audio", "physics", "CAD".
|
| x3d_list_componentsA | List X3D components, or list all nodes in a specific component. Call with no arguments to see all available components.
Call with a component name to see all nodes in that component.
Args:
component_name: Optional component name. Examples: Geometry3D, Lighting,
Shape, Texturing, Navigation, Sound, HAnim.
Leave empty to list all components.
|
| x3d_list_profilesA | List all X3D profiles with descriptions. Profiles are capability tiers that define which components and nodes are available.
Common profiles: Core, Interchange, Interactive, Immersive, CADInterchange, Full.
|
| x3d_field_type_infoA | Explain an X3D field type or enumeration type. Use this to understand what values a field accepts.
Args:
field_type: An X3D field type (e.g., SFVec3f, MFString, SFColor, SFRotation)
or an enumeration type from the spec (e.g., alphaModeChoices,
fogTypeChoices).
|
| x3d_check_hierarchyA | Check if a parent-child node relationship is valid in X3D. Verifies whether a child node can be placed inside a parent node
based on the X3D 4.0 specification's type constraints.
Args:
parent_node: The parent node name (e.g., Transform, Scene, Appearance).
child_node: The child node name (e.g., Shape, Material, Box).
|
| x3d_scene_templateA | Generate a minimal valid X3D scene template. Returns a complete, valid X3D XML document with boilerplate already set up.
Use this as a starting point and modify the scene content as needed.
Args:
profile: X3D profile to use. Common choices:
- Interchange: basic geometry and appearance (recommended default)
- Interactive: adds sensors and user interaction
- Immersive: full VR-capable scenes
- Full: all X3D components
title: Optional scene title (added as metadata).
include_viewpoint: Whether to include a default Viewpoint node.
include_light: Whether to include a default DirectionalLight.
|
| x3d_generate_nodeA | Generate a single X3D node with specified field values. Uses the official x3d.py library (X3DPSAIL) to construct the node,
ensuring type correctness by construction. Returns the XML fragment
for the node.
Args:
node_name: The X3D node name. Examples: Box, Sphere, Material, Transform,
Viewpoint, DirectionalLight, IndexedFaceSet, ImageTexture.
fields: JSON string of field name-value pairs. Examples:
'{"size": [2, 3, 1]}' for Box
'{"diffuseColor": [1, 0, 0], "transparency": 0.5}' for Material
'{"translation": [1, 2, 0], "rotation": [0, 1, 0, 1.57]}' for Transform
'{"radius": 2.5}' for Sphere
'{}' for defaults
|
| x3d_add_nodeA | Insert an X3D node into an existing scene. Parses both the scene and the node XML, inserts the node at the specified
location, and returns the modified scene XML.
Args:
scene_xml: The complete X3D XML document to modify.
node_xml: The X3D node XML fragment to insert. Can be generated using
x3d_generate_node or written manually.
parent_def: Optional DEF name of the parent node. If provided, the node
is inserted as a child of the node with that DEF. If empty,
the node is added as a direct child of <Scene>.
|
| x3dom_pageA | Wrap X3D scene content in a complete X3DOM HTML page. Takes either a full X3D XML document or raw X3D scene nodes and produces
a standalone HTML page that renders the 3D scene in the browser using X3DOM.
X3DOM is a JavaScript framework that renders X3D content directly in web
browsers without plugins. This tool handles the HTML boilerplate, CDN includes,
and proper element structure.
Args:
x3d_content: Either a complete X3D XML document (the <Scene> content will
be extracted) or raw X3D node XML to place inside <scene>.
title: Page title shown in the browser tab and as a heading.
width: Width of the 3D viewport (CSS value, e.g., "800px", "100%").
height: Height of the 3D viewport (CSS value, e.g., "600px", "100vh").
show_stats: Show X3DOM rendering statistics overlay.
show_log: Show X3DOM log console overlay.
|
| x3dom_starterA | Generate a complete starter X3DOM HTML page with an example scene. Returns a ready-to-open HTML file with X3DOM loaded from CDN, a simple
3D scene (red cube with lighting and viewpoint), and clean styling.
Save the output as an .html file and open it in any modern browser. |
| x3d_parse_sceneA | Parse X3D content and display the scene graph as an indented tree. Shows every node in the scene hierarchy with its DEF name (if any) and
key attribute values. Use this to understand the structure of an existing
X3D scene before modifying or analyzing it.
Args:
x3d_source: Either an absolute file path to a .x3d file, or a complete
X3D XML document string. The tool auto-detects which.
|
| x3d_scene_statsA | Get statistics about an X3D scene: node counts by type and component. Returns total node count, DEF'd vs anonymous nodes, node type breakdown,
and grouping by X3D component (Geometry3D, Lighting, Shape, etc.).
Use this for a quick overview before diving deeper.
Args:
x3d_source: Either an absolute file path to a .x3d file, or a complete
X3D XML document string.
|
| x3d_list_defsA | List all DEF'd (named) nodes in an X3D scene. DEF names are unique identifiers assigned to nodes in X3D, similar to
HTML id attributes. Returns each DEF name with the node type, parent,
and children for context. Use this to find targets for x3d_extract_node
or x3d_add_node.
Args:
x3d_source: Either an absolute file path to a .x3d file, or a complete
X3D XML document string.
|
| x3d_extract_nodeA | Extract a specific node (and its children) from an X3D scene as XML. Identify the target node by its DEF name, or by node type + index. Returns
the full XML subtree of the matched node. If both def_name and node_type
are given, def_name takes precedence.
Args:
x3d_source: Either an absolute file path to a .x3d file, or a complete
X3D XML document string.
def_name: The DEF name of the node to extract (e.g., "RedSphere").
Use x3d_list_defs to see available names.
node_type: The X3D node type to extract (e.g., "Material", "Transform").
Combined with index to select which instance.
index: 0-based index when extracting by node_type. Default 0 (first match).
Use x3d_scene_stats to see how many of each type exist.
|
| x3d_modify_nodeA | Modify field values on a DEF'd node in an X3D scene. Finds the node by its DEF name and updates the specified attributes.
Returns the complete modified X3D XML document.
Args:
x3d_source: Complete X3D XML document string or file path.
def_name: The DEF name of the node to modify (e.g., "RedMat", "MainView").
field_changes: JSON string of field=value changes to apply.
Example: '{"diffuseColor": "0 1 0", "transparency": "0.5"}'
Values are set as XML attribute strings.
|
| x3d_remove_nodeA | Remove a node (and its children) from an X3D scene. Identifies the target by DEF name, or by node_type + index. Returns
the modified X3D XML document with the node removed.
Args:
x3d_source: Complete X3D XML document string or file path.
def_name: DEF name of the node to remove. Takes precedence over node_type.
Use x3d_list_defs to see available names.
node_type: Node type to remove (e.g., "DirectionalLight", "Transform").
Combined with index to select which instance.
index: 0-based index when removing by node_type. Default 0 (first match).
|
| x3d_move_nodeA | Reparent a node from its current parent to a new parent in the scene graph. Detaches the node (by DEF name) from its current location and appends it
as a child of the new parent. Detects and prevents cycles.
Args:
x3d_source: Complete X3D XML document string or file path.
def_name: DEF name of the node to move.
new_parent_def: DEF name of the new parent node. Leave empty to move
to be a direct child of <Scene>.
|
| x3d_semantic_checkA | Run semantic checks on an X3D scene beyond XSD schema validation. Detects common authoring issues that XSD cannot catch:
- Shape nodes missing geometry or appearance
- Empty grouping nodes (Transform, Group with no children)
- Duplicate DEF names
- USE referencing non-existent DEF
- ROUTE referencing invalid DEF names, fields, or mismatched types
- Missing Viewpoint
Returns a structured report of errors, warnings, and informational notes.
Args:
x3d_source: Complete X3D XML document string or file path.
|
| x3d_animateA | Generate a complete X3D animation chain and insert it into a scene. Creates a TimeSensor, the appropriate Interpolator (auto-selected based
on the target field's type), and ROUTE statements to wire them together.
Inserts all nodes into the scene and returns the modified X3D document.
Args:
x3d_source: Complete X3D XML document string or file path.
target_def: DEF name of the node to animate (e.g., "MyTransform").
field_name: Field to animate. Examples:
- "rotation" → OrientationInterpolator
- "translation" → PositionInterpolator
- "diffuseColor" → ColorInterpolator
- "transparency" → ScalarInterpolator
from_value: Starting value as a space-separated string (e.g., "0 1 0 0").
to_value: Ending value as a space-separated string (e.g., "0 1 0 6.283").
duration: Animation cycle duration in seconds. Default 5.0.
loop: Whether the animation loops continuously. Default True.
|
| x3d_routeA | Validate and insert a ROUTE statement into an X3D scene. ROUTEs connect event outputs to event inputs in X3D's event system.
This tool validates that both DEF names exist, field names are valid,
access types are compatible, and field types match before inserting.
Args:
x3d_source: Complete X3D XML document string or file path.
from_node: DEF name of the source node.
from_field: Output field on the source (must be outputOnly or inputOutput).
to_node: DEF name of the destination node.
to_field: Input field on the destination (must be inputOnly or inputOutput).
|
| x3d_animation_infoA | Explain X3D animation concepts and list available interpolators. Provides reference documentation about X3D's event-driven animation system.
Call with no topic for a general overview.
Args:
topic: Focus area. Options:
- "interpolators": list all interpolator nodes with field mappings
- "timesensor": TimeSensor fields and outputs reference
- "routes": ROUTE syntax, rules, and patterns
- "examples": common animation code patterns
- "": general overview of the animation system
|