GraphQL Tool
This tool provides agents the ability to easily execute GraphQL queries against a server. The tool can be initialized with the server url and any required headers and thereafter perform queries against the server
Usage
This tool has a more extensive example usage documented in a Jupyter notebook here
Here's an example usage of the GraphQLToolSpec.
This tool works best when the Agent has access to the GraphQL schema for the server. See here for an example of using a tool with a file loader to create even more powerful Agents.
from llama_index.tools.graphql import GraphQLToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
tool_spec = GraphQLToolSpec(
url="https://spacex-production.up.railway.app/",
headers={
"content-type": "application/json",
},
)
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
await agent.run(
"get the id, model, name and type of the Ships from the graphql endpoint"
)
graphql_request: Runs a GraphQL query against the configured server
This loader is designed to be used as a way to load data as a Tool in a Agent.
Metadata
Release files for llama-index-tools-graphql 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_tools_graphql-0.6.0.tar.gz | 3.9 kB | Without provenance | Details for llama_index_tools_graphql-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_tools_graphql-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_tools_graphql-0.6.0-py3-none-any.whl |
Total release size: 7.4 kB
Release files / llama_index_tools_graphql-0.6.0.tar.gz
| Download URL | llama_index_tools_graphql-0.6.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21fd05298a0e721db814013168ad6b7e79fd60554d628a1fa43ea4f2ea87e3ca
|
|
BLAKE2b-256 checksum How to use checksums |
32dc80986634ae2c736f7f059eb0878b05ebe227554ef98690042f63329d6235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_tools_graphql-0.6.0-py3-none-any.whl
| Download URL | llama_index_tools_graphql-0.6.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62be5ce888833efd04ceb7015653b7a964030497b58e28c14eab39afa12dc4ae
|
|
BLAKE2b-256 checksum How to use checksums |
e37e3a07c36f839c313faf8378fbb09aca39852589bf930b683be0a06eaa1b78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-tools-graphql 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.