Discovery

Inspect the catalogue, agents, workflows, and entity schemas for an API key.

If you cannot run codegen yet, discover schemas at runtime and build forms from them. Prefer codegen once you have a stable deployment and API key.

Do not invent catalogue action ids or model ids. For a coding agent, prefer the CLI (tools list / tools get --json, and ai-connections list --json before defineAgent). lunnoa.actions.get(appId, actionId) only looks up one action you already know.

CLI (preferred for agents)

Same credentials as deploy (--url, --api-key, or LUNNOA_* / lunnoa.config). --json is the machine-readable form.

discover.sh
npx @lunnoa/client tools list --for-agent --json
npx @lunnoa/client tools search email --for-agent --json
npx @lunnoa/client tools get http_action_send-request --json
npx @lunnoa/client apps list --json
npx @lunnoa/client connections list --json
npx @lunnoa/client ai-connections list --json
npx @lunnoa/client agents list --json
npx @lunnoa/client workflows list --json
npx @lunnoa/client entity-types list --json
npx @lunnoa/client features --json

tools list is compact (appId, actionId, name, flags). tools get returns inputConfig, inputFields, and a defineAction sketch. ai-connections list returns each AI connection and the models[].id values that connection accepts. Use one of those ids as defineAgent({ model }) and pass that connection with defineAiConnection({ id }). Omitting aiConnection does not assign one. connections list is app connections (Gmail, HTTP), not model providers. Full command table: CLI.

List what the deployment offers (SDK)

discovery.ts
const features = await lunnoa.discovery.enabledFeatures();
const aiConnections = await lunnoa.aiConnections.list();

const agents = await lunnoa.agents.list({ expansion: ['description'] });
const workflows = await lunnoa.workflows.list({
  expansion: ['description', 'isActive'],
});
const entityTypes = await lunnoa.entityTypes.list({
  expansion: ['attributeSchema', 'stateSchema'],
});

Call discovery.enabledFeatures() early so you can hide areas the deployment's edition or infrastructure does not support.

Use the schemas

  • attributeSchema.sections[].fields[] defines each entity field (id, label, type, required). Build forms and tables from this.
  • stateSchema.states[] / transitions[] is the entity state machine. Prefer entities.getStateTransitions(id) for transitions valid now.
  • Manual-trigger input fields live on workflows.get(id, { expansion: ['triggerNode'] }) → triggerNode.value.customInputConfig. Declare the same fields at deploy time with defineTrigger({ inputs }). See Define locally.
  • Catalogue trigger ids come from npx @lunnoa/client apps get <appId> --json (triggers[].triggerId). Do not invent them.

Field types commonly include text, number, currency, date, boolean, and dropdown (with config.options). Always request the expansions you need: responses are minimal by default.

Next

  • CLI: tools list / tools get and deploy
  • Entities: create and update records from those schemas
  • Workflows: read trigger input config and run workflows
  • Codegen: replace runtime discovery with typed accessors