Skip to main content
Glama

serve

Register a new service from a prebuilt container image, specifying name, image, port and environment variables. Deploy your image as a running service on the host.

Instructions

Register a service from a prebuilt image.

Input Schema

NameRequiredDescriptionDefault
envNoEnvironment variables injected into the container, as literal strings. Omit for none. Secrets belong in ``set_secret``, which overrides an ``env`` key of the same name at launch.
gpusNoGPUs the service needs; default 0 = none. Allocation is shared, not exclusive, and is checked against the token's quota.
nameYesName for the NEW service: a lowercase DNS label, 1-63 chars (``^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$``). Register-only — an existing name is refused with 409 ``service.name_taken`` rather than redeployed.
portNoContainer port published on the host. Default 8000; 1-65535.
imageYesTag of an image that already exists on the daemon's runtime; it is never built and never pulled here, and a missing one is refused with 400 ``image_not_found``.
vendorNoGPU vendor to reserve when ``gpus`` > 0 (``nvidia`` or ``amd``); omit to let the daemon choose on a fresh deploy — a redeploy keeps the vendor already recorded.
commandNoCommand overriding the image's CMD, split into argv like a shell would (``shlex``) but run WITHOUT a shell — no pipes, redirects or ``$VAR``; write ``sh -c '…'`` for those. Omit to run the image's own CMD.
script_pathNoHost path to a script run under ``nerdit-runtime`` instead of the image CMD. Omit for the image CMD; it bind-mounts a host directory and needs an admin token (403 ``sandbox.script_path_forbidden``).
health_checkNoProbe policy ``{path, type: http|tcp, timeout_s, unhealthy_threshold, start_period_s}``; omit for liveness-only supervision. Repeated failures mark the service ``degraded`` and leave it running — only a dead container is restarted.
restart_policyNoWhat the daemon does when the container exits: ``always`` (the default), ``on-failure`` or ``no``.always
idempotency_keyNoCaller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and does not meet it. It omits that names are register-only (409 on collision), that the image must already exist on the daemon, whether the container is started immediately, permission requirements, and idempotency behavior — facts that exist only in the schema property descriptions, not the tool description.

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

Conciseness3/5

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

A single sentence with no filler, so nothing is wasted — but for an 11-parameter mutation tool it is under-specified rather than concise. Brevity here costs the agent needed routing and behavior information.

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

Completeness2/5

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

With no annotations, no output schema, and 11 parameters, the definition should explain what a successful call yields (a service record, an endpoint, a status) and how it relates to list_services/get_service/wait_for_service. Only the input schema compensates, leaving the post-call workflow undocumented.

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

Parameters3/5

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

Schema description coverage is 100% and the per-parameter text is unusually rich (name regex, script_path admin-token requirement, command argv semantics, health-check shapes). The description adds nothing beyond that, so the baseline of 3 applies.

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

Purpose4/5

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

States a specific verb and resource: 'register a service', qualified by 'from a prebuilt image', which signals it will not build or pull. It is clear on its own, but it never names or distinguishes itself from the many near-neighbours (deploy, deploy_template, deploy_app, serve_model, redeploy_service), so the agent must infer the difference.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusions, and no named alternative. An agent facing 60+ siblings that all create or deploy services gets no rule for choosing 'serve' over 'deploy' or 'deploy_template'.

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