Mastering the use of tools is a key hallmark of intelligence, and the Kimi large language model is no exception. Tool Use or Function Calling is a crucial feature of the Kimi large language model. When invoking the API to use the model service, you can describe tools or functions in the Messages, and the Kimi large language model will intelligently select and output a JSON object containing the parameters required to call one or more functions, thus enabling the Kimi large language model to link and utilize external tools. Here is a simple example of tool invocation:Documentation Index
Fetch the complete documentation index at: https://platform.kimi.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.

tools field, we can add a list of optional tools.
Each tool in the list must include a type. Within the function structure, we need to include a name (which must follow this regular expression: ^[a-zA-Z_][a-zA-Z0-9-_]{2,63}$). A name that is an easily understandable English word is more likely to be accepted by the model. There should also be a description or enum. The description part explains what the tool can do, which helps the model make judgments and selections.
Each function also supports a strict parameter (boolean, optional) that controls whether the tool call arguments are strictly constrained according to the parameters JSON Schema:
true(default, omitting is equivalent totrue): The system strictly constrains output according to theparametersschema, which must conform to the MFJS specificationfalse(must be explicitly passed): Only guarantees output is a valid JSON object, without enforcing internal structure
function structure must have a parameters field. The root of parameters must be an object, and the content must be a subset of JSON Schema conforming to the MFJS specification.
The number of functions in tools currently cannot exceed 128.
If you encounter JSON Schema validation issues, please submit feedback at walle GitHub Issues.
Like other APIs, we can call it through the Chat API.