Skip to main content
GPTfy - Salesforce Native AI Platform

Function Calling

Function calling lets an LLM return a structured request to run a specific tool or action, turning natural language into reliable system operations.

What is function calling?

Function calling is the capability that lets a large language model (LLM) move beyond generating text and instead trigger real actions in connected systems. Given a user prompt and a list of available functions, the model decides which function is relevant, extracts the right parameters from natural language, and returns them as a structured output — usually a JSON object naming the function and its arguments.

A key detail: the LLM does not run the function itself. It only produces the structured "call." Your application receives that JSON, executes the actual function (a database query, an API request, a record update), and can pass the result back to the model so it can respond in plain language. This separation is what makes LLM function calling reliable enough for production workflows rather than just chat.

How it works

1. You define functions with names, descriptions, and a parameter schema. 2. The user sends a prompt (for example, "update this opportunity to Closed Won"). 3. The model returns a structured call: the function name plus extracted arguments. 4. Your code validates and executes the function against the real system. 5. The result is returned to the model, which writes a natural-language reply.

Function calling in Salesforce and GPTfy BYOM

Inside Salesforce, function calling is what turns an AI prompt into an actual CRM action instead of a wall of text. With GPTfy's Bring Your Own Model (BYOM) approach, your chosen LLM — Claude, GPT, Gemini — runs against Salesforce data with PII masking and enterprise guardrails, and function calling is the bridge to writes and lookups.

Concrete example: a rep types "summarize this account's open cases and create a follow-up task for next Tuesday." The model emits two structured calls — one to fetch related Case records, one to create a Task with the right `ActivityDate`. GPTfy executes both inside the org, so data stays governed and the action is auditable. Because functions are explicitly defined and scoped, the AI can only do what an admin has allowed — a safer alternative to open-ended automation.

FAQ

Does the LLM execute the function itself? No. The model only returns a structured request naming the function and its arguments. Your application (or GPTfy inside Salesforce) executes it, then optionally returns the result to the model.

How is function calling different from RAG? RAG retrieves text to ground an answer. Function calling triggers actions and structured operations — like creating a record or calling an API — and can be combined with retrieval.

Is function calling safe for Salesforce data? Yes, when scoped properly. Functions are explicitly defined and permissioned, so the model can only invoke approved actions. GPTfy adds PII masking and keeps execution inside the org.

See it in your Salesforce org

See Function Calling running in GPTfy

Book 30 minutes with a GPTfy engineer to see how Function Calling actually works inside a Salesforce org like yours.

Book a demo