Skip to content

Commit 3aed349

Browse files
author
Salman Mohammed
committed
Added gql 'how to use' guide in the README.md
1 parent 662d07d commit 3aed349

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed
Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
Find the UTCP readme at https://github.com/universal-tool-calling-protocol/python-utcp.
1+
2+
UTCP GraphQL Communication Protocol Plugin
3+
4+
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.
5+
6+
Getting Started
7+
8+
Installation
9+
10+
```bash
11+
pip install gql
12+
```
13+
14+
Registration
15+
16+
```python
17+
import utcp_gql
18+
utcp_gql.register()
19+
```
20+
21+
How To Use
22+
23+
- Ensure the plugin is imported and registered: `import utcp_gql; utcp_gql.register()`.
24+
- Add a manual in your client config:
25+
```json
26+
{
27+
"name": "my_graph",
28+
"call_template_type": "graphql",
29+
"url": "https://your.graphql/endpoint",
30+
"operation_type": "query",
31+
"headers": { "x-client": "utcp" },
32+
"header_fields": ["x-session-id"]
33+
}
34+
```
35+
- Call a tool:
36+
```python
37+
await client.call_tool("my_graph.someQuery", {"id": "123", "x-session-id": "abc"})
38+
```
39+
40+
Notes
41+
42+
- Tool names are prefixed by the manual name (e.g., `my_graph.someQuery`).
43+
- Headers merge static `headers` plus whitelisted dynamic fields from `header_fields`.
44+
- Supported auth: API key, Basic auth, OAuth2 (client-credentials).
45+
- Security: only `https://` or `http://localhost`/`http://127.0.0.1` endpoints.
46+
47+
For UTCP core docs, see https://github.com/universal-tool-calling-protocol/python-utcp.

0 commit comments

Comments
 (0)