Skip to content

Error during dynamic creation of relationships. #44

Closed
@thomasgomell

Description

@thomasgomell

Hier die angepasste Ausgabe im gewünschten Template:


Expected Behavior (Mandatory)

Relations between nodes should be dynamically created without any errors. The type of relation should be set dynamically based on the provided input.

Actual Behavior (Mandatory)

Nodes are generated automatically without issues. However, the following error occurs when attempting to dynamically create relationships:

2025-05-18T13:19:56.272Z [neo4j-memory] [info] Message from client: {"method":"tools/call","params":{"name":"create_relations","arguments":{"relations":[{"source":"Berlin","target":"Deutschland","relationType":"IST_HAUPTSTADT_VON"}]}},"jsonrpc":"2.0","id":14}
Error handling tool call: {code: Neo.ClientError.Statement.SyntaxError} {message: Setting labels or types dynamically is not supported. (line 6, column 31 (offset: 206))
" MERGE (from)-[r:$(relation.relationType)]->(to)"
^}

How to Reproduce the Problem

Attempt to dynamically create relationships between nodes in Neo4j using a Cypher query with variable relationship types.

Simple Example

Datasets and Statements:

MERGE (from:Node {id: 1})
MERGE (to:Node {id: 2})
WITH from, to, {relationType: 'CONNECTED_TO'} as relation
MERGE (from)-[r:$(relation.relationType)]->(to)

Screenshots (where it's possible)

(Add screenshots if applicable.)

Specifications (Mandatory)

Currently used versions:5.25.1

Versions

  • OS: Windows
  • Library: mcp-neo4j-memory@0.1.3
  • Neo4j: 5.25.1 / 2025.04.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions