Before you start
Before you start, sign in to the dashboard and select the organization you want to work in.- You need a role that can manage resources, such as Admin or Member.
- If the action will call a third-party toolkit such as Gmail, connect it first. See Connect a toolkit.
- For what a CodeKit toolkit is and how secrets and deployment fit together, read CodeKit overview.
Create a CodeKit toolkit
Open Tools and select Create Tool
Enter a Name, such as Order Lookup
Optional: fill in Description, then select Create Tool
The toolkit page
The toolkit page holds everything its actions share. Save stores the toolkit name, description, and logo.The Actions list
The Actions heading shows the count of actions. Search actions filters the list, and Add Action creates a new one. An empty toolkit shows No actions yet with a Create your first action button. Each row shows the action’s name, a deploy dot, its description, an enable switch, a Duplicate action button, a trash icon, and a chevron. Select the row to open the editor.Duplicate an action or a toolkit
Duplicate action on a row adds a copy of the action to the same toolkit. A "" duplicated message confirms. Duplicate toolkit is the copy icon on a CodeKit toolkit card on the Connected tab. It copies the toolkit with its actions, toolkit secrets, logo, and log privacy settings, then opens the copy. Every copied action starts switched off and not deployed. Deploy each copy before you turn it on.Create an action
Select Add Action
Enter a Name, such as Get order status
get_order_status.Enter a Description, then select Create Action
The action editor
The editor page has a Configure rail on the left and the code editor on the right.Header
The back link carries the toolkit name, and the heading shows the action name. A badge tracks the deployment: Draft, Building, Deploying, Built, Deployed, or Error. After a build, the bundle size and the last build time appear beside the badge.Details
Define inputs and outputs
The Input / Output Schema card shows one chip per property. Hover a chip to see its type, whether it is required, and how to read it in code, such asinput.order_number. Select Edit schema to open the Input / Output dialog.
type.
On the Inputs tab in the form, Add parameter adds a row. Each row takes a parameter name, a type, and a description, plus a Required switch. The types are string, number, integer, boolean, array, object, and null. An object parameter takes its own list of properties, and an array parameter takes an item type.
The description is required so the model understands the parameter. Confirm the row with the check button, then select Done. A saved row offers Edit, Duplicate, and Delete. The form shows up to five levels of nesting, and deeper levels are kept for the JSON view.
In the JSON view, Supported schema opens a guide to the accepted types and keywords, with an example. Its copy button copies the guide as Markdown. Anything outside the supported subset is flagged. The maximize button opens the editor in the Edit schema JSON dialog.
On the Outputs tab, successful and error are fixed. You pick the type of data and describe what the action returns. That description is required too. An object type lets you list the properties of data, so later steps can reference them by name.
For the example, add one required string parameter named order_number with the description “The order number the customer received in their confirmation email, for example ORD-1042”.
Add secrets
API keys and tokens belong in secrets, not in code. Your code reads a secret asenv.KEY.
IP_API_KEY.
Save secret stores it. Values are encrypted at rest.
Select any secret chip to open the Secrets dialog, which lists both scopes with a Toolkit or Action badge and a delete button. Deleting a toolkit secret removes it from every action.
Connect toolkits
A custom action can call the toolkits your organization has already connected. Select Connect on the Connected Toolkits card to open the Connect Toolkits dialog.toolkits.gmail, and the Types dialog shows the exact input and output of each action.
Write the code
The tab above the editor is named after the Action ID, such asget_order_status.ts.
tars and defines one run function that returns successful, data, and error. Your job is the body of run. Cmd+S on Mac or Ctrl+S on Windows saves from inside the editor.
The tars module gives you:
successful: false with a clear error for every failure you can foresee. The AI Agent gambit reads that message and can tell the end user what went wrong.
Save and deploy
Select Deploy
Wait for the Deployed badge
Turn on the action's switch on the toolkit page
Use the action from an agent
Open your agent's Make page and select the Tools tab in the gambit palette
Drag CodeKit onto the builder
Under Tool Selection, pick your toolkit in the CodeKit dropdown
Under Sub-tools, turn on the actions this gambit offers
Connect the tool gambit to an AI Agent gambit
object type for data in the output schema, with at least one property. See Workflow Mode.
