Tool calling

Tool calling, also called function calling, is the way a language model asks the surrounding application to run a named function with structured arguments and then uses the result.

How tool calling works

The model never runs code itself. The loop is:

  1. The application tells the model which tools exist, each with a name, description, and JSON Schema for its arguments.
  2. The user asks for something.
  3. The model replies with a tool call: a tool name and arguments, instead of plain text.
  4. The application runs the tool and sends the result back.
  5. The model continues, possibly calling more tools, until it can answer.

The Model Context Protocol standardizes step 1 and step 4 across apps, so a tool defined once in an MCP server works in many clients.

An example

A user says, "Schedule the Bluesky post for tomorrow at 9." The model calls schedule_post with the draft ID and an ISO timestamp. The server checks permissions, stores the schedule, and returns a confirmation that the model reads back.

Why it matters for AI-agent publishing

Tool calling is what turns a chatbot into an AI agent. It also defines the limits: the model can only do what its tools allow, and the application decides whether each call is permitted.

So the safety of agent publishing rests on tool design, not on prompts. SocialHandoff's tools are split by permission. draft_post, schedule_post, and get_insights depend on the agent key's scopes, and approve_post works only with owner keys, so an agent calling it on its own draft is refused. See agent keys and permissions.

Let your agents post. Keep the final say.

Connect your first agent in minutes. Every draft waits in your inbox until you approve it.

14 days free. No card required.

The hosted version is opening soon

Leave your email and we will send one message when hosted accounts open, with your 14-day trial ready. Want it today? Self-host it free from the repo.

Start free trial