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

TableJSON 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

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.