The Call Function tool enables Atlas AI agents to call deployed Cognite Functions to run custom Python code. Use this tool when you want your agent to perform calculations, process data, integrate with external systems, or automate custom tasks.
The integration tools are not in production release status yet and may change.
Required capabilities
For the Call Function tool to work, the Atlas AI agent must have permission to call Cognite Functions. Grant these capabilities to the CDF group that the agent’s service principal belongs to.
| Capability | Required for |
|---|
functions:run | Calling a deployed function |
sessions:create | Establishing a session when calling the function |
If these capabilities are missing, the agent will fail to call the function. Confirm the capabilities are in place before adding the Call Function tool to your agent.
For more information on CDF capabilities and how to configure them, see Setup and administration.
When you add the Call Function tool to your agent in the Agent builder, complete these fields:
- Tool name: A name that identifies the tool’s purpose.
- Tool instructions: Instructions that tell the agent when and how to use this tool.
- Function name: The deployed Cognite function that the agent calls.
- Max polling time in seconds: The maximum time the agent waits for the function to complete. The default is 540 seconds.
- Schema: A JSON Schema that defines the structure of arguments that the agent passes to the function.
Each Call Function tool instance calls one function. To call multiple functions, add a separate Call Function tool to your agent for each function.
Defining the schema
The schema defines the arguments the function accepts. Your agent validates arguments against the schema before it calls the function.
Schema structure
This table describes the JSON schema keywords that you can use to define function arguments.
| Keyword | Description | Required |
|---|
type | Data type of the root object. Set to "object" | Yes |
properties | Object defining each parameter, including its type and description | Yes |
required | Array of property names that must be provided | No |
description | Human-readable text that helps the agent understand the parameter | No |
Schema example
This schema defines arguments for a function that retrieves Cognite Data Fusion (CDF) spaces. The items property accepts an array of objects that each contain a space identifier:
{
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "List of space-ids for the spaces to return.",
"items": {
"type": "object",
"properties": {
"space": {
"type": "string",
"description": "Ids for the spaces to perform operations on"
}
}
}
}
}
}
Use via API or SDK
When you call an agent with this tool enabled through the REST API or Python SDK, the agent will request confirmation before executing the function. Your application receives a toolConfirmation action in the response and must reply with ALLOW to proceed or DENY to cancel.
See Use Atlas AI agents via API and SDK for a complete example.