Add Relationship
add_relationshipDefine a directed relationship between two story entities to build the project's knowledge graph for character networks and relationship queries.
Instructions
Record a typed, directed relationship between two story entities (e.g. a character "mentors" another, or a character "appears in" a document) in the project story graph. Returns the stored edge with its generated id. Use this to build the knowledge graph that find_relationships, character_network, and discover_connections then query. Requires an open project with the relationship engine initialized.
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": {
"head": "<head>",
"headType": "<headType>",
"relation": "<relation>",
"tail": "<tail>",
"tailType": "<tailType>"
},
"name": "add_relationship"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| head | Yes | Name of the source entity, e.g. a character name like "Elena". | |
| tail | Yes | Name of the target entity the relationship points to. | |
| headType | Yes | Type of the source entity. | |
| relation | Yes | The relationship verb/label from head to tail, e.g. "mentors", "appears_in". | |
| tailType | Yes | Type of the target entity. |