Skip to main content
An agent with hundreds of tools should not send every schema on every turn. Kimi K3 can add tools at any point in a conversation. Put the new definitions in a system message under tools. They become available from that position forward and calls come back in the standard OpenAI tool_calls response field.
Dynamic loading is available on Kimi K3 (morph-kimik3 and morph-kimik3-fast) through /v1/chat/completions. Other models still require tool definitions in the request’s top-level tools array.

Quick Start

This request declares Calculator after the user turn, then requires K3 to call an available tool:
The response uses the same shape as a tool declared at the top level:
Your application validates the arguments, executes the function, and returns its result in a tool message.

Load tools on demand

Keep a small discovery tool in the top-level tools array. When K3 calls it, search your registry and append the matching definitions as a dynamic declaration.
messages[].tools is a K3 extension to the OpenAI message schema. The Python SDK sends the extra dictionary field at runtime, but static type checkers and generated TypeScript types may not recognize it. Widen that message type locally or send the JSON request directly.

Message rules

A dynamic declaration must:
  • use role: "system";
  • contain a non-empty tools array of standard OpenAI function definitions; and
  • omit the content key entirely.
Do not send content: null. A declaration containing both content and tools returns HTTP 400. Static and dynamic tools can coexist. Keep universal tools such as search_tools in the top-level tools array, then append task-specific definitions in system messages. Each dynamic declaration extends the tools already available at that point in the conversation.

Choosing static or dynamic tools

Use top-level tools when the set is small and stable. Use dynamic loading when the full registry is large, tenant-specific, permission-dependent, or expensive to place in every request. Dynamic loading changes how schemas reach the model. It does not change execution security. Validate arguments, authorize the action for the current user, require approval for sensitive operations, and make side-effecting tools idempotent before executing a returned call.

See Also