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.
| Field | Presence | Shape |
|---|---|---|
inputs | Optional | propertyMap |
returns | Required | object |
impl | Required | object |
pure | Optional | boolean |
expose | Optional | expose |
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
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
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.
