Skip to content

WIT API Reference

package act:core@0.2.0;
type metadata = list<tuple<string, list<u8>>>;

Key-value pairs where keys are strings and values are CBOR-encoded bytes.

variant localized-string {
plain(string),
localized(list<tuple<string, string>>),
}

Use plain("text") for single-language components. Use localized with BCP 47 language tags for multi-language support.

record tool-definition {
name: string,
description: option<localized-string>,
input-schema: option<string>,
annotations: option<list<tuple<string, list<u8>>>>,
extensions: option<list<tuple<string, list<u8>>>>,
}
record tool-call {
name: string,
arguments: option<list<u8>>,
metadata: metadata,
extensions: option<list<tuple<string, list<u8>>>>,
}

Arguments are CBOR-encoded (RFC 8949), not JSON strings.

variant stream-event {
content(content-part),
error(tool-error),
metadata(list<tuple<string, list<u8>>>),
}
record content-part {
mime-type: option<string>,
data: option<list<u8>>,
annotations: option<list<tuple<string, list<u8>>>>,
extensions: option<list<tuple<string, list<u8>>>>,
}

Data encoding depends on mime-type:

  • text/* — UTF-8 encoded string
  • application/cbor — CBOR value
  • absent — opaque bytes
record tool-error {
kind: error-kind,
message: option<localized-string>,
extensions: option<list<tuple<string, list<u8>>>>,
}
variant error-kind {
not-found,
invalid-args,
timeout,
capability-denied,
internal,
other(string),
}

Transport adapters map these to protocol-specific codes (e.g., not-found → HTTP 404).

interface tool-provider {
get-metadata-schema: async func(metadata: metadata)
-> option<string>;
list-tools: async func(metadata: metadata)
-> result<list-tools-response, tool-error>;
call-tool: async func(call: tool-call)
-> stream<stream-event>;
}

Returns a JSON Schema object describing the metadata keys the component accepts. Returns none if the component doesn’t require any metadata.

For bridge components, call iteratively — pass partial metadata to discover additional required keys (e.g., a bridge needs a URL before it can describe the remote component’s schema).

Returns all available tool definitions. May vary depending on metadata (e.g., a bridge returns different tools depending on the connected service).

Executes a tool. Always returns a stream, even for simple results (single content event + stream close).

world act-world {
export tool-provider;
}

Component info is stored in the act:component WASM custom section (CBOR), not exported as a function.

See ACT-CONSTANTS.md for the full registry of std: keys.

KeyContextPurpose
std:skillcomponent-info metadataAgent instructions (markdown)
std:forwardtool-call metadataBridge forwarding blob
std:api-keymetadataAPI key for remote services
std:bearer-tokenmetadataBearer auth token
std:read-onlytool annotationsTool does not modify state
std:destructivetool annotationsTool may destroy data
std:idempotenttool annotationsSafe to retry
std:traceparentmetadataW3C Trace Context
std:request-idmetadataCorrelation ID