glitchless-mcp 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/context.js +7 -3
- package/src/pictures.js +66 -25
- package/src/tools/dashboard.js +12 -7
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ above go in its environment.
|
|
|
103
103
|
| `glitchless_player_funnel` | Per level: starts, completions, deaths and their causes, disconnects, rage quits; split by what describes the attempt (tier, party size, class), runs per level, and retention; with `hotspots`, where players die on a level, in a zone or anywhere in the game (a hub with no levels), clustered in world coordinates |
|
|
104
104
|
| `glitchless_events` | The game's own events (whatever it sends with `track`, and the streams it counts with `count`): counts, attribute breakdowns, rates, distributions and funnels, and the session properties it sets |
|
|
105
105
|
| `glitchless_dashboard` | The game's dashboard: its pages, and one board's panels with their numbers |
|
|
106
|
-
| `glitchless_set_dashboard` | Save the game's pages: boards of panels in its own words, and the built-in views it keeps; and, each alone if you like, the boards' accent, logo and banner (the header behind each board's title) and a level's, zone's or the whole game's heatmap background (a picture from a file or base64 and its world bounds). Needs a key with the dashboard scope |
|
|
106
|
+
| `glitchless_set_dashboard` | Save the game's pages: boards of panels in its own words, and the built-in views it keeps; and, each alone if you like, the boards' accent, logo and banner (the header behind each board's title) and a level's, zone's or the whole game's heatmap background (a picture from a file or base64 and its world bounds; over the hosted server a file is answered with a 10-minute, single-use upload link to send it to with one curl). Needs a key with the dashboard scope |
|
|
107
107
|
| `glitchless_compare_versions` | Two or more versions side by side, in the game's own stats first, to confirm a fix with real players |
|
|
108
108
|
| `glitchless_session` | One play session in detail, with its whole event timeline |
|
|
109
109
|
| `glitchless_bug_reports` | Bug reports players sent from inside the game: their notes, levels, positions and sessions, and one report's screenshot when asked |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"mcpName": "io.github.glitchless-gg/glitchless",
|
|
5
5
|
"description": "Coding agents can build a game. They can't see anyone play it. Glitchless lets them. The MCP server for Glitchless, game observability for coding agents: Claude Code, Codex, Cursor and others read real players' stutters, crashes, custom metrics and ranked findings in Unity, Godot, Unreal, Three.js, Roblox, Phaser and GameMaker games, build the game's own dashboard, and run playtest bots.",
|
|
6
6
|
"keywords": [
|
package/src/context.js
CHANGED
|
@@ -9,7 +9,7 @@ import path from 'node:path';
|
|
|
9
9
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
|
|
12
|
-
export const VERSION = '0.
|
|
12
|
+
export const VERSION = '0.16.0';
|
|
13
13
|
|
|
14
14
|
// Where `glitchless-mcp login` keeps its workspace key: { url, token, workspace: { id, name }, scopes }.
|
|
15
15
|
export const CREDENTIALS_FILE = path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'glitchless', 'credentials.json');
|
|
@@ -107,9 +107,13 @@ export async function projectFor(game) {
|
|
|
107
107
|
return hit.id;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
// A workspace key names the game in x-glitchless-project. A key for one game sends the game a call names (or
|
|
111
|
+
// GLITCHLESS_GAME) as x-glitchless-game, so Glitchless Cloud refuses it when it isn't the key's game instead of
|
|
112
|
+
// answering, or writing, for the key's own game.
|
|
110
113
|
async function headers(extra = {}) {
|
|
111
114
|
const client = conn().client || calls.getStore()?.server?.server.getClientVersion?.()?.name || 'mcp';
|
|
112
|
-
|
|
115
|
+
const named = !isWorkspace() && (calls.getStore()?.game || conn().game);
|
|
116
|
+
return { 'x-glitchless-client': client, ...(apiKey() ? { 'x-glitchless-api-key': apiKey() } : {}), ...(isWorkspace() ? { 'x-glitchless-project': await projectFor(calls.getStore()?.game) } : {}), ...(named ? { 'x-glitchless-game': encodeURIComponent(named) } : {}), ...extra };
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
// A workspace key's own routes (/v1/agent/…, Glitchless Cloud).
|
|
@@ -262,7 +266,7 @@ export function toolList({ remote = false, scopes = null } = {}) {
|
|
|
262
266
|
const titleOf = (t) => t.config.title ?? `${t.name.replace(/^glitchless_/, '').replace(/_/g, ' ').replace(/^./, (c) => c.toUpperCase())}`;
|
|
263
267
|
|
|
264
268
|
// Every tool takes `game` (by name or id): with a workspace key it picks the game, with a game key it's ignored.
|
|
265
|
-
const gameField = z.string().optional().describe('The game, by name or id, when signed in to a workspace (glitchless_list_games lists them); later calls keep it.
|
|
269
|
+
const gameField = z.string().optional().describe('The game, by name or id, when signed in to a workspace (glitchless_list_games lists them); later calls keep it. With a key for one game (gl_sk_…), a call that names another game is refused: sign in to the workspace to reach every game.');
|
|
266
270
|
|
|
267
271
|
// A server with the tools. remote: the HTTP server's set (no local tools, and instructions to match); scopes: show
|
|
268
272
|
// only the tools these scopes allow; connection: what every call runs with (default: this process's own).
|
package/src/pictures.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// picture of a level, a zone or the whole game with the world bounds its edges stand for, so the paths and deaths on
|
|
3
3
|
// a positions panel and the Heatmaps view read as the place they happened in: the server's PUT /v1/maps, SPEC §3b
|
|
4
4
|
// Backgrounds) and the brand's logo and banner (`logo`, `banner`: PUT /v1/brand/logo and /v1/brand/banner, §3b
|
|
5
|
-
// Branding). The local server reads a picture from a file on this computer;
|
|
5
|
+
// Branding). The local server reads a picture from a file on this computer; the hosted one, which can't, answers a
|
|
6
|
+
// file with an upload link (POST /v1/uploads, §3b Upload links) the agent sends it to with one curl, as either does
|
|
7
|
+
// with upload: true; any server takes a picture as base64.
|
|
6
8
|
import fs from 'node:fs/promises';
|
|
7
9
|
import path from 'node:path';
|
|
8
10
|
import { z } from 'zod';
|
|
@@ -10,19 +12,46 @@ import { write, upload, base, isRemote } from './context.js';
|
|
|
10
12
|
|
|
11
13
|
const TYPES = { '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp' };
|
|
12
14
|
|
|
13
|
-
// A picture
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// A picture for one slot (logo, banner, or a background with its place, axis and bounds as `params`): its bytes and
|
|
16
|
+
// type from { file } (only a local server reads files) or { image } (base64 or a data: URL), or { link }, the line
|
|
17
|
+
// to show, when it goes by an upload link: asked for (upload: true), or a file the hosted server can't read. `what`
|
|
18
|
+
// names it in that line; `route` is the slot's own address, for a server too old to make links.
|
|
19
|
+
async function readPicture(svc, slot, params, { file, image, upload: asked }, what, route) {
|
|
20
|
+
if (asked && image) throw new Error('give image (the picture as base64) or upload: true (a link to send it to), not both');
|
|
21
|
+
if (asked || (file && isRemote())) {
|
|
22
|
+
const link = await uploadLink(svc, slot, params, file, what);
|
|
23
|
+
if (link) return { link };
|
|
24
|
+
if (isRemote() || !file) throw new Error(`this server makes no upload links${isRemote() ? " and can't read files on your computer" : ''}: pass the picture as image (base64), or upload it yourself with a secret key that has the dashboard scope: curl -X PUT '${route}' -H 'x-glitchless-api-key: <key>' --data-binary @${file ? shellArg(file) : '<file>'}`);
|
|
19
25
|
}
|
|
26
|
+
if (file) return { bytes: await fs.readFile(path.resolve(file)), type: TYPES[path.extname(file).toLowerCase()] || 'application/octet-stream' };
|
|
20
27
|
return { bytes: Buffer.from(image.replace(/^data:[^,]*,/, ''), 'base64'), type: 'application/octet-stream' };
|
|
21
28
|
}
|
|
22
29
|
|
|
30
|
+
// A short-lived, single-use link for one picture (POST /v1/uploads), as the line that tells the agent to run its curl;
|
|
31
|
+
// null from a server without upload links. The link is shown here once: the server keeps only its hash.
|
|
32
|
+
async function uploadLink(svc, slot, params, file, what) {
|
|
33
|
+
let made;
|
|
34
|
+
try {
|
|
35
|
+
made = (await write('POST', `/v1/uploads?${new URLSearchParams({ service: svc, slot, ...params })}`)).upload;
|
|
36
|
+
} catch (err) {
|
|
37
|
+
if (/→ HTTP (404|405|501)\b/.test(err.message)) return null;
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
const url = `${base()}${made.path}`;
|
|
41
|
+
const minutes = Math.max(1, Math.round(made.expires_in_s / 60));
|
|
42
|
+
const command = `curl -X PUT --data-binary @${file ? shellArg(file) : '<file>'} '${url}'`;
|
|
43
|
+
return `To send ${what}, run this within ${minutes} minutes: \`${command}\`. The link takes one picture (PNG, JPEG or WebP, at most ${Math.round(made.max_bytes / 1024)} KB and ${made.max_width} × ${made.max_height} pixels) and then stops working; it needs no key. curl's answer says what was saved, or what to fix: a picture refused for its size or type can be fixed and sent to the same link until it expires.`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// A path as one shell word.
|
|
47
|
+
function shellArg(f) {
|
|
48
|
+
return /^[\w@%+=:,./-]+$/.test(f) ? f : `'${f.replace(/'/g, "'\\''")}'`;
|
|
49
|
+
}
|
|
50
|
+
|
|
23
51
|
// One place's background for set_dashboard's `background`: save a picture (a file here, or base64) with its world
|
|
24
|
-
// bounds, or
|
|
25
|
-
|
|
52
|
+
// bounds, or make a link to send it to (upload: true, or a file over HTTP), or remove: true to remove the upload.
|
|
53
|
+
// Returns { text, map? }, and link: true when the picture is still to be sent.
|
|
54
|
+
export async function saveBackground(svc, { level, zone, file, image, upload: asked, axis, bounds, remove }) {
|
|
26
55
|
if (level && zone) throw new Error('give level or zone, not both (neither: the whole game)');
|
|
27
56
|
const place = level ? { level } : zone ? { zone } : {};
|
|
28
57
|
const name = level ? `level ${level}` : zone ? `zone ${zone}` : 'the whole game';
|
|
@@ -31,12 +60,13 @@ export async function saveBackground(svc, { level, zone, file, image, axis, boun
|
|
|
31
60
|
await write('DELETE', `/v1/maps?${where}`);
|
|
32
61
|
return { text: `Removed the uploaded background of ${name}.` };
|
|
33
62
|
}
|
|
34
|
-
if (!file && !image) throw new Error('give background.file or background.image (the picture), or background.remove: true');
|
|
63
|
+
if (!file && !image && !asked) throw new Error('give background.file or background.image (the picture), background.upload: true (a link to send it to), or background.remove: true');
|
|
35
64
|
if (!bounds) throw new Error('give bounds: the world coordinates the picture covers, { "min": [a, b], "max": [a, b] }');
|
|
36
65
|
where.set('axis', axis || 'xz');
|
|
37
66
|
where.set('min', bounds.min.join(','));
|
|
38
67
|
where.set('max', bounds.max.join(','));
|
|
39
|
-
const { bytes, type } = await readPicture({ file, image }, `${base()}/v1/maps?${where}`);
|
|
68
|
+
const { bytes, type, link } = await readPicture(svc, 'background', Object.fromEntries([...where].filter(([k]) => k !== 'service')), { file, image, upload: asked }, `the background of ${name}`, `${base()}/v1/maps?${where}`);
|
|
69
|
+
if (link) return { text: link, link: true };
|
|
40
70
|
const { map } = await upload('PUT', `/v1/maps?${where}`, bytes, type);
|
|
41
71
|
// A picture shaped unlike its bounds is stretched to fit them: often bounds that don't match its edges.
|
|
42
72
|
const [w, h] = map.size;
|
|
@@ -55,8 +85,9 @@ export const backgroundSchema = z
|
|
|
55
85
|
.object({
|
|
56
86
|
level: z.string().optional().describe('The level, as the game passes it to levelStart'),
|
|
57
87
|
zone: z.string().optional().describe('Or the zone, as the game passes it to setZone (leave out level and zone for the whole game)'),
|
|
58
|
-
file: z.string().optional().describe('The picture: a PNG, JPEG or WebP file on this computer.
|
|
59
|
-
image: z.string().optional().describe(
|
|
88
|
+
file: z.string().optional().describe('The picture: a PNG, JPEG or WebP file on this computer. The local server (npx glitchless-mcp) reads it; the hosted one answers with an upload link to send it to with one curl'),
|
|
89
|
+
image: z.string().optional().describe('Or the picture as base64 (or a data: URL); a big one is long in a call, so prefer file'),
|
|
90
|
+
upload: z.boolean().optional().describe('Answer with an upload link instead of saving now: send the picture to it with one curl (curl -X PUT --data-binary @file \'<link>\') within 10 minutes; it takes one picture and needs no key. The hosted server does this for file by itself'),
|
|
60
91
|
axis: z.enum(['xz', 'xy']).optional().describe('xz: seen from above, x across and z down the picture (default); xy: a side view, x across and y up'),
|
|
61
92
|
bounds: z
|
|
62
93
|
.object({ min: z.tuple([z.number(), z.number()]), max: z.tuple([z.number(), z.number()]) })
|
|
@@ -70,32 +101,42 @@ function round(v) {
|
|
|
70
101
|
return Math.round(v * 100) / 100;
|
|
71
102
|
}
|
|
72
103
|
|
|
73
|
-
// The brand's logo or banner (kind) for set_dashboard: an image ({ file } or { image }
|
|
74
|
-
// banner a focus (top, center or bottom: what stays in view when it is cropped
|
|
75
|
-
|
|
104
|
+
// The brand's logo or banner (kind) for set_dashboard: an image ({ file } or { image }, or upload: true for a link to
|
|
105
|
+
// send it to), remove: true, and for the banner a focus (top, center or bottom: what stays in view when it is cropped
|
|
106
|
+
// to a strip). Returns { text, saved }: the line to show, and whether anything changed now (a link changes nothing
|
|
107
|
+
// until the picture comes).
|
|
108
|
+
export async function saveBrandImage(svc, kind, { file, image, upload: asked, remove, focus }) {
|
|
76
109
|
const q = `service=${encodeURIComponent(svc)}`;
|
|
77
110
|
const said = [];
|
|
111
|
+
let saved = false;
|
|
78
112
|
if (remove) {
|
|
79
113
|
await write('DELETE', `/v1/brand/${kind}?${q}`);
|
|
80
114
|
said.push(`Removed the ${kind}.`);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const {
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
saved = true;
|
|
116
|
+
} else if (file || image || asked) {
|
|
117
|
+
const { bytes, type, link } = await readPicture(svc, kind, {}, { file, image, upload: asked }, `the ${kind}`, `${base()}/v1/brand/${kind}?${q}`);
|
|
118
|
+
if (link) said.push(link);
|
|
119
|
+
else {
|
|
120
|
+
const { brand } = await upload('PUT', `/v1/brand/${kind}?${q}`, bytes, type);
|
|
121
|
+
const b = brand?.[kind];
|
|
122
|
+
said.push(`Saved the ${kind}${b ? `: ${b.width} × ${b.height} pixels` : ''}.`);
|
|
123
|
+
saved = true;
|
|
124
|
+
}
|
|
86
125
|
}
|
|
87
126
|
if (focus) {
|
|
88
127
|
await write('PUT', `/v1/brand?${q}`, { banner_focus: focus });
|
|
89
128
|
said.push(`The banner keeps its ${focus} in view.`);
|
|
129
|
+
saved = true;
|
|
90
130
|
}
|
|
91
|
-
if (!said.length) throw new Error(`give ${kind}.file or ${kind}.image (the picture), ${kind}.remove: true${kind === 'banner' ? ', or banner.focus' : ''}`);
|
|
92
|
-
return said.join(' ');
|
|
131
|
+
if (!said.length) throw new Error(`give ${kind}.file or ${kind}.image (the picture), ${kind}.upload: true (a link to send it to), ${kind}.remove: true${kind === 'banner' ? ', or banner.focus' : ''}`);
|
|
132
|
+
return { text: said.join(' '), saved };
|
|
93
133
|
}
|
|
94
134
|
|
|
95
135
|
// The schema of set_dashboard's `logo` and `banner`.
|
|
96
136
|
const picture = {
|
|
97
|
-
file: z.string().optional().describe('A PNG, JPEG or WebP file on this computer.
|
|
98
|
-
image: z.string().optional().describe(
|
|
137
|
+
file: z.string().optional().describe('A PNG, JPEG or WebP file on this computer. The local server (npx glitchless-mcp) reads it; the hosted one answers with an upload link to send it to with one curl'),
|
|
138
|
+
image: z.string().optional().describe('Or the picture as base64 (or a data: URL); a banner is long in a call, so prefer file'),
|
|
139
|
+
upload: z.boolean().optional().describe("Answer with an upload link instead of saving now: send the picture to it with one curl (curl -X PUT --data-binary @file '<link>') within 10 minutes; it takes one picture and needs no key. The hosted server does this for file by itself"),
|
|
99
140
|
remove: z.boolean().optional().describe('Remove it'),
|
|
100
141
|
};
|
|
101
142
|
export const logoSchema = z
|
package/src/tools/dashboard.js
CHANGED
|
@@ -5,7 +5,7 @@ import { saveBackground, listBackgrounds, backgroundSchema, saveBrandImage, logo
|
|
|
5
5
|
|
|
6
6
|
tool(
|
|
7
7
|
'glitchless_dashboard',
|
|
8
|
-
"The game's dashboard: its pages in order, each a board (panels in the game's own terms) or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches), and one board's panels with their numbers for the window. A board page with `where` shows only the sessions with those property values. `page` picks the board (default: the first). `source` says whether the dashboard was saved (by an agent or a person) or made automatically from what the game sends; `spec` (its pages, and its currency if it has one) is what to edit and send back to glitchless_set_dashboard. Money panels answer their `currency` (an ISO code, or ROBUX), and `mismatch` lists amounts sent in another currency, which are left out; a Robux panel with devex answers `devex`, an estimate in US dollars at Roblox's DevEx rate (never money). `brand` is the game's branding on its boards and share links: its accent colour (set with glitchless_set_dashboard's accent) and whether it has a logo and a banner (
|
|
8
|
+
"The game's dashboard: its pages in order, each a board (panels in the game's own terms) or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches), and one board's panels with their numbers for the window. A board page with `where` shows only the sessions with those property values. `page` picks the board (default: the first). `source` says whether the dashboard was saved (by an agent or a person) or made automatically from what the game sends; `spec` (its pages, and its currency if it has one) is what to edit and send back to glitchless_set_dashboard. Money panels answer their `currency` (an ISO code, or ROBUX), and `mismatch` lists amounts sent in another currency, which are left out; a Robux panel with devex answers `devex`, an estimate in US dollars at Roblox's DevEx rate (never money). `brand` is the game's branding on its boards and share links: its accent colour (set with glitchless_set_dashboard's accent) and whether it has a logo and a banner (set with glitchless_set_dashboard's logo and banner, or by people in the dashboard: Edit pages → Look).",
|
|
9
9
|
{ ...common, page: z.string().optional().describe('Id of the board page to evaluate (default: the first board)') },
|
|
10
10
|
async ({ service, hours, page, ...f }) => {
|
|
11
11
|
const svc = await resolveService(service);
|
|
@@ -117,7 +117,7 @@ define(
|
|
|
117
117
|
{
|
|
118
118
|
title: 'Save dashboard',
|
|
119
119
|
description:
|
|
120
|
-
"Save the game's dashboard: its pages, in the order the sidebar shows them. Each page is a board of panels in the game's own words, or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches) the game keeps, renames or drops. Design it for this game, not for a genre it isn't: a puzzle game cares about solve time and hints, a mobile game about opens, modes, the paywall and purchases (revenue: a stat with sum \"amount\" of \"purchase\"; revenue per player: per \"$players\"; conversion: event \"purchase\" per \"$players\"; revenue by item: a breakdown with sum, of completed ones only with event \"purchase:result=done\"; a Roblox game's money is in Robux: currency \"ROBUX\", and devex true on a panel adds an estimate in dollars), a platformer about deaths per level (and a positions panel for where on a level they die). For a game on several platforms, a breakdown by $platform splits players or an event between them (iOS vs Android, PC vs Mac vs Steam Deck); a web game splits by $browser, and any game by $device_tier. For balance and outcomes, a breakdown with rate gives each row its rate and interval next to the overall one (win rate by hero: event \"match_end\", by \"hero\", rate \"won\"); per \"$hours\" turns counts and sums into rates per hour played (gold per hour); a distribution panel or a stat with of and quantile shows how long matches or runs last; a stat with first gives the median seconds from a session's start to its first event of a kind (time in the lobby: first \"hall_left\"), and one with never the share of ended sessions that never sent it (never left the lobby), so the game needn't time it by hand; a breakdown of steps or days takes order \"value\" (day 1 to 7 in order); a table lists an event's events one by one, grouped and sorted (daily runs by day, best score first: type \"table\", event \"daily_run\", group_by \"day_label\", sort \"-score\", of \"score\"); a list attribute (deck, build, boons) splits by element. Split by what the game set for the session with setProperties ($rank, $class, $region), and give a page where to show only some sessions (a page for the high ranks); a levels panel by a levelStart attribute shows clears by tier or difficulty, and count \"runs\" runs per biome. A multiplayer game gets a Network page (ping_p95 and disconnect_pct stats, net panels by $region or $link), and one whose dedicated servers run the SDK in server mode a Servers page (servers_now, server_tick_p95, a servers panel by players) or the built-in servers view; a game that sets match groups can keep the built-in matches view. An open world or an avatar hub that names its zones (setZone) gets where play time goes and how each zone runs: a breakdown by $zone without event (time in each zone), zone_time_pct and zone_median_s stats with zone, and frame_time by $zone (hitches per zone); don't send zone timing as custom events. The first page opens first. Use the events the game sends (glitchless_events lists them, with their attributes); on a board, stats first, then the game's own events and funnels, then levels, frame_time and errors. Leave out what the game has no data for (no Heatmaps page for a game without positions, no reports page for a game that doesn't turn bug reports on). Send every page: read the current ones with glitchless_dashboard (its spec), change them, send them all back. Pass reset: true to go back to the automatic dashboard. accent sets the colour of the game's boards and share links (links, the selected page, stats, the main chart series, the map), logo and banner their logo and header picture (the game's key art, behind each board's title), and background gives a level, a zone or the whole game a heatmap background (a top-down picture and its world bounds); each can be sent alone. Needs a secret key with the dashboard scope.",
|
|
120
|
+
"Save the game's dashboard: its pages, in the order the sidebar shows them. Each page is a board of panels in the game's own words, or a built-in view (events, performance, errors, players, heatmaps, sessions, versions, live, reports, servers, matches) the game keeps, renames or drops. Design it for this game, not for a genre it isn't: a puzzle game cares about solve time and hints, a mobile game about opens, modes, the paywall and purchases (revenue: a stat with sum \"amount\" of \"purchase\"; revenue per player: per \"$players\"; conversion: event \"purchase\" per \"$players\"; revenue by item: a breakdown with sum, of completed ones only with event \"purchase:result=done\"; a Roblox game's money is in Robux: currency \"ROBUX\", and devex true on a panel adds an estimate in dollars), a platformer about deaths per level (and a positions panel for where on a level they die). For a game on several platforms, a breakdown by $platform splits players or an event between them (iOS vs Android, PC vs Mac vs Steam Deck); a web game splits by $browser, and any game by $device_tier. For balance and outcomes, a breakdown with rate gives each row its rate and interval next to the overall one (win rate by hero: event \"match_end\", by \"hero\", rate \"won\"); per \"$hours\" turns counts and sums into rates per hour played (gold per hour); a distribution panel or a stat with of and quantile shows how long matches or runs last; a stat with first gives the median seconds from a session's start to its first event of a kind (time in the lobby: first \"hall_left\"), and one with never the share of ended sessions that never sent it (never left the lobby), so the game needn't time it by hand; a breakdown of steps or days takes order \"value\" (day 1 to 7 in order); a table lists an event's events one by one, grouped and sorted (daily runs by day, best score first: type \"table\", event \"daily_run\", group_by \"day_label\", sort \"-score\", of \"score\"); a list attribute (deck, build, boons) splits by element. Split by what the game set for the session with setProperties ($rank, $class, $region), and give a page where to show only some sessions (a page for the high ranks); a levels panel by a levelStart attribute shows clears by tier or difficulty, and count \"runs\" runs per biome. A multiplayer game gets a Network page (ping_p95 and disconnect_pct stats, net panels by $region or $link), and one whose dedicated servers run the SDK in server mode a Servers page (servers_now, server_tick_p95, a servers panel by players) or the built-in servers view; a game that sets match groups can keep the built-in matches view. An open world or an avatar hub that names its zones (setZone) gets where play time goes and how each zone runs: a breakdown by $zone without event (time in each zone), zone_time_pct and zone_median_s stats with zone, and frame_time by $zone (hitches per zone); don't send zone timing as custom events. The first page opens first. Use the events the game sends (glitchless_events lists them, with their attributes); on a board, stats first, then the game's own events and funnels, then levels, frame_time and errors. Leave out what the game has no data for (no Heatmaps page for a game without positions, no reports page for a game that doesn't turn bug reports on). Send every page: read the current ones with glitchless_dashboard (its spec), change them, send them all back. Pass reset: true to go back to the automatic dashboard. accent sets the colour of the game's boards and share links (links, the selected page, stats, the main chart series, the map), logo and banner their logo and header picture (the game's key art, behind each board's title), and background gives a level, a zone or the whole game a heatmap background (a top-down picture and its world bounds); each can be sent alone. A picture is a file on this computer, which the local server (npx glitchless-mcp) reads, or base64. The hosted server can't read your files: for file (or upload: true on any server) it answers with an upload link instead, and you send the picture with one curl (curl -X PUT --data-binary @file '<link>', no key). A link lasts 10 minutes, takes one picture for its one slot (the logo, the banner, or one place's background with the bounds it was made with) and then stops working; a picture refused for its size or type can be sent again until it expires, and a game gets at most 30 links an hour. Each slot's limit: a logo at most 100 KB and 1024 × 1024 pixels, a banner 300 KB and 4096 × 2048, a background 256 KB and 4096 × 4096, all PNG, JPEG or WebP. Needs a secret key with the dashboard scope.",
|
|
121
121
|
inputSchema: {
|
|
122
122
|
service: z.string().optional().describe('Game service name (defaults to the most recently active game)'),
|
|
123
123
|
pages: z.array(pageSchema).max(20).optional().describe('Every page, in order: at most 20 (boards and built-in views together)'),
|
|
@@ -138,13 +138,18 @@ define(
|
|
|
138
138
|
},
|
|
139
139
|
async ({ service, pages, currency, reset, accent, logo, banner, background }) => {
|
|
140
140
|
const svc = await resolveService(service);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
//
|
|
141
|
+
if (!reset && !pages?.length && accent === undefined && !logo && !banner && !background) throw new Error('give pages, accent, logo, banner, background, or reset: true');
|
|
142
|
+
// The look (accent, logo, banner) and a background are kept apart from the pages, so each can go alone. A picture
|
|
143
|
+
// that goes by an upload link changes nothing yet: the line says how to send it.
|
|
144
144
|
const said = [];
|
|
145
|
+
let look = accent !== undefined;
|
|
145
146
|
if (accent !== undefined) said.push(`Accent: ${(await write('PUT', `/v1/brand?service=${encodeURIComponent(svc)}`, { accent })).brand?.accent ?? 'none'}.`);
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
for (const [kind, picture] of [['logo', logo], ['banner', banner]]) {
|
|
148
|
+
if (!picture) continue;
|
|
149
|
+
const { text, saved } = await saveBrandImage(svc, kind, picture);
|
|
150
|
+
said.push(text);
|
|
151
|
+
look ||= saved;
|
|
152
|
+
}
|
|
148
153
|
const bg = background ? await saveBackground(svc, background) : null;
|
|
149
154
|
if (bg) said.push(bg.text);
|
|
150
155
|
const colour = said.length ? ` ${said.join(' ')}` : '';
|