neo4j-execute-cypher

A “neo4j-execute-cypher” tool executes any arbitrary Cypher statement against a Neo4j database.

About

A neo4j-execute-cypher tool executes an arbitrary Cypher query provided as a string parameter against a Neo4j database. It’s designed to be a flexible tool for interacting with the database when a pre-defined query is not sufficient. This tool is compatible with any of the following sources:

For security, the tool can be configured to be read-only. If the readOnly flag is set to true, the tool will analyze the incoming Cypher query and reject any write operations (like CREATE, MERGE, DELETE, etc.) before execution.

The Cypher query uses standard Neo4j Cypher syntax and supports all Cypher features, including pattern matching, filtering, and aggregation.

neo4j-execute-cypher takes one input parameter cypher and run the cypher query against the source.

Note: This tool is intended for developer assistant workflows with human-in-the-loop and shouldn’t be used for production agents.

Example

tools:
  query_neo4j:
    kind: neo4j-execute-cypher
    source: my-neo4j-prod-db
    readOnly: true
    description: |
      Use this tool to execute a Cypher query against the production database.
      Only read-only queries are allowed.
      Takes a single 'cypher' parameter containing the full query string.
      Example:
      {{
          "cypher": "MATCH (m:Movie {title: 'The Matrix'}) RETURN m.released"
      }}

Reference

fieldtyperequireddescription
kindstringtrueMust be “neo4j-cypher”.
sourcestringtrueName of the source the Cypher query should execute on.
descriptionstringtrueDescription of the tool that is passed to the LLM.
readOnlybooleanfalseIf set to true, the tool will reject any write operations in the Cypher query. Default is false.