Z.ai API
Connect GigaRAG as an MCP tool in a GLM chat completions request.
Use it in code
The snippet has your key in it so it runs as pasted. Move it to an environment variable before the code is committed or shared.
- 1.
Add this to the tools array of your chat/completions request
{ "type": "mcp", "mcp": { "server_label": "gigarag", "server_url": "https://mcp.gigarag.com/mcp", "transport_type": "streamable-http", "headers": { "Authorization": "Bearer <api-key>" } } }
Check it worked
Send this once it is connected. An answer drawn from your workspace means the connection is live.
Run it. The model should answer with your GigaRAG buckets.
Written from the official docs: MCP calls