> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcode.md).

# Use Code Tool in Duaer

Code Tool in Duaer is an AI or cluster node, often used with model, tool, or vector-store sub-nodes. Node note: Write a tool in JS or Python
## Code Tool in Duaer

Code Tool is used in Duaer’s AI or cluster features, often wired with chat-model, tool, or vector-store sub-nodes.

The product’s node note is: Write a tool in JS or Python.

## Credentials and parameters

Create the credential type this service needs under Credentials.

Parameters accept expressions. Tool parameters that an AI Agent should fill use $fromAI. When a run fails, read the error on the node output first.
## Questions

### How do you add Code Tool to a Duaer digital organization?

Open the node panel on the Duaer canvas, search for Code Tool, and drop it onto the digital organization. Connect it after a trigger or a previous node. If auth is required, save the credential first and select it on the node.

### What should you check first when Code Tool fails in Duaer?

Read the error text on that node’s output, then confirm the credential still works and required parameters are filled. For app nodes, also check permissions and quota on the provider side.

