Grok InsiderBeta
ReleasesField NotesTutorialsCommunity
Sign in with X
ReleasesField NotesTutorialsCommunity

Tools · Function Calling

Function Calling

Define custom tools that the model can call to interact with external systems. Grok decides when to invoke a tool, you execute it, and the result is fed back so the model can answer with live data.

How It Works

Developer
Grok𝕏
User query with tool definition

"Is it warm in Palo Alto?"

get_weather(location)

Tool Call

get_weather("PA")

Tool Result

{ "temp": 72, "unit": "F" }

Model response

Yes — it's a warm 72°F in Palo Alto right now.

The loop

  1. 1. You send a user query plus your tool definitions.
  2. 2. Grok responds with a tool call instead of a final answer.
  3. 3. You execute the tool and return its result.
  4. 4. Grok uses the result to produce the final model response.
Grok Insider

The reunion point for the Grok & AI community. Builds, Field Notes, and priority help.

Grok Insider
  • Releases
  • Field Notes
  • Tutorials
  • Community
Resources
  • Changelogs
  • Getting started
Community
  • Ask & answer
  • Priority help (Premium)
© 2026 Grok InsiderCommunity mirror · not affiliated with xAI