tigergraph__add_node
Upserts a single vertex into a TigerGraph graph by its primary key, creating it if absent or updating attributes if present. Specify vertex type, ID, and optional attributes to store or modify.
Instructions
Add a single node (vertex) to a TigerGraph graph. This performs an upsert operation - creates a new vertex if it doesn't exist, or updates attributes if it does.
Use When: • Creating a single new entity (user, product, document, etc.) • Updating an existing vertex's attributes • You have individual entities to add (not batch loading)
Quick Start:
{
"vertex_type": "Person",
"vertex_id": "user123",
"attributes": {"name": "Alice", "age": 30}
}Common Workflow:
Call 'show_graph_details' to understand vertex types and attributes
Use 'add_node' to create individual vertices
Call 'get_node' to verify the vertex was created
Use 'add_edge' to connect this vertex to others
Tips: • For multiple vertices: Use 'add_nodes' instead (more efficient) • Primary key is required (usually the 'id' attribute) • Attribute names must match the schema exactly (case-sensitive) • This is an upsert: existing vertices are updated, not duplicated
More Examples:
// Add a product
{
"vertex_type": "Product",
"vertex_id": "prod456",
"attributes": {"name": "Laptop", "price": 999.99, "category": "Electronics"}
}
// Add a document with minimal attributes
{
"vertex_type": "Document",
"vertex_id": "doc789",
"attributes": {"title": "Report Q4 2024"}
}Related Tools: • add_nodes - Batch insert multiple vertices • get_node - Retrieve a vertex by ID • delete_node - Remove a vertex • has_node - Check if vertex exists
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Connection profile name. Omit to use the active default profile. Use 'list_connections' to see available profiles. | |
| vertex_id | Yes | ID of the vertex (primary key value). Format: String or integer depending on schema. Example: 'user123', 'product_456', or 12345 Note: Must be unique within the vertex type. | |
| attributes | No | Vertex attributes as key-value pairs. Keys must match the vertex type schema. Values should match the expected data types. Example: {'name': 'Alice', 'age': 30, 'email': 'alice@example.com'} Tip: Use 'show_graph_details' to see required attributes and types. | |
| graph_name | No | Name of the graph. If not provided, uses the default connection. Tip: Use 'list_graphs' to see available graphs. | |
| vertex_type | Yes | Type of the vertex (must exist in graph schema). Example: 'Person', 'Product', 'Company' Tip: Use 'show_graph_details' to see available vertex types. |