Skip to main content
Tools are how an agent interacts with the outside world. Kimi Hosted Agents supports three categories of tools: The built-in toolset is provided by default. Once you declare an MCP server on an agent, its tools become available to the model automatically; mcp_toolset declarations in tools are used to customize those tools’ settings. This page covers the built-in toolset, custom tools, and the shared schema loading modes across toolsets.

Built-in toolset

Built-in sandbox toolsets are versioned by release date. Two versions are currently available:
Built-in sandbox toolsets have been renamed from default_toolset_<date> to agent_toolset_<date>. The legacy name default_toolset_20260901 remains supported in requests and existing configurations as a deprecated alias for agent_toolset_20260901; use agent_toolset_20260901 or agent_toolset_20261101 in new requests.

agent_toolset_20261101 (default)

agent_toolset_20261101 is designed for coding and file-processing tasks, providing dedicated tools for file discovery, ranged reads, unique-match edits, and command execution:
agent_toolset_20261101 no longer includes ipython, todo_read / todo_write, or search_image_by_text / search_image_by_image. To search for images by keyword, attach the official search-image skill to your agent; the agent runs the skill’s script via bash to find images and download them into the sandbox. To keep using ipython, task checklists, or image search tools, explicitly select agent_toolset_20260901.

Comparison with agent_toolset_20260901

To customize built-in toolset settings—including per-tool overrides for enabled, permission_policy, result_hint, or load_mode—you must explicitly declare agent_toolset; without an explicit declaration, default settings apply and individual tools cannot be adjusted. Likewise, to disable sandbox tools altogether, explicitly declare the toolset and set default_config.enabled to false.

Toolset configuration and version pinning

The name of an agent_toolset accepts "agent_toolset_20261101" | "agent_toolset_20260901", plus the deprecated alias "default_toolset_20260901". Toolsets are selected and pinned according to the following rules:
  • New agents: When POST /v1/agents does not declare an agent_toolset (including omitting tools, passing an empty array, or declaring only custom / MCP tools), the platform prepends agent_toolset_20261101 to tools (counting toward the 128-item limit).
  • Existing versions stay unchanged: Saved agent versions keep their pinned toolset and do not switch automatically when the platform default changes or toolsets are renamed.
  • Updating agents or overriding session tools: When replacing an agent’s tools or setting a session’s agent_overrides.tools without an agent_toolset, the platform keeps the currently effective or bound agent’s agent_toolset, or prepends agent_toolset_20261101 if none exists. Updating an older agent version that lacks an agent_toolset without passing tools returns 400 failed_precondition_error; pass tools to pin a toolset explicitly.
  • At most one sandbox toolset: Each tools list can declare at most one sandbox toolset. Mixing agent_toolset_20260901 and agent_toolset_20261101 (including the default_toolset_20260901 alias) returns 400 invalid_parameter_error; declaring the same toolset (including via an alias) more than once uses only the first declaration without merging configurations. configs[].name must use a tool name from the selected toolset.
  • Legacy name compatibility: default_toolset_20260901 remains supported as a deprecated alias for agent_toolset_20260901; both refer to the same toolset (saved under the name you pass). Use agent_toolset_20260901 in new requests.
  • Self-hosted environments: Support both agent_toolset_20260901 (including the deprecated alias default_toolset_20260901) and agent_toolset_20261101.
default_config applies to every tool in the toolset, while configs overrides those defaults by tool name. Permission fields match Permissions: enabled controls whether a tool is exposed to the model, and permission_policy accepts always_allow or always_ask (defaulting to enabled and always_allow when unset). always_ask pauses execution after agent.tool_use and waits for the client to reply with user.tool_confirmation. Use enabled: false to disable a tool. The example below disables the entire built-in sandbox toolset:
MCP toolsets use mcp_toolset and reference an MCP server declared on the agent via mcp_server_name. They also support default_config and configs, where configs can override only tools actually exposed by that MCP server. Built-in sandbox tools are not configured in mcp_toolset—they remain managed under agent_toolset’s default_config and configs.

Limits and security boundaries

Built-in tools enforce limits on read/write sizes and execution duration. Calls that exceed a limit return a descriptive error result to the model—allowing the model to adapt its strategy (for example, reading a file in chunks) without interrupting the session:
Path parameters on file tools (such as the path for read / read_file) must be absolute paths inside cloud sandboxes. The tool parameter schema itself does not restrict OS path formats: self-hosted workers support ${KHA_WORKDIR}, paths relative to the working directory, and host OS paths (such as Windows paths). edit and edit_file are intended for plain UTF-8 text files only, not binary or non-UTF-8 content.
All file operations and process execution run inside the session’s cloud sandbox, and sandbox instances are isolated from one another. Instance-local files may be lost when a sandbox instance is recycled. Session workspaces, session files, and Memory mounted into the session persist across instances via asynchronous write-back, so the most recent writes not yet flushed before an instance exits may still be lost. For critical deliverables that must be retained permanently, call save_artifact to publish them explicitly as immutable artifact versions. After a sandbox instance is recreated, the platform automatically routes subsequent tool calls to the new instance with no client-side action required.

