Guide

What is Function Calling?

Enabling LLMs to use external tools and APIs.

Function calling allows LLMs to output structured data that triggers external functions. Instead of just generating text, the model can request specific actions like API calls or database queries.

How It Works

  1. 1. Define available functions with schemas
  2. 2. LLM decides when to call functions
  3. 3. Model outputs structured function call
  4. 4. Your code executes the function
  5. 5. Result returned to LLM for response

Security Considerations

  • Validate all function parameters
  • Limit function permissions
  • Log all function calls
  • Watch for injection through parameters

Is function calling safe?

Function calling itself is safe, but the functions you expose may not be. Treat LLM-generated parameters as untrusted input.

Monitor function calls

Start Free