Skip to manual
gluon

GOL language

Function

A Function is a typed calculation over objects that you can offer in chat, the API and MCP.

Model author or developer

Where it goes

Contoso keeps RenewalRisk in domains/procurement/behaviour.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in PascalCase. The name must be unique within its domain across all type kinds.

Limits

The schema accepts cel, sql, wasm and remote implementations. Only cel runs today: calling a function of any other kind returns 501 not-supported.

Fields

The keys under spec. Nested shapes follow FunctionSpec in the GOL JSON Schema.

FieldPresenceShape
inputsOptionalpropertyMap
returnsRequiredobject
implRequiredobject
pureOptionalboolean
exposeOptionalexpose

Syntax and rules

The examples are fragments. Put them in a package next to the resources they reference. A ... stands for a CEL expression you write yourself.

9.3 Function

GOL · YAML
kind: Function
metadata: { name: RenewalRisk }
spec:
  inputs: { contract: Contract }
  returns: { type: double }
  impl: { kind: cel, expr: "..." } # cel | sql | wasm | remote
  pure: true
  expose: { chat: true, mcp: { tool: renewal_risk } }

Check your package

Shell
gluon validate examples/contoso
gluon test examples/contoso

validate reports each problem with a GLN code and its place in the file. test runs the package's Test resources. See the language guide and the diagnostics.

Contoso's RenewalRisk Function in the designer's YAML pane, with its validation status.
Contoso's RenewalRisk Function in the designer's YAML pane, with its validation status.