tigergraph__run_query
Run ad-hoc GSQL or openCypher queries on a TigerGraph graph without prior installation. Provide the query text to test or prototype, optionally specifying the target graph and connection profile.
Instructions
Run an interpreted query on a TigerGraph graph. Supports both GSQL and openCypher query languages. Use this for ad-hoc queries without needing to install them first.
Use When: • Running one-time or ad-hoc queries • Testing queries before installation • Simple data retrieval operations • Prototyping and exploration
Quick Start (GSQL):
{
"query_text": "INTERPRET QUERY () FOR GRAPH MyGraph { SELECT v FROM Person:v LIMIT 5; PRINT v; }"
}Quick Start (Cypher):
{
"query_text": "INTERPRET OPENCYPHER QUERY () FOR GRAPH MyGraph { MATCH (n:Person) RETURN n LIMIT 5 }"
}Common Workflow:
Call 'show_graph_details' to understand the schema
Write your query using vertex/edge types from schema
Run with 'run_query' to test
For repeated use, install with 'install_query'
Tips: • Query type auto-detected (GSQL vs Cypher) • For frequent queries, use 'install_query' + 'run_installed_query' for better performance • Always include 'FOR GRAPH' clause • Use LIMIT to avoid retrieving too much data
Warning: Syntax Notes:
• GSQL: INTERPRET QUERY () FOR GRAPH <name> { <statements> }
• Cypher: INTERPRET OPENCYPHER QUERY () FOR GRAPH <name> { <cypher> }
Related Tools: run_installed_query, install_query, get_neighbors
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Connection profile name. Omit to use the active default profile. Use 'list_connections' to see available profiles. | |
| graph_name | No | Name of the graph. If not provided, uses default connection. | |
| query_text | Yes | Query text to interpret and run. Supports both GSQL and openCypher queries. For GSQL: use 'INTERPRET QUERY () FOR GRAPH <graph> { <gsql_statements> }'. For openCypher: use 'INTERPRET OPENCYPHER QUERY () FOR GRAPH <graph> { <cypher_statements> }'. The query type is auto-detected based on the INTERPRET keyword used. Example (GSQL): `INTERPRET QUERY () FOR GRAPH MyGraph { SELECT v FROM Person:v }`Example (Cypher): `INTERPRET OPENCYPHER QUERY () FOR GRAPH MyGraph { MATCH (n) RETURN n LIMIT 5 }` |