Skip to main content
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).