> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What is LLM tool calling (function calling)

> Tool calling lets an LLM ask for a function to run, with JSON arguments that follow a schema the application defines.

**Tool calling** (or **function calling**) is a language model's ability to answer with a structured request to run a
function: the tool's name and its arguments in JSON, following a schema (usually JSON Schema) that the application
defines. The model runs nothing itself: the application executes the function and returns the result so the model can
continue.

## Why it matters when generating documents with AI

* It lets the model decide when a document is needed and request it with the right parameters (format, content,
  style).
* The schema limits what the model can ask for, and the application can validate the arguments before running
  anything.
* The result sent back to the model uses context: a short summary (status and link) is better than the whole file.
* Errors returned as results, with a clear code, let the model fix its call.

## With Doconda

`doconda.tools()` gives you the tools ready for function calling with Claude, OpenAI, Gemini, Mistral, Bedrock,
Vertex AI or the AI SDK; they are JSON Schema, so they work as they are. Each tool returns a short summary with status
and links, and errors come with a code the agent can understand ([MCP server](/en/agents/mcp)).

## Related

* [What is MCP](/en/glossary/mcp)
* [What is an AI agent](/en/glossary/ai-agent)
* [Structured output vs file output](/en/glossary/structured-output)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.