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
- Function calling
Function calling lets an LLM invoke external tools by emitting a structured request matching a function specification provided in the prompt.
- Tool use (LLM agent)
Tool use is the LLM-agent pattern in which the model has access to a defined set of tools — read file, search web, run code, query API — and decides which to invoke and with what arguments based on the user's request and the current state.
- Model Context Protocol (MCP)
Model Context Protocol is the open standard introduced by Anthropic in late 2024 for connecting LLM applications to external data sources and tools.