Skip to main content
Glama

Publish CloudCode

publish_cloud_code
Destructive

Publish server-side game logic (CloudCode) and make it live. This is the only way to run custom code on the server, and the only way to write protected data: the ReadOnly/Internal buckets of a player's UserCustomData and the Runtime scope of the title's data store. The script is plain JavaScript filling a global 'handlers' object, e.g. handlers.claimDailyBonus = function (args, context) { … }. Inside a handler: log.Info/Warning/Error, context.UserID, and server.* (ReadUserData, GetTitleConfig, GetUserCustomData, SetUserCustomData, DeleteUserCustomData, BatchSetUserCustomData, BatchDeleteUserCustomData, GetPublicUserCustomDataOf, GetTitleCustomData, SetTitleCustomData, IncrementTitleCustomData, DeleteTitleCustomData, BatchSetTitleCustomData, BatchDeleteTitleCustomData, GetIntegrationVariable, HttpRequest) — each returns { Success, Error, Data }. No async/await, no imports; 10 seconds wall-clock per call and a per-execution cap on server.* calls. The only way out to the network is server.HttpRequest({ Method, Url, Headers, Body }) — there is no fetch and no XMLHttpRequest; it reaches only publisher-allow-listed hosts over https, and credentials go in as {{secret:NAME}} placeholders (see list_title_secrets), never as literal values. The code REPLACES the previous revision entirely — read get_cloud_code first and send back the full script. Games call handlers through the SDK's client.cloudCode.execute(name, args).

Input Schema

NameRequiredDescriptionDefault
codeYesFull JavaScript source of the revision.
commentNoShort note about what changed.
handlersNoOptional whitelist of callable handlers; anything not listed is rejected by the server.
title_idYesTitleID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description goes well beyond them: it discloses that publishing fully replaces the previous revision, the sandbox constraints (no async/await or imports, 10s wall clock, per-execution server.* cap), and network limits via server.HttpRequest to allow-listed hosts with {{secret:NAME}} placeholders.

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?

Front-loads the core action and the destructive replace warning in the first sentence. It is a dense single paragraph and the parenthetical enumeration of server.* functions is lengthy, but most content earns its place for writing valid code.

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?

No output schema exists, so the description must carry behavioral burden, which it largely does for a complex code-publishing tool. It leaves the response/return behavior and any auth requirements unstated, a minor gap.

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 real value by explaining the code format (handlers object, server.* API surface, context.UserID) and the whitelist behavior of the handlers parameter (anything not listed is rejected).

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?

States a specific verb (Publish) plus resource (server-side game logic / CloudCode) and its effect (make it live). It clearly distinguishes itself from read/save siblings by asserting it is the only way to run custom code on the server and the only path to write protected buckets.

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?

Gives clear workflow guidance: read get_cloud_code first and send the full script because the code REPLACES the prior revision, and points to list_title_secrets for credential placeholders. It does not explicitly name save_cloud_code as the draft alternative, so the when-not is left implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.