Skip to content

Safely escape relation type, fix create and delete relation methods #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EthanKang1
Copy link

While testing the mcp-neo4j-memory with Claude, I ran into issues creating and deleting relations with the error

Invalid input '$': expected a node label/relationship type name, '%' or '(' (line 6, column 29 (offset: 204))

meaning $(relation.relationType) was being used directly in the Cypher query rather than substituting the value.

This pull request creates a _safe_relation_type method to sanitize the relationship type, and then uses string interpolation to form the query with the sanitized relation type. This methodology is used for both the create_relations and delete_relations method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant