This plugin integrates GraphQL as a UTCP 1.0 communication protocol and call template. It supports discovery via schema introspection, authenticated calls, and header handling.
pip install gqlimport utcp_gql
utcp_gql.register()- Ensure the plugin is imported and registered:
import utcp_gql; utcp_gql.register(). - Add a manual in your client config:
{ "name": "my_graph", "call_template_type": "graphql", "url": "https://your.graphql/endpoint", "operation_type": "query", "headers": { "x-client": "utcp" }, "header_fields": ["x-session-id"] } - Call a tool:
await client.call_tool("my_graph.someQuery", {"id": "123", "x-session-id": "abc"})
- Tool names are prefixed by the manual name (e.g.,
my_graph.someQuery). - Headers merge static
headersplus whitelisted dynamic fields fromheader_fields. - Supported auth: API key, Basic auth, OAuth2 (client-credentials).
- Security: only
https://orhttp://localhost/http://127.0.0.1endpoints.
For UTCP core docs, see https://github.com/universal-tool-calling-protocol/python-utcp.