All glossary terms
Cross-cutting

Function spec (tool definition)

A function spec is the structured declaration that tells an LLM what a tool does, what arguments it takes, and what it returns — typically a JSON Schema describing parameters with name, type, and description. The spec is the model's only knowledge of the tool; quality of spec directly determines quality of tool use.

Function spec design is one of the highest-leverage activities in agent development. A well-written spec includes: a clear function name in domain language, a description that explains when to use it (not just what it does), parameter names that are self-documenting, parameter descriptions that disambiguate edge cases, required vs optional parameter markers, and enums for parameters with bounded values. The discipline borrows from API design: think about how the consumer (the LLM) will reason about which function to call from a list of dozens, and write specs that make the choice obvious. Modern MCP servers ship hundreds of specs; the well-designed ones are radically more usable than the ones treated as afterthoughts.

Related terms