Skip to content
Back to skills

Using Iii

ASecurity

{/* TODO: Re-link worker references to https://workers.iii.dev/workers/<name> once the Worker Docs migration ships. */}

  • 18,821 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 3, 2026
developmenttypescriptpythonrustnodedocumentation

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 19 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add iii-hq/iii --skill using-iii --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Using Iii?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Using Iii
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/iii-hq-using-iii-c0f2aa0a/badge)](https://www.skillsdirectory.com/skills/iii-hq-using-iii-c0f2aa0a)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
<!-- generated by iii-skill-render. DO NOT EDIT (changes here are overwritten on the next render). Edit docs/0-13-0/using-iii/functions.mdx. -->

# Functions


{/* TODO: Re-link worker references to https://workers.iii.dev/workers/<name> once the Worker Docs migration ships. */}

## Invoking functions

A function runs when a trigger fires. The same function can be invoked from many trigger types at
once (direct CLI calls, an HTTP route, and a cron schedule, for example) without changing the
handler.

<Note>
  Some trigger types are: [`iii trigger`](./cli), [`worker.trigger`](./triggers),
  iii-http,
  iii-cron,
  iii-queue,
  iii-state,
  iii-stream.
</Note>

## Register a function

Inside a worker, `worker.registerFunction(id, handler)` makes a function callable from anywhere in
the iii system. The `id` follows the `service::name` form; the handler receives the call's payload
and returns the result.

<Tabs>
  <Tab title="Node / TypeScript">
    ```typescript
    import { registerWorker } from "iii-sdk";

    const worker = registerWorker(process.env.III_URL);

    worker.registerFunction("math::add", async (payload: { a: number; b: number }) => {
      return { c: payload.a + payload.b };
    });
    ```

  </Tab>
  <Tab title="Python">
    ```python
    import os
    from iii import register_worker, InitOptions

    worker = register_worker(
        os.environ.get("III_URL"),
        InitOptions(worker_name="math-worker"),
    )

    def add_handler(payload: dict) -> dict:
        return {"c": payload["a"] + payload["b"]}

    worker.register_function("math::add", add_handler)
    ```

  </Tab>
  <Tab title="Rust">
    ```rust
    use iii_sdk::{InitOptions, RegisterFunction, register_worker};

    let url = std::env::var("III_URL").expect("III_URL must be set");
    let worker = register_worker(&url, InitOptions::default());

    worker.register_function(RegisterFunction::new("math::add", |input: AddInput| {
        Ok(serde_json::json!({ "c": input.a + input.b }))
    }));
    ```

  </Tab>
</Tabs>

## Define request and response formats

Functions can carry JSON Schemas for their request payload and response shape. The schemas are
stored with the function and feed the iii console and the agent-readable skills.

<Note>
  Runtime validation is not yet supported. Attached schemas are metadata only; the engine does not
  reject payloads or responses that don't match. Treat the schemas as contract documentation for
  callers, agents, and the console until validation lands.
</Note>

<Note>
  For how to attach schemas when registering a function, see [Creating Workers /
  Functions](../creating-workers/functions#attach-request-and-response-schemas).
</Note>

## Invoke a function

<Note>
  For how to call a registered function from worker code or the terminal (with optional delivery
  actions like fire-and-forget or queue-routed), see
  [Triggers / Call a function directly](./triggers#call-a-function-directly).
</Note>

Files in this skill

  • channels.mdx5.5 KB
  • channels.mdx.skill.md5.5 KB
  • cli.mdx2.8 KB
  • cli.mdx.skill.md2.8 KB
  • console.mdx7.4 KB
  • console.mdx.skill.md7.4 KB
  • deployment.mdx3.2 KB
  • deployment.mdx.skill.md3.2 KB
  • engine.mdx2.5 KB
  • engine.mdx.skill.md2.3 KB
  • functions.mdx2.9 KB
  • functions.mdx.skill.md2.9 KB
  • triggers.mdx5.8 KB
  • triggers.mdx.skill.md5.8 KB
  • workers-registry.mdx1.6 KB
  • workers-registry.mdx.skill.md1.7 KB
  • workers.mdx6.9 KB
  • workers.mdx.skill.md6.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…