execute_graphql_query
Execute a GraphQL query and optionally visualize the results
Describe what you want in words, get a GraphQL query, have it validated and corrected, then run it — with the query history kept.
LABSCO SUMMARY
Generated GraphQL fails in a predictable way — a field that does not exist, a required argument omitted — and a validator that returns an error leaves the model to guess again from the same starting point. Correcting in place closes the loop with one round trip. The query history is the underrated tool here: the expensive part of this workflow is arriving at a query that works, and being able to retrieve it later means that cost is paid once rather than each time the question comes up again. Note that generation costs OpenAI tokens per attempt, so a loop that regenerates rather than reusing history is spending real money.
A natural-language-to-GraphQL pipeline in five tools: generate a query from a description, validate and update it, execute it with optional visualisation, and read back examples and history.
OPENAI_API_KEY, plus GRAPHQL_ENDPOINT and GRAPHQL_API_KEY for the GraphQL API you want to query — generation runs on OpenAI, so calls bill against your account.
Build from source — git clone https://github.com/Arize-ai/text-to-graphql-mcp.git
USE CASES
Look at what kinds of question it supports, describe what you want, and let validation correct the query before it runs.
Execute the query with visualisation, rather than reading a JSON blob back into the conversation.
Pull it from history instead of regenerating it — generation costs tokens each time, retrieval does not.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
execute_graphql_queryExecute a GraphQL query and optionally visualize the results
generate_graphql_queryGenerate a GraphQL query from natural language description
get_query_examplesGet example queries to help users understand what they can ask for
Returns: JSON string containing example queries
get_query_historyRetrieve the history of all queries
Returns: JSON string containing all query history
validate_graphql_queryValidate and update a GraphQL query
BEFORE YOU INSTALL
5 tools when we connected. There is no separate schema-loading or cache tool; schema introspection happens inside generate_graphql_query.
All 3 documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 5 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
git clone https://github.com/Arize-ai/text-to-graphql-mcp.git
cd text-to-graphql-mcp
uv syncAdd the block for your client below, with --directory set to this folder and PATH starting with the directory that holds uv (run which uv to find it)
{
"mcpServers": {
"text-to-graphql": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_TEXT_TO_GRAPHQL_MCP>",
"run",
"text-to-graphql-mcp"
],
"env": {
"PATH": "<YOUR_PATH_TO_UV>/bin:/usr/bin:/bin",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>",
"GRAPHQL_ENDPOINT": "<YOUR_GRAPHQL_URL>/graphql",
"GRAPHQL_API_KEY": "<YOUR_GRAPHQL_API_KEY>",
"GRAPHQL_AUTH_TYPE": "bearer"
}
}
}
}{
"mcpServers": {
"text-to-graphql": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_TEXT_TO_GRAPHQL_MCP>",
"run",
"text-to-graphql-mcp"
],
"env": {
"PATH": "<YOUR_PATH_TO_UV>/bin:/usr/bin:/bin"
}
}
}
}