Skip to main content
Glama

Generate a game server Dockerfile

edgegap_generate_dockerfile
Read-onlyIdempotent

Generate a Dockerfile for a headless game server build so it can run on Edgegap, including engine flags, non-root user, ports, and start-script fixes. Use before building when no Dockerfile exists.

Instructions

Write a Dockerfile for this project's headless game server build, ready for Edgegap: linux/amd64 base, the build folder copied in, the binary made executable, the right headless flags (Unity -batchmode -nographics, Godot --headless), a non-root user where the engine needs it (Unreal refuses root), CRLF fixes for start scripts, and EXPOSE lines matching the ports. Call this when the project has no Dockerfile, before building anything. Look at the build output first so you can pass the real build folder, binary name and port; anything you omit is assumed and listed under assumptions, which you must confirm with the developer or the project files. Write the result to Dockerfile, then build. The output is checked against edgegap_validate_server_config before it is returned. Makes no API calls.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "engine": "<engine>"
    },
    "name": "edgegap_generate_dockerfile"
  }
}

Input Schema

NameRequiredDescriptionDefault
portsNoPorts the server listens on. Default: 7777, with the protocol the netcode uses (UDP if unknown).
engineYesGame engine of the server build.
netcodeNoNetworking transport, to pick the protocol. Known: mirror-kcp, kcp, mirror-telepathy, telepathy, mirror-simpleweb, simpleweb, websocket, fishnet-tugboat, tugboat, netcode-for-gameobjects, ngo, unity-transport, utp, photon-fusion, litenetlib, enet, unreal-netdriver, godot-enet, godot-websocket.
base_imageNoDefault "ubuntu:22.04".
build_pathNoServer build folder, relative to where docker build runs. Defaults: unity "Builds/EdgegapServer", unreal "." (run from inside the packaged LinuxServer folder), godot "build".
executableNoFile name of the server binary or start script inside build_path. Defaults: unity "ServerBuild", unreal "StartServer.sh", godot "server.x86_64". Required for "other".
launch_argsNoExtra server arguments, one per entry, e.g. ["-log", "-port=7777"].

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.2
    • addedInput schema / properties / ports / items / properties / tls_upgrade
      Added value: +{
      +  "description": "TLS Upgrade (wss/https) on a WS or HTTP port, for browser clients.",
      +  "type": "boolean"
      +}
  2. Addedv0.2.2

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint/idempotentHint annotations, it discloses the important mechanics: omitted parameters become assumed values that are listed under assumptions and must be confirmed, and the output is validated against edgegap_validate_server_config before return. It also preempts the tension between 'write a Dockerfile' and readOnlyHint by stating 'Makes no API calls,' clarifying that the write is a local file, not server state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is dense and front-loaded — purpose first, then prerequisite, then inputs, then post-conditions — with no filler sentences. It is a single long paragraph, though, so the procedural ordering (inspect build, write, build, validate) is harder to scan than a short numbered list would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter generative tool with full schema coverage, annotations, and no output schema, the description covers prerequisites, defaults behavior, and validation. The one soft spot is the return contract: it says the output is validated but not that the returned artifact is the Dockerfile content plus an assumptions list, which an agent would want to know.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds value beyond it: it tells the agent which inputs matter most ('the real build folder, binary name and port') and what happens to anything left out (assumed and reported). It does not explain the netcode-to-protocol mapping or launch_args handling, which the schema itself carries.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening clause gives a precise verb and artifact: 'Write a Dockerfile for this project's headless game server build, ready for Edgegap,' and enumerates the engine-specific contents (base image, build copy, headless flags, non-root user, CRLF fixes, EXPOSE). An agent can distinguish this file-generation tool from siblings like edgegap_create_app_version or edgegap_validate_server_config without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states a clear trigger condition — 'Call this when the project has no Dockerfile, before building anything' — plus ordering ('Look at the build output first', 'Write the result to Dockerfile, then build') and a downstream relation to edgegap_validate_server_config. It does not name an alternative for the case where a Dockerfile already exists, so it stops short of full when/when-not routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.