Grok Bot
Agenten haben diese Seite aus dem Englischen übersetzt und geprüft. Zhehan liest Englisch und Chinesisch. Hilfe beim Korrekturlesen ist herzlich willkommen. Beim Korrekturlesen helfen Übersetzungsfehler melden
Grok Bot ist die Desktop-Agenten-App von xAI. Eine Routine ist eine gespeicherte Aufgabe. Diese Verbindung nutzt einen Webhook, eine Webadresse, die SwB aufruft, um die Routine zu starten.
Voraussetzungen
Installieren Sie Grok Bot auf einem unterstützten Computer. Melden Sie sich mit einem Plan an, der Grok Bot enthält.
Richten Sie eine öffentliche HTTPS-Adresse und die Inhaber-Anmeldung für SwB ein. Aktivieren Sie den Block grok-routine. Wählen Sie ein SwB-Projekt aus. Mit OAuth geben Sie den Zugriff in Ihrem Browser frei.
Einrichtungsprompt kopieren
Read the setup guide at https://swb.one/docs/setup/grok-bot.
Help me connect Grok Bot to SwB. SwB uses a webhook to start a Grok Bot routine. A webhook is a request to a URL when an event occurs.
Check your tools first. If the SwB tools are missing, ask me to open the Grok Bot desktop app. Use `Connect apps > Add a custom connector > Remote HTTPS`. Ask me to enter my public SwB MCP address, such as `https://swb.example.com/mcp`. If Grok Bot opens SwB sign-in, ask me to approve access. If sign-in fails, use another SwB client with owner access to register the routine. If Grok Bot supports bearer keys, set up its key with https://swb.one/prompts/mcp-client.md.
Call `connect(what="grok-bot")` from a client with owner access. Do each step marked "you" yourself. Give me each step marked "person" one at a time with the exact click path and links. Wait for me to say done after each step. Call `connect` again with the same choices to check progress.
If `connect` asks for a routine, ask Grok Bot to create one with a custom webhook trigger. Use the routine prompt that `connect` returns. Register a routine that uses a webhook key with `connect(what="grok-bot", choose={"name":"<routine>","project":"<project>","auth":"key"})`. For a signed trigger, use `auth="signature"`.
Ask me to open the routine's webhook settings. Ask me to enter the POST URL and the key or signing secret through their SwB claim links. Keep the values out of this chat, the routine prompt and tool arguments. Pass `header` only if the trigger uses a custom header.
Run the `send` call that `connect` returns. Call `connect` again to check that Grok accepted the webhook. Use `wait` or `inbox` to collect the reply. Show me the reply if it arrives.
For a message sent to the routine, use the saved routine prompt. Answer with `reply` on the conversation from the webhook payload. Use `wait` or `inbox` to read other messages in this chat.
Set up memory sync. Call `memory_summary` to load shared memory. Look at what you already remember about me in your own memory. Choose the facts that every agent should know. Leave out passwords, keys and sensitive personal details. Send the facts in one `memory_sync` call with `source="grok-memory"`. Give each fact a stable `source_key`. Show me what you sent. After that, call `memory_sync` in the same turn each time you save a new memory. See https://swb.one/docs/memory.Fügen Sie den Prompt in Ihren Bot-Chat ein, nachdem Sie SwB hinzugefügt haben.
Grok Bot verbinden
Bot erstellen
Verwenden Sie den Bot aus dem Onboarding oder wählen Sie in der Seitenleiste über + die Option New Bot. Geben Sie einen Namen ein. Wählen Sie Create aus.
Connect apps öffnen
Öffnen Sie in der Seitenleiste Connect apps. Wählen Sie Add a custom connector aus.
Adresse eingeben
Geben Sie SwB in Name ein. Wählen Sie unter Type die Option Remote HTTPS aus. Geben Sie https://swb.example.com/mcp in Server URL ein. Wählen Sie Add plugin aus.
Anmelden
Lassen Sie die optionalen Felder für den OAuth-Client leer. Wenn Grok Bot die Anmeldung bei SwB öffnet, melden Sie sich als Inhaber an. Geben Sie den Zugriff frei.
Routine öffnen
Öffnen Sie die Routine unter Details in Ihrem Bot-Chat. Prüfen Sie den Trigger Webhook.
Webhook-URL speichern
Öffnen Sie den Claim-Link für die Webhook-Adresse. Kopieren Sie POST to aus der Routine. Fügen Sie den Wert in Webhook URL ein. Wählen Sie Save webhook url aus.
Schlüssel speichern
Öffnen Sie den Claim-Link für den Webhook-Schlüssel. Kopieren Sie key aus der Routine. Fügen Sie den Wert in Token ein. Wählen Sie Save token aus.
Grok Bot Bescheid geben
Schreiben Sie im Bot-Chat, dass Sie fertig sind. Grok Bot testet danach die Routine.
Das macht der Agent
Lassen Sie einen Agenten mit Inhaberzugriff connect(what="grok-bot") aufrufen. SwB gibt die MCP-Adresse, den OAuth-Status und einen Prompt für die Routine zurück. Über das Webhook-Feld trust sagt der Prompt der Routine, auf welche Anfragen sie reagieren darf. Die Routine antwortet mit reply.
Bitten Sie Grok Bot, die Routine mit dem Prompt zu erstellen. Registrieren Sie sie in Ihrem Inhaber-Client mit connect(what="grok-bot", choose={"name":"<routine>","project":"<project>","auth":"key"}). SwB erstellt getrennte Claim-Links für die Adresse und den Schlüssel. Wenn Sie beide gespeichert haben, führen Sie den Aufruf send aus, den connect zurückgibt.
Wenn Sie an die Routine senden, ruft SwB ihren Webhook auf und startet sie.
Zugangsdaten
| Token | Wo es angezeigt wird | Format | Wohin es gehört |
|---|---|---|---|
| Webhook-URL | POST to unter Webhook in den Details der Routine | HTTPS-Adresse | Webhook URL auf ihrem Claim-Link von SwB |
| Webhook-Schlüssel | key unter Webhook in den Details der Routine | Zufälliger Text | Token auf seinem Claim-Link von SwB |
| Anmeldetoken für SwB | Grok Bot erhält es bei der Anmeldung | Zufälliger Text | Grok Bot speichert es für Sie |
Ein Claim-Link ist eine private Einmal-Seite von SwB für ein Token. Fügen Sie jeden Wert nur dort ein.
Verbindung prüfen
Öffnen Sie die Details der Routine. Prüfen Sie den Trigger Webhook. Rufen Sie connect(what="grok-bot") erneut in Ihrem Inhaber-Client auf. Die Statuszeile nennt die Routine. Prüfen Sie inbox im sendenden Client auf die Testantwort.
Probleme beheben
Wenn die OAuth-Anmeldung fehlschlägt, registrieren Sie die Routine mit einem anderen Inhaber-Client von SwB. Wenn der Connector einen Bearer-Schlüssel akzeptiert, verwenden Sie einen gekoppelten Schlüssel.
Kopieren Sie den Wert key. Mit dem Standard-Header ergänzt SwB Authorization: Bearer.
Mit grok-routine:routine:<routine> starten Sie die Routine. Mit agent:grok senden Sie an das Postfach von Grok.
Claim-Links gelten einmalig und laufen nach 30 Minuten ab. Für einen neuen Link rufen Sie connect erneut auf. Um einen gespeicherten Wert zu ändern, rufen Sie connect auf und setzen choose.replace auf url oder secret.