@edgegap/mcp 0.19.4 → 0.19.5
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/dist/callreport.js +15 -3
- package/dist/tools.js +119 -15
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ To keep your API token on your own machine, run the server locally instead. Leav
|
|
|
213
213
|
}
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.19.
|
|
216
|
+
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.19.5`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
|
|
217
217
|
|
|
218
218
|
The local server can also limit what an agent can do. These variables have no effect on the hosted endpoint at `mcp.edgegap.dev`, which takes the two main ones as connection headers instead (see below):
|
|
219
219
|
|
package/dist/callreport.js
CHANGED
|
@@ -66,9 +66,15 @@ function argumentStrings(args) {
|
|
|
66
66
|
walk(k, v);
|
|
67
67
|
return out.sort((a, b) => b[1].length - a[1].length);
|
|
68
68
|
}
|
|
69
|
+
/** Plan or quota wording in an API error. "Your plan allows you to create only 1 active
|
|
70
|
+
* deployments, and it appears you've reached this limit" (403, live 2026-10-29) included. */
|
|
71
|
+
export const QUOTA_WORDING = /quota|limit reached|reached this limit|exceed|upgrade your plan|plan limit|plan allows|maximum number/i;
|
|
72
|
+
/** A 422 about the request itself (metrics on an ended deployment, a time window
|
|
73
|
+
* in the future), not about capacity. */
|
|
74
|
+
export const REQUEST_422 = /start_time|end_time|terminated|cannot fetch metrics/i;
|
|
69
75
|
/** The error code for an Edgegap API status, given what the tool was looking for. */
|
|
70
76
|
export function codeForStatus(status, notFound, forbidden, message = '') {
|
|
71
|
-
if (
|
|
77
|
+
if (QUOTA_WORDING.test(message) && [400, 402, 403, 429].includes(status)) {
|
|
72
78
|
return 'QUOTA_REACHED';
|
|
73
79
|
}
|
|
74
80
|
switch (status) {
|
|
@@ -83,7 +89,7 @@ export function codeForStatus(status, notFound, forbidden, message = '') {
|
|
|
83
89
|
case 409:
|
|
84
90
|
return 'CONFLICT';
|
|
85
91
|
case 422:
|
|
86
|
-
return 'NO_CAPACITY';
|
|
92
|
+
return REQUEST_422.test(message) ? 'UPSTREAM_REJECTED' : 'NO_CAPACITY';
|
|
87
93
|
case 424:
|
|
88
94
|
return 'IMAGE_PULL_FAILED';
|
|
89
95
|
case 429:
|
|
@@ -147,7 +153,13 @@ export function finishReport(input) {
|
|
|
147
153
|
requestId: input.requestId,
|
|
148
154
|
success: !input.isError,
|
|
149
155
|
...(input.isError ? { error_code: code, error_message: sanitizeErrorMessage(input.text, input.token, input.args), failed_stage: stage } : {}),
|
|
150
|
-
|
|
156
|
+
// A failed call reports the status that failed it, not a later lookup's
|
|
157
|
+
// (a deploy 403 followed by a 200 leftover check used to read 200).
|
|
158
|
+
upstream_status: meta.upstreamStatus !== undefined
|
|
159
|
+
? meta.upstreamStatus
|
|
160
|
+
: input.isError && typeof failedUpstream === 'number'
|
|
161
|
+
? failedUpstream
|
|
162
|
+
: statuses.length ? statuses[statuses.length - 1] : null,
|
|
151
163
|
upstream_calls: upstream.length,
|
|
152
164
|
latency_ms: input.latencyMs,
|
|
153
165
|
...(input.dryRun ? { dry_run: true } : {}),
|
package/dist/tools.js
CHANGED
|
@@ -19,7 +19,7 @@ import { buildMatchmakerConfig, DASHBOARD_URL } from './matchmaker.js';
|
|
|
19
19
|
import { badImage, badTag, ENCRYPTED_PLACEHOLDER, isEncryptedPlaceholder, looksSecret, TAG_FIX } from './image.js';
|
|
20
20
|
import { OUTPUT } from './outputs.js';
|
|
21
21
|
import { analyzeSeries, finiteValues, percentile, mapLimit, groupLogMatches, lineMatcher, ERROR_PATTERN } from './ops.js';
|
|
22
|
-
import { finishReport, codeForStatus } from './callreport.js';
|
|
22
|
+
import { finishReport, codeForStatus, QUOTA_WORDING, REQUEST_422 } from './callreport.js';
|
|
23
23
|
import { SKILLS_PACK, findSkill, findSkillFile, fileIndex, mimeType, skillUri } from './skills.js';
|
|
24
24
|
import { SKILLS_CLI, SKILL_NAME_RE, compareVersions, latestPack, latestSkillVersions, servedPackStatus, skillsCheckFromEnv, } from './skillsversion.js';
|
|
25
25
|
/**
|
|
@@ -309,7 +309,7 @@ function apiDetails(details, token) {
|
|
|
309
309
|
return `Details: ${text.length > 600 ? `${text.slice(0, 600)}…` : text}`;
|
|
310
310
|
}
|
|
311
311
|
/** Plan or quota wording in an API error, so the hint can say which limit. */
|
|
312
|
-
const QUOTA =
|
|
312
|
+
const QUOTA = QUOTA_WORDING;
|
|
313
313
|
function errorHint(err, notFound, forbidden) {
|
|
314
314
|
if (QUOTA.test(err.apiMessage) && [400, 402, 403, 429].includes(err.status)) {
|
|
315
315
|
return ('a plan or quota limit was reached (the message above names it). Retrying will not help. ' +
|
|
@@ -335,8 +335,12 @@ function errorHint(err, notFound, forbidden) {
|
|
|
335
335
|
case 404:
|
|
336
336
|
// Only the tool knows what was not found; no hint beats a wrong one.
|
|
337
337
|
return notFound;
|
|
338
|
-
case 429:
|
|
339
|
-
|
|
338
|
+
case 429: {
|
|
339
|
+
// This server already retried a read once; say how long to wait so the
|
|
340
|
+
// agent does not hammer the API in its own loop.
|
|
341
|
+
const seconds = Math.min(Math.max(Math.ceil((err.retryAfterMs ?? 10_000) / 1000), 5), 120);
|
|
342
|
+
return `Edgegap rate-limited this token. Wait ${seconds} seconds before the next call, make one call at a time, and do not retry in a loop.`;
|
|
343
|
+
}
|
|
340
344
|
case 409:
|
|
341
345
|
return 'a resource with that name already exists. Pick a different name or reuse the existing one.';
|
|
342
346
|
case 422:
|
|
@@ -346,6 +350,12 @@ function errorHint(err, notFound, forbidden) {
|
|
|
346
350
|
'force_cache: true and wait for caching_percent (edgegap_get_app_version) to rise, or deploy without ' +
|
|
347
351
|
'require_cached_locations.');
|
|
348
352
|
}
|
|
353
|
+
if (/terminated|cannot fetch metrics/i.test(err.apiMessage)) {
|
|
354
|
+
return 'the deployment has ended, so Edgegap no longer serves its metrics. Metrics are only readable while it runs.';
|
|
355
|
+
}
|
|
356
|
+
if (REQUEST_422.test(err.apiMessage)) {
|
|
357
|
+
return 'start_time and end_time must be ISO 8601 times in the past, with start_time before end_time. Leave them out for the whole life of the deployment.';
|
|
358
|
+
}
|
|
349
359
|
return 'Edgegap could not allocate a server for the requested location or resources. Try different user coordinates, or lower cpu_units/memory_mb.';
|
|
350
360
|
case 424:
|
|
351
361
|
return 'Edgegap could not pull the container image. Check docker_repository, docker_image, docker_tag, and registry credentials.';
|
|
@@ -962,6 +972,14 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
962
972
|
return ok({ application: res.name ?? application, active: res.is_active ?? is_active });
|
|
963
973
|
}));
|
|
964
974
|
}
|
|
975
|
+
/** For a tool called without its application: the applications to pick from, as a normal result. */
|
|
976
|
+
async function pickApplication(tool) {
|
|
977
|
+
const res = await client.listApps({ limit: 100 });
|
|
978
|
+
const applications = (res.applications ?? []).map((a) => a.name);
|
|
979
|
+
return emptyState('needs_input', { applications }, applications.length
|
|
980
|
+
? `Pass application: call ${tool} again with one of these application names.`
|
|
981
|
+
: 'This organization has no applications yet. Create one with edgegap_create_app.');
|
|
982
|
+
}
|
|
965
983
|
// ---------------------------------------------------------------- 3 ----
|
|
966
984
|
tool('edgegap_list_app_versions', {
|
|
967
985
|
title: 'List versions of an application',
|
|
@@ -973,7 +991,9 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
973
991
|
'registry login and secret env values are never readable: the API returns "' + ENCRYPTED_PLACEHOLDER + '" ' +
|
|
974
992
|
'for them, so get them from the dashboard\'s Container Registry page or the developer.',
|
|
975
993
|
inputSchema: {
|
|
976
|
-
|
|
994
|
+
// Optional so a call without it lists the applications to pick from
|
|
995
|
+
// instead of failing validation (seen live from several organizations).
|
|
996
|
+
application: z.string().optional().describe('Application name, as returned by edgegap_list_apps. Required; without it the applications are listed.'),
|
|
977
997
|
},
|
|
978
998
|
outputSchema: OUTPUT.listAppVersions,
|
|
979
999
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
@@ -981,6 +1001,8 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
981
1001
|
// Read-only, so not subject to EDGEGAP_APP_ALLOWLIST: the allowlist
|
|
982
1002
|
// limits what the agent can create and deploy into, as documented.
|
|
983
1003
|
guarded(auth, NOT_FOUND.app, async () => {
|
|
1004
|
+
if (!application?.trim())
|
|
1005
|
+
return pickApplication('edgegap_list_app_versions');
|
|
984
1006
|
const res = await client.listAppVersions(application);
|
|
985
1007
|
const versions = (res.versions ?? []).map(compactVersion);
|
|
986
1008
|
if (versions.length === 0) {
|
|
@@ -1002,12 +1024,22 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1002
1024
|
'of its env vars (values are never shown). Use it before edgegap_update_app_version or edgegap_deploy ' +
|
|
1003
1025
|
'to check what a version will do.',
|
|
1004
1026
|
inputSchema: {
|
|
1005
|
-
|
|
1006
|
-
|
|
1027
|
+
// Optional so a call without them lists what to pick from instead of failing validation.
|
|
1028
|
+
application: z.string().optional().describe('Application name. Required; without it the applications are listed.'),
|
|
1029
|
+
version: z.string().optional().describe('Version name, as listed by edgegap_list_app_versions. Required; without it the versions are listed.'),
|
|
1007
1030
|
},
|
|
1008
1031
|
outputSchema: OUTPUT.getAppVersion,
|
|
1009
1032
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
1010
1033
|
}, async ({ application, version }) => guarded(auth, NOT_FOUND.app, async () => {
|
|
1034
|
+
if (!application?.trim())
|
|
1035
|
+
return pickApplication('edgegap_get_app_version');
|
|
1036
|
+
if (!version?.trim()) {
|
|
1037
|
+
const res = await client.listAppVersions(application);
|
|
1038
|
+
const versions = (res.versions ?? []).map((v) => v.name);
|
|
1039
|
+
return emptyState('needs_input', { application, versions }, versions.length
|
|
1040
|
+
? `Pass version too: call edgegap_get_app_version again with application "${application}" and one of these versions.`
|
|
1041
|
+
: `Application "${application}" has no versions yet. Register one with edgegap_create_app_version.`);
|
|
1042
|
+
}
|
|
1011
1043
|
const v = await client.getAppVersion(application, version);
|
|
1012
1044
|
return ok({
|
|
1013
1045
|
application,
|
|
@@ -1401,7 +1433,23 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1401
1433
|
await dry.client.updateAppVersion(args.application, args.version, body);
|
|
1402
1434
|
return dryRunResult(dry.requests, notes);
|
|
1403
1435
|
}
|
|
1404
|
-
|
|
1436
|
+
try {
|
|
1437
|
+
await client.updateAppVersion(args.application, args.version, body);
|
|
1438
|
+
}
|
|
1439
|
+
catch (err) {
|
|
1440
|
+
// "Image validation unsuccessful ... Unable to login with the given
|
|
1441
|
+
// credentials" (live, 2026-10-29 to 11-01, three organizations).
|
|
1442
|
+
if (err instanceof EdgegapApiError && err.status === 400 && /login|credential/i.test(err.apiMessage)) {
|
|
1443
|
+
return withMeta(fail(`${err.message}\n\nEdgegap could not log in to the registry to verify the image, so nothing was changed. ` +
|
|
1444
|
+
'It pulls with the registry login saved on the version (registry.edgegap.com included), not your API ' +
|
|
1445
|
+
'token, and that login is missing or wrong.\n\nOptions:\n' +
|
|
1446
|
+
'1. Update again with verify_image false. Deployments still fail to pull until the developer sets ' +
|
|
1447
|
+
`the registry username and token on the version in the dashboard (${DASHBOARD_URL}).\n` +
|
|
1448
|
+
'2. If the developer chooses to give them to you, pass registry_username and registry_token in the ' +
|
|
1449
|
+
'same update. They are registry-scoped, not the org API token. Do not write them into files.'), { code: 'UPSTREAM_REJECTED', stage: 'upstream' });
|
|
1450
|
+
}
|
|
1451
|
+
throw err;
|
|
1452
|
+
}
|
|
1405
1453
|
return ok({
|
|
1406
1454
|
updated: `${args.application}/${args.version}`,
|
|
1407
1455
|
changed: Object.keys(body).map((k) => (k === 'private_token' ? 'registry_token' : k === 'private_username' ? 'registry_username' : k)),
|
|
@@ -1422,7 +1470,7 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1422
1470
|
application: z.string().optional().describe('With version: only locations with capacity for it now.'),
|
|
1423
1471
|
version: z.string().optional(),
|
|
1424
1472
|
page: z.number().int().min(1).optional(),
|
|
1425
|
-
limit: z.number().int().
|
|
1473
|
+
limit: z.number().int().optional().describe('Results per page, 1-200. Default 100.'),
|
|
1426
1474
|
},
|
|
1427
1475
|
outputSchema: OUTPUT.listLocations,
|
|
1428
1476
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
@@ -1430,7 +1478,7 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1430
1478
|
if ((application === undefined) !== (version === undefined)) {
|
|
1431
1479
|
return fail('Pass both application and version to filter by capacity, or neither for every location.');
|
|
1432
1480
|
}
|
|
1433
|
-
const res = await client.listLocations({ app: application, version, page, limit: limit
|
|
1481
|
+
const res = await client.listLocations({ app: application, version, page, limit: clamp(limit, 1, 200, 100) });
|
|
1434
1482
|
const locations = (res.locations ?? []).map((l) => ({
|
|
1435
1483
|
city: l.city,
|
|
1436
1484
|
region: l.administrative_division || undefined,
|
|
@@ -1453,12 +1501,12 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1453
1501
|
'measurements. Read-only; the game client does the pinging, not this tool.',
|
|
1454
1502
|
inputSchema: {
|
|
1455
1503
|
page: z.number().int().min(1).optional(),
|
|
1456
|
-
limit: z.number().int().
|
|
1504
|
+
limit: z.number().int().optional().describe('Results per page, 1-200. Default 100.'),
|
|
1457
1505
|
},
|
|
1458
1506
|
outputSchema: OUTPUT.listPingBeacons,
|
|
1459
1507
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
1460
1508
|
}, async ({ page, limit }) => guard(auth, async () => {
|
|
1461
|
-
const res = await client.listBeacons({ page, limit: limit
|
|
1509
|
+
const res = await client.listBeacons({ page, limit: clamp(limit, 1, 200, 100) });
|
|
1462
1510
|
const beacons = (res.locations ?? []).map((b) => ({
|
|
1463
1511
|
host: b.fqdn ?? b.host,
|
|
1464
1512
|
udp_port: b.udp_port,
|
|
@@ -1783,6 +1831,20 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1783
1831
|
// Fetched now, not left to the agent: a failed deployment is
|
|
1784
1832
|
// cleaned up quickly and its logs go with it, so a separate
|
|
1785
1833
|
// edgegap_get_deployment_logs call often finds nothing.
|
|
1834
|
+
const detail = last.error_detail ?? '';
|
|
1835
|
+
// "Unable to pull image from registry" (live, 2026-10-29 and 11-02):
|
|
1836
|
+
// the container never started, so there are no logs to read. The
|
|
1837
|
+
// cause is the version's image reference or registry login.
|
|
1838
|
+
if (/pull image|unable to pull|image pull|unable to login/i.test(detail)) {
|
|
1839
|
+
return withMeta(fail(`Deployment ${request_id} failed with status ${last.current_status}.\n${detail}\n\n` +
|
|
1840
|
+
'Edgegap could not pull the server image, so the container never started and has no logs. ' +
|
|
1841
|
+
'Check with edgegap_get_app_version that docker_repository, docker_image and docker_tag name ' +
|
|
1842
|
+
'an image that exists (edgegap_list_registry_tags for registry.edgegap.com), and that the version ' +
|
|
1843
|
+
`has a working registry login: a version saved with the "${ENCRYPTED_PLACEHOLDER}" placeholder, ` +
|
|
1844
|
+
'or without a login for a private registry, cannot pull. The developer can set the registry ' +
|
|
1845
|
+
`username and token on the version in the dashboard (${DASHBOARD_URL}). Do not redeploy the ` +
|
|
1846
|
+
'same version unchanged: it will fail the same way.', 'IMAGE_PULL_FAILED'), { ...facts('error'), stage: 'upstream', upstreamStatus: 200 });
|
|
1847
|
+
}
|
|
1786
1848
|
const logs = await logTail(client, request_id, 3000);
|
|
1787
1849
|
return withMeta(fail(`Deployment ${request_id} failed with status ${last.current_status}.\n` +
|
|
1788
1850
|
`${last.error_detail ?? 'No error detail returned.'}\n\n` +
|
|
@@ -1791,7 +1853,9 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
1791
1853
|
'Do not redeploy the same version unchanged: it will fail the same way.'
|
|
1792
1854
|
: `No container logs could be read here (the container may never have started, or it ` +
|
|
1793
1855
|
`was already cleaned up). Try edgegap_get_deployment_logs {request_id: "${request_id}"} once; ` +
|
|
1794
|
-
'if it has nothing either, check the image, tag and ports before redeploying.'), 'DEPLOYMENT_FAILED'),
|
|
1856
|
+
'if it has nothing either, check the image, tag and ports before redeploying.'), 'DEPLOYMENT_FAILED'),
|
|
1857
|
+
// The status read (200) failed the call, not the log lookup's 404.
|
|
1858
|
+
{ ...facts('error'), stage: 'upstream', upstreamStatus: 200 });
|
|
1795
1859
|
}
|
|
1796
1860
|
if (last.running || TERMINAL_OK.some((s) => status.includes(s))) {
|
|
1797
1861
|
return withMeta(ok({
|
|
@@ -2001,6 +2065,14 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2001
2065
|
res = await client.getDeploymentLogs(request_id);
|
|
2002
2066
|
}
|
|
2003
2067
|
catch (err) {
|
|
2068
|
+
// The logs endpoint can take longer than the request timeout (live,
|
|
2069
|
+
// 2026-11-19, twice on one deployment). The read was already retried
|
|
2070
|
+
// once; say what to do rather than fail.
|
|
2071
|
+
if (!(err instanceof EdgegapApiError) && /timed out after/.test(err?.message ?? '')) {
|
|
2072
|
+
return emptyState('not_ready', { request_id, logs: '' }, 'Edgegap took too long to return this deployment\'s logs. Try edgegap_get_deployment_logs once more in ' +
|
|
2073
|
+
'about 30 seconds. If it times out again, check the deployment with edgegap_get_deployment, or read ' +
|
|
2074
|
+
'the logs in the dashboard (' + DASHBOARD_URL + ').');
|
|
2075
|
+
}
|
|
2004
2076
|
// The logs endpoint answers 400 for every "no logs" case alike. Ask
|
|
2005
2077
|
// the status endpoint which one this is.
|
|
2006
2078
|
if (!(err instanceof EdgegapApiError) || ![400, 404].includes(err.status))
|
|
@@ -2043,7 +2115,34 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2043
2115
|
const bad = checkRequestId(request_id);
|
|
2044
2116
|
if (bad)
|
|
2045
2117
|
return bad;
|
|
2046
|
-
|
|
2118
|
+
// A window ending in the future is a 422 ("start_time cannot be in the
|
|
2119
|
+
// future"); clamp what was passed to now rather than fail on it.
|
|
2120
|
+
const future = (t) => t !== undefined && Date.parse(t) > Date.now();
|
|
2121
|
+
if (future(start_time)) {
|
|
2122
|
+
return fail(`start_time ${start_time} is in the future. Pass an ISO 8601 time in the past, or leave it out ` +
|
|
2123
|
+
'for the whole life of the deployment.', 'VALIDATION_FAILED');
|
|
2124
|
+
}
|
|
2125
|
+
const endTime = future(end_time) ? undefined : end_time;
|
|
2126
|
+
let m;
|
|
2127
|
+
try {
|
|
2128
|
+
m = await client.getDeploymentMetrics(request_id, { start_time, end_time: endTime, steps: step });
|
|
2129
|
+
}
|
|
2130
|
+
catch (err) {
|
|
2131
|
+
if (!(err instanceof EdgegapApiError) || err.status !== 422)
|
|
2132
|
+
throw err;
|
|
2133
|
+
// Not failures to correct: the deployment ended (no metrics are kept),
|
|
2134
|
+
// or it started too recently for the API's default window (live,
|
|
2135
|
+
// 2026-11-06: "start_time cannot be in the future" with no start_time).
|
|
2136
|
+
if (/terminated|cannot fetch metrics/i.test(err.apiMessage)) {
|
|
2137
|
+
return emptyState('expired', { request_id }, 'This deployment has ended, and Edgegap only serves metrics while one runs. For a stopped ' +
|
|
2138
|
+
'deployment use what it left: edgegap_get_deployment for its error detail. To size a version, ' +
|
|
2139
|
+
'read metrics from a running deployment of it (edgegap_compare_versions reads several).');
|
|
2140
|
+
}
|
|
2141
|
+
if (/start_time|end_time/i.test(err.apiMessage) && start_time === undefined) {
|
|
2142
|
+
return emptyState('not_ready', { request_id }, `No metrics yet: the deployment started too recently. Call edgegap_get_deployment_metrics {request_id: "${request_id}"} again in a minute.`);
|
|
2143
|
+
}
|
|
2144
|
+
throw err;
|
|
2145
|
+
}
|
|
2047
2146
|
const series = {
|
|
2048
2147
|
cpu: analyzeSeries(m.cpu),
|
|
2049
2148
|
cpu_throttle_rate: analyzeSeries(m.cpu_throttle_rate, { nonzero: true }),
|
|
@@ -3608,9 +3707,11 @@ function registerSkills(server, tool, config, options) {
|
|
|
3608
3707
|
inputSchema: {
|
|
3609
3708
|
// A string, not an enum: clients cache tool schemas, and a cached enum from an older
|
|
3610
3709
|
// release would refuse a skill the router already points to. The handler checks the name.
|
|
3710
|
+
// Optional so a call without it lists the skills instead of failing validation.
|
|
3611
3711
|
skill: z
|
|
3612
3712
|
.string()
|
|
3613
|
-
.
|
|
3713
|
+
.optional()
|
|
3714
|
+
.describe(`Skill name, from edgegap_list_skills: ${names.join(', ')}. Required; without it the skills are listed.`),
|
|
3614
3715
|
file: z
|
|
3615
3716
|
.string()
|
|
3616
3717
|
.optional()
|
|
@@ -3618,6 +3719,9 @@ function registerSkills(server, tool, config, options) {
|
|
|
3618
3719
|
},
|
|
3619
3720
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
|
|
3620
3721
|
}, async ({ skill: name, file }) => {
|
|
3722
|
+
if (!name?.trim()) {
|
|
3723
|
+
return emptyState('needs_input', { pack, skills: SKILLS_PACK.skills.map((s) => ({ name: s.name, description: s.description })) }, 'Pass skill: call edgegap_get_skill again with the name of the skill that matches the project ("edgegap" when unsure).');
|
|
3724
|
+
}
|
|
3621
3725
|
const skill = findSkill(name);
|
|
3622
3726
|
if (!skill) {
|
|
3623
3727
|
const guess = closestSkill(name, names);
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgegap/mcp",
|
|
3
3
|
"mcpName": "dev.edgegap/mcp",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.5",
|
|
5
5
|
"description": "Check, push, and deploy game servers on Edgegap from your coding agent, with relays for P2P games. Runs locally; your API token never leaves your machine.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prebuild": "rm -rf dist",
|
|
8
8
|
"build": "tsc && node scripts/chmod-bin.mjs",
|
|
9
9
|
"typecheck": "tsc --noEmit",
|
|
10
10
|
"typecheck:worker": "tsc -p worker/tsconfig.json --noEmit",
|
|
11
|
-
"test": "node --test test/unit.test.mjs && node test/package.mjs && node test/skills.mjs && node test/updateskills.mjs && node test/smoke.mjs && node test/guards.mjs && node test/elicit.mjs && node test/newtools.mjs && node test/ops.mjs && node test/emptystates.mjs && node test/reports.mjs && node test/http.mjs && node test/retries.mjs && node test/spec.mjs && node test/snapshot.mjs",
|
|
11
|
+
"test": "node --test test/unit.test.mjs && node test/package.mjs && node test/skills.mjs && node test/updateskills.mjs && node test/smoke.mjs && node test/guards.mjs && node test/elicit.mjs && node test/newtools.mjs && node test/ops.mjs && node test/emptystates.mjs && node test/errorreview.mjs && node test/reports.mjs && node test/http.mjs && node test/retries.mjs && node test/spec.mjs && node test/snapshot.mjs",
|
|
12
12
|
"test:unit": "node --test test/unit.test.mjs",
|
|
13
13
|
"snapshot:update": "node test/snapshot.mjs --update",
|
|
14
14
|
"scan": "node scripts/scan-repo.mjs",
|