execute_gql
Execute custom GQL queries for graph traversal, aggregation, and mutations. Supports Cypher-compatible syntax for multi-hop patterns and data manipulation.
Instructions
Execute a GQL query against the graph database.
GQL (Graph Query Language) is the ISO/IEC standard query language. Use MATCH patterns to find nodes and relationships, INSERT to add data, and RETURN to project results.
Cypher syntax (e.g. CREATE) is automatically normalized to GQL (INSERT), so queries written in Cypher style will generally work as-is.
Use this tool when: you need to run a custom query — complex filters, multi-hop traversals, aggregations, or mutations beyond what the CRUD tools (create_node, create_edge) provide. Do NOT use this for: simple node lookups (use get_node), label browsing (use search_nodes_by_label), or one-hop exploration (use get_neighbors).
Args: query: A GQL query string (Cypher syntax is auto-normalized). limit: Maximum rows to return (default 100). Use to prevent overwhelming context windows. The query itself can also contain a LIMIT clause for server-side limiting.
Examples: MATCH (p:Person) RETURN p.name, p.age MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name, b.name INSERT (:Person {name: 'Alice', age: 30}) MATCH (p:Person) WHERE p.age > 25 RETURN p.name LIMIT 10
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |