Manifest reference
The manifest lists the tools a game exposes to a player’s agent. This page is generated from the validator, so it matches the code. The format is described in prose in Manifest, and a machine readable JSON Schema is generated next to this page.
Check a file with gwctl validate manifest.yaml. The validator reports every problem at once.
Manifest
Section titled “Manifest”The top-level document. JSON or YAML. Unknown fields and duplicate keys are rejected.
| Field | Type | Required | Meaning |
|---|---|---|---|
version |
integer | yes | Format version. Must be 1. |
game |
string | no | A label for the game, shown in logs. |
tools |
array of object | yes | The tools the agent may call. At least one. |
One capability a player’s agent may call.
| Field | Type | Required | Meaning |
|---|---|---|---|
name |
string | yes | Tool name, unique in the manifest. Must match the name pattern below. |
description |
string | yes | What the tool does, written for the agent. Must not be blank. |
tier |
string | yes | Risk class. Decides which policy controls apply. See tiers below. |
caps |
object | no | Per-tool limits. |
confirm |
boolean | no | When true, every call needs the player’s approval first. Not allowed on read tools. |
backend |
string | no | How the call reaches the game: http (default) or relay. |
http |
object | http backend only | Maps the tool onto a backend REST endpoint. Required for http tools, must be absent (or empty) for relay tools. |
params |
object | no | The tool’s arguments, by name. Calls with other arguments are refused. |
Optional per-tool limits. Zero or absent means not set. Read tools take no daily caps.
| Field | Type | Required | Meaning |
|---|---|---|---|
per_day_calls |
integer | no | Most successful calls per player per day. |
per_day_amount |
integer | no | Most units per player per day. Needs amount_param. |
amount_param |
string | with per_day_amount | Name of an integer param whose value is added to the daily amount. |
cooldown_seconds |
integer | no | Seconds a player must wait after a successful call. |
Maps a tool onto a REST endpoint.
| Field | Type | Required | Meaning |
|---|---|---|---|
method |
string | yes | HTTP method. |
url |
string | yes | A path starting with /. {name} placeholders take their value from the param of the same name. |
params.
Section titled “params.”One tool argument. The key in params is the argument name.
| Field | Type | Required | Meaning |
|---|---|---|---|
type |
string | yes | Argument type. |
enum |
array of string | no | Allowed values. Strings only. Matching is exact. |
min |
integer | no | Smallest allowed value. Numbers only. |
max |
integer | no | Largest allowed value. Numbers only. |
optional |
boolean | no | When true the argument may be left out. |
| Tier | Meaning |
|---|---|
read |
State, prices, advice. Rate limit only. Allowed for coach and operator grants. |
safe |
Same rules as a human player. Cooldowns and rate limit apply. |
medium |
Spends in-game currency. Daily caps apply. |
sensitive |
Paid currency, gifts, deletion. Disabled: every call is refused with tier_disabled. |
Backends
Section titled “Backends”| Backend | Meaning |
|---|---|
http |
Signed REST call to the studio’s backend (levels 0 and 1). The default. |
relay |
Call sent over the player’s game client WebSocket (see the relay section of the protocol page). Takes no http binding. |
- Tool names match
^[a-z][a-z0-9_]{1,63}$(lowercase, digits and underscores, 2 to 64 characters, starting with a letter) and are unique. http.methodis one ofDELETE,GET,PATCH,POST,PUT.http.urlstarts with/. Every{name}placeholder needs a param of that name. Placeholder values that are empty,.or..are refused at call time.- Param
typeis one ofboolean,integer,number,string.enumapplies tostringparams only.minandmaxapply tointegerandnumberparams only, andminmust not exceedmax. caps.per_day_amountneedscaps.amount_paramnaming anintegerparam.capsvalues must not be negative.readtools cannot setconfirmand take noper_day_amountorper_day_calls.relaytools take nohttpbinding.- A YAML manifest is read up to 4 MiB. The studio upload endpoint accepts up to 1 MiB.
- At call time a string argument is at most 4096 bytes.
Example
Section titled “Example”YAML is the recommended authoring format:
version: 1game: city-demotools: - name: get_city_state description: Overview of the city. tier: read http: {method: GET, url: /api/v1/city}
- name: sell_resource description: Sell a resource at the current price. tier: medium caps: {per_day_amount: 300, amount_param: quantity} http: {method: POST, url: /api/v1/market/sell} params: resource: {type: string, enum: [food, water]} quantity: {type: integer, min: 1, max: 1000}The same manifest as JSON, which is what the gateway stores and what PUT /v1/studio/manifest returns:
{ "version": 1, "game": "city-demo", "tools": [ { "name": "get_city_state", "description": "Overview of the city.", "tier": "read", "caps": {}, "http": { "method": "GET", "url": "/api/v1/city" } }, { "name": "sell_resource", "description": "Sell a resource at the current price.", "tier": "medium", "caps": { "per_day_amount": 300, "amount_param": "quantity" }, "http": { "method": "POST", "url": "/api/v1/market/sell" }, "params": { "quantity": { "type": "integer", "min": 1, "max": 1000 }, "resource": { "type": "string", "enum": [ "food", "water" ] } } } ]}