Create and test Skills

Skills let an Action call a database, an HTTP API, or a custom JavaScript function. Skills belong to a workspace and can be reused by Actions in that workspace.


Prerequisites and permissions

Before you create a Skill:

  • Join the target workspace.
  • Create any database connection the Skill requires.
  • Have the endpoint URL, request schema, headers, or function definition needed by the selected Skill type.
  • Use an LLM and model that support tool calls when you attach the Skill to an Action.

The current app allows authenticated workspace members to create, edit, test, and delete workspace Skills. Klu-provided Skills can be tested, while their Edit form and destructive controls are hidden.


Create a Skill

Open Skills in the workspace navigation, then select Add Skill.

The current create drawer offers three types:

Skill typeUse it forConfiguration
SQL QueryRead data from a saved database connectionName and Connection
API RequestCall an HTTP endpointURL, method, JSON body, and headers
OpenAI Function CallDefine a callable schema and execute optional JavaScriptFunction definition and function code

Choose the Skill type first. Klu loads the metadata fields defined for that type and enables Add after required values are valid.

Create a SQL Query Skill

  1. Choose SQL Query.
  2. Enter a clear Name.
  3. Choose a saved database under Connection. Use the create option in that selector if you still need to add the database.
  4. Select Add.

When the Skill runs, it accepts a query string. Klu rejects writes, schema changes, multiple statements, and locking reads. Queries time out after 10 seconds, and eligible SQL reads are capped at 100 rows. See Manage connections for the complete runtime limits and supported database behavior.

Create an API Request Skill

  1. Choose API Request.
  2. Set URL to the full destination URL.
  3. Set Method, such as GET or POST.
  4. Add JSON when the endpoint accepts a request body.
  5. Add Headers as a valid JSON object when the endpoint requires them.
  6. Select Add.

The runtime parses Headers as JSON and returns the response body as text. Invalid header JSON fails with a validation error at run time. Network requests also pass through Klu's safe outbound-request checks, so blocked or unsafe destinations fail instead of being fetched.

Use obvious variable placeholders in metadata when a value should be provided at call time. A %{name} placeholder becomes an input field in the generated Skill schema.

Create an OpenAI Function Call Skill

  1. Choose OpenAI Function Call.
  2. Enter definition as valid JSON. It can be either a function object or a tool object whose type is function.
  3. Add function_code to execute JavaScript when the Skill is called.
  4. Select Add.

A minimal definition is:

Function definition

{
  "name": "format_customer",
  "description": "Format a customer record for display",
  "parameters": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "Customer name"
      }
    },
    "required": ["name"]
  }
}

The function code runs in Klu's isolated VM wrapper and can read context.variables, assign the result to context.result, and access only the packages explicitly placed in context.importedModules. The current source exposes Klu's embedding service there. Errors are returned as an Error running ... result. Arbitrary package imports and general server access are unavailable.

Function code

context.result = `Customer: ${context.variables.name}`

Test a Skill

Select a Skill from the Skills list, then open its Test tab.

  1. Complete every field marked (required). Klu derives these inputs from the Skill's function schema.
  2. Select Test Skill.
  3. Inspect the response displayed below the button.

If Klu cannot parse a Skill definition, the test form falls back to a required prompt input. Missing required fields produce Please fill in all required fields. A successful call with an empty result displays No response; provider, database, validation, network, and execution errors are shown in the response area.

Testing runs the Skill directly. It is the fastest way to verify credentials, variables, payload formatting, query permissions, and response shape before attaching the Skill to an Action.


Attach a Skill to an Action

Open the Action in Studio and add the Skill in the Action's Skills configuration. Save the Action after changing its Skill selection, then test the Action with a model that supports tool calls.

The model receives each attached Skill's name, description, and input schema. Clear names and descriptions help the model choose the correct tool and construct valid arguments. Keep Skills narrowly scoped when several tools are available to one Action.


Edit and delete a Skill

Open a user-created Skill and use the Edit tab to update its name, description, connection, or metadata. Test it again after changing credentials, schemas, URLs, headers, or executable code.

The Danger Zone contains Delete Skill name. Deletion is irreversible in the UI and can break Actions that still reference the Skill. Remove or replace those references before deletion.


Use Skills from the Python SDK

Create an API key under SettingsAPI Keys, install the SDK, and use the asynchronous client:

List and inspect Skills

import asyncio

from klu import Klu


async def main() -> None:
    klu = Klu("YOUR_API_KEY")
    skills = await klu.skills.list()

    for skill in skills:
        current = await klu.skills.get(skill.guid)
        print(current.guid, current.name)


asyncio.run(main())

The current Python SDK supports listing, getting, and deleting Skills. Its Skill create and update methods raise NotSupportedError, so create and edit Skills in the UI. The current TypeScript package contains an internal Skill client, while the public Klu class does not expose it.

See API and SDK basics for installation and authentication, and Actions API reference for attaching Skills to Actions through supported Action operations.