Sandbox networking and credentials

Outbound network access from sandbox processes is governed by the execution environment’s network policy, whereas platform-level tools are not directly restricted by that environment network policy. An environment can additionally configure a proxy to route designated outbound traffic through your own proxy server; configuring a proxy does not imply credential injection. Credential injection applies only to HTTP/HTTPS traffic (80/443) routed through the platform egress proxy; whether other ports are reachable depends on the network policy. Credentials stored in a Vault are never injected into all outbound requests indiscriminately—instead, they are injected or substituted based on credential type and matching rules: MCP credentials match by MCP server URL, while environment_variable credentials substitute placeholders in matching outbound requests according to each credential’s host allowlist and injection location settings.

Custom tools

Custom tools are executed by your client. Once you declare a custom tool in an agent’s tools array, the model can invoke it: the platform sends the tool name and input arguments over the event stream, your client executes the tool and submits the result, and the session resumes.

Declare custom tools

Add an entry with type set to "custom" in the tools array: tools can contain up to 128 declarations. Custom tool names must be unique and cannot collide with built-in tool names; if input_schema.type is not "object", agent creation fails with 400 invalid_parameter_error. The example below creates an agent that uses only the lookup_order custom tool, explicitly disabling the default built-in toolset so the model cannot select sandbox tools:
When a new agent omits agent_toolset, the platform loads the default built-in toolset agent_toolset_20261101 automatically. If your agent needs only custom tools, explicitly declare the built-in toolset with default_config.enabled: false as shown above.

Receive and execute tool calls

After creating the agent, follow Create a Session to create a session, subscribe to the Event Stream, and send a user message. When the model decides to call a custom tool, the event stream emits agent.custom_tool_use:
Execute the tool locally and return the result via POST /v1/sessions/{session_id}/events, passing the event’s id as event_id:
The endpoint returns 202 when the submission is accepted. content is an ordered array of tool result blocks; is_error indicates whether the tool call failed and defaults to false when omitted.

Waiting state and resumption

While waiting for the client to return a custom tool result or tool confirmation, the calling thread pauses execution. When no other threads in the session are running, the session.status event reports data.status as idle and data.stop_reason.type as requires_action. event_ids lists all pending event IDs—including both agent.custom_tool_use events awaiting custom tool results and agent.tool_use events awaiting confirmation:
Once every pending confirmation and custom tool result on that thread has been submitted, the thread resumes execution. Resubmitting an identical result is idempotent and does not produce a duplicate result; submitting a different result for an already-resolved call returns 409 conflict_error. In multi-agent sessions, waiting pauses only the calling thread: while other threads continue running, session-level session.status stays running, and the waiting state is reflected on that thread’s session.thread_status event instead. When session.status transitions to idle, event_ids aggregates pending events across all waiting threads in the session, whereas session.thread_status covers only its respective thread. For thread-level events, see Multi-Agent Orchestration.

Override tools for a single session

When creating a session, you can pass agent_overrides.tools to replace the entire tool configuration of the frozen agent version. Custom tools follow the same declaration and validation rules as on an agent:
tools uses full-replacement semantics rather than merging with the frozen agent version’s custom or MCP tool arrays. However, if the array omits agent_toolset, the platform keeps the agent_toolset declaration from the bound agent (or the currently effective one), or prepends agent_toolset_20261101 if none exists. When updating a session, passing tools: [] clears the tools override and inherits the bound agent’s tools again. This override affects only the current session and neither modifies the agent nor creates a new agent version.

Dynamic on-demand loading

As toolsets grow—especially when plugins bring large sets of MCP tools—inlining every tool schema into every model turn consumes significant context window space. Toolsets support two schema loading modes via load_mode: Among built-in toolsets, all tools in agent_toolset_20261101 default to eager. In agent_toolset_20260901, search_image_by_text and search_image_by_image default to on_demand, while all other tools default to eager. How on-demand loading works:
  1. The platform advertises the list of on_demand tool names to the model without their parameter schemas.
  2. The model calls the select_tools meta-tool by name to load the tools it needs, bringing their schemas into context.
  3. From that point on, the model calls those tools like any standard tool.
load_mode also supports two-level configuration: default_config.load_mode applies to the entire toolset, while load_mode inside configs overrides individual tools. Models that do not support on-demand loading automatically fall back to eager loading—behaving the same as when load_mode is unset, with no code changes required.
select_tools calls appear in the event stream as ordinary agent.tool_use events and require no special handling on the client. When a model or provider does not support on-demand loading, the platform falls back silently without raising errors.

Next steps

Connect MCP tools

Connect external tools and data sources to your agent via MCP servers.

Configure tool permissions

Learn how enabled and permission_policy govern tool execution.

Inspect tool call events

Subscribe to tool call and result events to track every step of execution.