Code Tools let you define custom logic using JavaScript or Python that agents can invoke as part of a workflow. They bridge the gap between LLM reasoning and deterministic, programmatic operations, enabling your agents to reliably transform data, call APIs, or run business logic.Documentation Index
Fetch the complete documentation index at: https://koreai-v2-home-nav.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Step 1: Basic Info
Provide the basic details of the tool. Name: Unique identifier for the tool. Description: Briefly describe the tasks of the tool. This description is used by the LLM while selecting the tools for task execution.Step 2: Code and Config
Runtime: Select the execution environment for your tool’s code. Agent Platform supports JavaScript and Python. Code: Write the business logic for processing.- You must define a
main()function. This is the entry point the platform calls when the tool is invoked. - The
main()function must return a value. Example:return main($param). - Parameters are injected into the code using a customer_name` in your code.
| Field | Description |
|---|---|
| Name | The parameter name, prefixed with data). This is how you reference it in code. |
| Type | Data type - String, Number, Boolean, Object. |
| Required | Toggle whether this parameter must always be provided. |
| Description | A natural-language description sent to the LLM to explain what this parameter represents (e.g., “The customer’s full name”). This field is mandatory. |
| Default value | An optional fallback value that is used if the parameter is not supplied. |
- Return Type: Specifies the data type of the value your tool returns. This is used in the DSL signature and the LLM schema. Common values: object, string, array, and boolean. Default: object
- Memory (MB): The memory allocated to the tool’s isolated container during execution, in megabytes. Default: 256
- Timeout (ms): The maximum time (in milliseconds) the tool is allowed to run before it is terminated. Set this based on the expected complexity and latency of your tool’s logic. Default: 5000.
- Variable Namespace: Namespace that the tool can access. By default, every tool can access ‘Default’ namespace.