Run a Cypher graph query
graph_queryRun Cypher against a property graph to answer relationship questions, traverse paths and neighbors, run graph algorithms, and write graph changes; returns result rows with execution time.
Instructions
Run Cypher against a database's property graph and return {rows, execution_time_ms}: read with MATCH, write with CREATE, MERGE, SET and DELETE, combine with UNWIND and UNION, and run graph algorithms with CALL gds.<algorithm>(...) YIELD ...; separate several statements with ;. Use it for relationship questions such as paths, neighbors and communities; use query for SQL tables. Write clauses change the graph permanently, and read-only API keys are refused for them.
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": {
"cypher": "<cypher>"
},
"name": "graph_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cypher | Yes | Cypher text with literal values written inline; separate multiple statements with `;`. | |
| params | No | Not used for binding; write values inline in `cypher`. | |
| database | No | Database whose graph to use (default main). | |
| graph_name | No | Reserved; queries always run on the selected database's graph. |