@xiawan-play/steam-tools-mcp 0.1.1 → 0.1.2
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/.env.example +0 -1
- package/README.md +3 -28
- package/dist/server.js +138 -425
- package/docs/configuration.md +2 -21
- package/package.json +2 -2
package/.env.example
CHANGED
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# @xiawan-play/steam-tools-mcp
|
|
2
2
|
|
|
3
|
-
一个面向 Node.js 的 Steam 相关 MCP
|
|
3
|
+
一个面向 Node.js 的 Steam 相关 MCP 服务,提供中文友好的高频工具和我的账号快捷工具。
|
|
4
4
|
|
|
5
5
|
## 特性
|
|
6
6
|
|
|
7
7
|
- 开箱即用的高频 Steam 工具,适合资料、游戏库、成就、新闻和应用检索场景。
|
|
8
8
|
- 提供 `steam_me_*` 快捷工具,适合长期绑定个人账号使用。
|
|
9
|
-
- 自动同步官方 Steam Web API 文档,并可按需开启辅助探索工具与全量官方方法工具。
|
|
10
9
|
- 工具标题、说明和参数描述优先面向中文用户设计。
|
|
11
10
|
- 支持 `stdio`,也支持可选的 Streamable HTTP 传输方式。
|
|
12
11
|
|
|
@@ -52,8 +51,7 @@ npm start
|
|
|
52
51
|
],
|
|
53
52
|
"env": {
|
|
54
53
|
"STEAM_WEB_API_KEY": "YOUR_WEB_API_KEY",
|
|
55
|
-
"STEAM_DEFAULT_STEAMID": "YOUR_STEAM_ID64"
|
|
56
|
-
"STEAM_ENABLE_GENERATED_TOOLS": "false"
|
|
54
|
+
"STEAM_DEFAULT_STEAMID": "YOUR_STEAM_ID64"
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
}
|
|
@@ -65,8 +63,7 @@ npm start
|
|
|
65
63
|
| 变量 | 默认值 | 作用 |
|
|
66
64
|
| --- | --- | --- |
|
|
67
65
|
| `STEAM_WEB_API_KEY` | 无 | 默认使用的 Steam API Key,调用需要 `key` 的接口时会自动注入。 |
|
|
68
|
-
| `STEAM_DEFAULT_STEAMID` | 无 | 默认查询用户的 SteamID64
|
|
69
|
-
| `STEAM_ENABLE_GENERATED_TOOLS` | `false` | 是否启用辅助探索工具和完整的自动生成 Steam 方法工具集。 |
|
|
66
|
+
| `STEAM_DEFAULT_STEAMID` | 无 | 默认查询用户的 SteamID64。高频聚合工具在未传用户参数时会自动使用它;`steam_me_*` 工具也会使用它作为默认账号。 |
|
|
70
67
|
|
|
71
68
|
### 其他可选环境变量
|
|
72
69
|
|
|
@@ -115,34 +112,12 @@ npm start
|
|
|
115
112
|
| `steam_me_groups` | 我的 Steam 群组 | 查看群组列表;普通 user key 场景下可能没有结果。 |
|
|
116
113
|
| `steam_me_wishlist_like_feed` | 我的 Steam 关注流 | 默认按最近游玩的 AppID 聚合新闻和热度,也可切换到常玩游戏、混合来源或显式 AppID。 |
|
|
117
114
|
|
|
118
|
-
### 可选:辅助探索工具
|
|
119
|
-
|
|
120
|
-
当 `STEAM_ENABLE_GENERATED_TOOLS=true` 时,这组工具会一起开启,适合探索官方方法目录和做原始调试。
|
|
121
|
-
|
|
122
|
-
| Tool ID | 中文名 | 说明 |
|
|
123
|
-
| --- | --- | --- |
|
|
124
|
-
| `steam_list_interfaces` | Steam 接口列表 | 列出当前已同步的接口目录,可按关键字和 Service Interface 过滤。 |
|
|
125
|
-
| `steam_list_methods` | Steam 方法搜索 | 搜索当前已同步的方法,可按接口、关键字和鉴权要求过滤。 |
|
|
126
|
-
| `steam_get_method_details` | Steam 方法详情 | 查看某个方法的参数、鉴权要求、来源链接和元信息。 |
|
|
127
|
-
| `steam_call_raw` | Steam 原始调用 | 按接口名和方法名直接调用底层 Steam Web API,适合兜底和调试。 |
|
|
128
|
-
|
|
129
|
-
### 可选:自动生成官方工具
|
|
130
|
-
|
|
131
|
-
当 `STEAM_ENABLE_GENERATED_TOOLS=true` 时,同步后的官方 Steam 方法也会作为独立 tool 自动注册。工具 id 保持英文,标题和说明会尽量提供中文友好展示。例如:
|
|
132
|
-
|
|
133
|
-
| Tool ID | 中文名 | 说明 |
|
|
134
|
-
| --- | --- | --- |
|
|
135
|
-
| `steam_i_player_service_get_owned_games` | 已拥有游戏 | 读取指定玩家的游戏库。 |
|
|
136
|
-
| `steam_i_steam_user_stats_get_player_achievements` | 玩家成就 | 读取指定游戏的个人成就列表。 |
|
|
137
|
-
| `steam_i_steam_news_get_news_for_app` | 应用新闻 | 读取指定应用的 Steam 新闻。 |
|
|
138
|
-
|
|
139
115
|
## 使用说明
|
|
140
116
|
|
|
141
117
|
- 资料、游戏库、个人成就、好友等大多数“用户数据”场景通常需要 `STEAM_WEB_API_KEY`;新闻、在线人数这类公开接口可以直接使用。
|
|
142
118
|
- 如果配置了 `STEAM_DEFAULT_STEAMID`,大多数按用户查询的高频工具在不传用户参数时会默认查这个账号;`steam_me_*` 工具也依赖它,未配置时会直接返回明确错误。
|
|
143
119
|
- 用户资料、游戏库、成就等结果仍然会受到目标账号隐私设置影响。
|
|
144
120
|
- `steam_search_apps` / `steam_resolve_app` 的名称搜索,以及需要 schema 补充信息的场景,通常也需要 `STEAM_WEB_API_KEY`。
|
|
145
|
-
- 默认模式只暴露高频工具和 `steam_me_*` 快捷工具;只有在需要辅助探索工具、底层官方方法或调试时,再开启 `STEAM_ENABLE_GENERATED_TOOLS=true`。
|
|
146
121
|
- `steam_me_groups` 依赖的底层接口在官方文档中偏 `publisher key` 场景,普通 user key 很可能拿不到结果。
|
|
147
122
|
- Steam 官方文档里的 `ISteamApps.GetAppList` 当前已经标记为 deprecated,直接调通常会返回 `404`;本服务会明确提示你改用 `steam_search_apps`、`steam_resolve_app` 或 `IStoreService.GetAppList`。
|
|
148
123
|
- 对于 Service Interface,本服务会用 `input_json` 方式发送请求,这样数组和对象参数会更稳定。
|
package/dist/server.js
CHANGED
|
@@ -9882,11 +9882,11 @@ function parseAppIdCollection(value) {
|
|
|
9882
9882
|
function getNestedValue(value, ...keys) {
|
|
9883
9883
|
let current = value;
|
|
9884
9884
|
for (const key of keys) {
|
|
9885
|
-
const
|
|
9886
|
-
if (!
|
|
9885
|
+
const record2 = asRecord(current);
|
|
9886
|
+
if (!record2) {
|
|
9887
9887
|
return void 0;
|
|
9888
9888
|
}
|
|
9889
|
-
current =
|
|
9889
|
+
current = record2[key];
|
|
9890
9890
|
}
|
|
9891
9891
|
return current;
|
|
9892
9892
|
}
|
|
@@ -9948,119 +9948,16 @@ function chunkStrings(values, chunkSize) {
|
|
|
9948
9948
|
}
|
|
9949
9949
|
return chunks;
|
|
9950
9950
|
}
|
|
9951
|
-
function normalizeAppCatalogType(
|
|
9952
|
-
if (!
|
|
9951
|
+
function normalizeAppCatalogType(record2) {
|
|
9952
|
+
if (!record2) {
|
|
9953
9953
|
return void 0;
|
|
9954
9954
|
}
|
|
9955
|
-
return getStringValue(
|
|
9955
|
+
return getStringValue(record2.type) ?? getStringValue(record2.app_type) ?? getStringValue(record2.app_type_string);
|
|
9956
9956
|
}
|
|
9957
9957
|
|
|
9958
9958
|
// src/lib/steam-client.ts
|
|
9959
9959
|
import * as z from "zod/v4";
|
|
9960
9960
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
9961
|
-
var NUMERIC_PARAM_TYPES = [
|
|
9962
|
-
"int32",
|
|
9963
|
-
"int64",
|
|
9964
|
-
"uint8",
|
|
9965
|
-
"uint16",
|
|
9966
|
-
"uint32",
|
|
9967
|
-
"uint64",
|
|
9968
|
-
"float",
|
|
9969
|
-
"double",
|
|
9970
|
-
"steamid",
|
|
9971
|
-
"steamid64",
|
|
9972
|
-
"gameid",
|
|
9973
|
-
"appid",
|
|
9974
|
-
"publishedfileid",
|
|
9975
|
-
"eresult"
|
|
9976
|
-
];
|
|
9977
|
-
function createToolDescription(method) {
|
|
9978
|
-
const auth = method.requiresPublisherKey ? "\u9700\u8981 Steam publisher key\uFF08\u53D1\u884C\u5546\u5BC6\u94A5\uFF09\u3002" : method.requiresUserKey ? "\u9700\u8981 Steam user Web API key\uFF08\u7528\u6237\u5BC6\u94A5\uFF09\u3002" : "\u6309\u5F53\u524D\u6587\u6863\u53EF\u533F\u540D\u8C03\u7528\uFF0C\u4E0D\u9700\u8981 key\u3002";
|
|
9979
|
-
const service = method.serviceInterface ? "\u8FD9\u662F Steam Service Interface\uFF0C\u8BF7\u6C42\u4F1A\u4EE5 input_json \u65B9\u5F0F\u53D1\u9001\u3002" : "\u8FD9\u662F\u6807\u51C6 Steam Web API \u63A5\u53E3\uFF0C\u4F7F\u7528\u666E\u901A\u53C2\u6570\u98CE\u683C\u8C03\u7528\u3002";
|
|
9980
|
-
const params = method.parameters.length ? `\u53C2\u6570\u6982\u89C8\uFF1A${method.parameters.map(
|
|
9981
|
-
(param) => `${param.inputName}${param.required && param.originalName !== "key" ? "*" : ""}`
|
|
9982
|
-
).join(", ")}\u3002` : "\u53C2\u6570\u6982\u89C8\uFF1A\u65E0\u53C2\u6570\u3002";
|
|
9983
|
-
const officialDescription = method.description?.trim() ? `\u5B98\u65B9\u82F1\u6587\u8BF4\u660E\uFF1A${method.description}` : "\u5B98\u65B9\u82F1\u6587\u8BF4\u660E\uFF1A\u65E0\u3002";
|
|
9984
|
-
return `${officialDescription} \u9274\u6743\u8981\u6C42\uFF1A${auth} \u8C03\u7528\u65B9\u5F0F\uFF1A${service} ${params}`;
|
|
9985
|
-
}
|
|
9986
|
-
function createParamSchema(param, options) {
|
|
9987
|
-
let schema;
|
|
9988
|
-
const normalizedType = param.type.toLowerCase();
|
|
9989
|
-
if (normalizedType === "bool") {
|
|
9990
|
-
schema = z.union([
|
|
9991
|
-
z.boolean(),
|
|
9992
|
-
z.literal("true"),
|
|
9993
|
-
z.literal("false"),
|
|
9994
|
-
z.literal("1"),
|
|
9995
|
-
z.literal("0"),
|
|
9996
|
-
z.literal(1),
|
|
9997
|
-
z.literal(0)
|
|
9998
|
-
]);
|
|
9999
|
-
} else if (normalizedType === "string" || normalizedType === "rawbinary") {
|
|
10000
|
-
schema = z.string();
|
|
10001
|
-
} else if (normalizedType === "{message}" || normalizedType.includes("message")) {
|
|
10002
|
-
schema = z.union([z.record(z.string(), z.any()), z.array(z.any())]);
|
|
10003
|
-
} else if (normalizedType.endsWith("[]")) {
|
|
10004
|
-
const itemType = normalizedType.slice(0, -2);
|
|
10005
|
-
schema = z.array(createScalarSchema(itemType));
|
|
10006
|
-
} else if (NUMERIC_PARAM_TYPES.some((type) => normalizedType.includes(type))) {
|
|
10007
|
-
schema = createScalarSchema(normalizedType);
|
|
10008
|
-
} else {
|
|
10009
|
-
schema = z.union([
|
|
10010
|
-
z.string(),
|
|
10011
|
-
z.number(),
|
|
10012
|
-
z.boolean(),
|
|
10013
|
-
z.record(z.string(), z.any()),
|
|
10014
|
-
z.array(z.any())
|
|
10015
|
-
]);
|
|
10016
|
-
}
|
|
10017
|
-
if (param.isArray && !normalizedType.endsWith("[]")) {
|
|
10018
|
-
schema = z.union([schema, z.array(schema)]);
|
|
10019
|
-
}
|
|
10020
|
-
if (options?.allowDefaultSteamId) {
|
|
10021
|
-
schema = schema.optional();
|
|
10022
|
-
} else if (param.originalName === "key") {
|
|
10023
|
-
schema = schema.optional();
|
|
10024
|
-
} else if (!param.required) {
|
|
10025
|
-
schema = schema.optional();
|
|
10026
|
-
}
|
|
10027
|
-
const details = [
|
|
10028
|
-
`Steam \u53C2\u6570\u540D\uFF1A${param.originalName}\u3002`,
|
|
10029
|
-
`\u7C7B\u578B\uFF1A${param.type}\u3002`,
|
|
10030
|
-
param.required || options?.allowDefaultSteamId ? options?.allowDefaultSteamId ? "\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u5FC5\u586B\uFF1B\u5982\u679C\u5DF2\u7ECF\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u53EF\u4EE5\u7701\u7565\u3002" : "\u662F\u5426\u5FC5\u586B\uFF1A\u662F\u3002" : "\u662F\u5426\u5FC5\u586B\uFF1A\u5426\u3002",
|
|
10031
|
-
param.description ? `\u5B98\u65B9\u82F1\u6587\u8BF4\u660E\uFF1A${param.description}` : "\u5B98\u65B9\u82F1\u6587\u8BF4\u660E\uFF1A\u65E0\u3002"
|
|
10032
|
-
].filter(Boolean).join(" ");
|
|
10033
|
-
return schema.describe(details);
|
|
10034
|
-
}
|
|
10035
|
-
function createScalarSchema(type) {
|
|
10036
|
-
if (type === "bool") {
|
|
10037
|
-
return z.union([
|
|
10038
|
-
z.boolean(),
|
|
10039
|
-
z.literal("true"),
|
|
10040
|
-
z.literal("false"),
|
|
10041
|
-
z.literal("1"),
|
|
10042
|
-
z.literal("0"),
|
|
10043
|
-
z.literal(1),
|
|
10044
|
-
z.literal(0)
|
|
10045
|
-
]);
|
|
10046
|
-
}
|
|
10047
|
-
if (type === "string" || type === "rawbinary") {
|
|
10048
|
-
return z.string();
|
|
10049
|
-
}
|
|
10050
|
-
return z.union([z.string(), z.number()]);
|
|
10051
|
-
}
|
|
10052
|
-
function buildInputSchema(method, options) {
|
|
10053
|
-
if (!method.parameters.length) {
|
|
10054
|
-
return void 0;
|
|
10055
|
-
}
|
|
10056
|
-
const schemaEntries = method.parameters.map((param) => [
|
|
10057
|
-
param.inputName,
|
|
10058
|
-
createParamSchema(param, {
|
|
10059
|
-
allowDefaultSteamId: Boolean(options?.defaultSteamId) && (param.originalName === "steamid" || param.originalName === "steamids")
|
|
10060
|
-
})
|
|
10061
|
-
]);
|
|
10062
|
-
return Object.fromEntries(schemaEntries);
|
|
10063
|
-
}
|
|
10064
9961
|
async function callSteamApi(method, args, options) {
|
|
10065
9962
|
const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
10066
9963
|
const endpoint = resolveEndpointUrl(method.url, options?.baseUrl);
|
|
@@ -10303,18 +10200,18 @@ function parseAppCatalogPage(data) {
|
|
|
10303
10200
|
];
|
|
10304
10201
|
const entries = [];
|
|
10305
10202
|
for (const entry of rawEntries) {
|
|
10306
|
-
const
|
|
10307
|
-
const appid = normalizeScalarInput(
|
|
10308
|
-
const name = getStringValue(
|
|
10203
|
+
const record2 = asRecord(entry);
|
|
10204
|
+
const appid = normalizeScalarInput(record2?.appid);
|
|
10205
|
+
const name = getStringValue(record2?.name);
|
|
10309
10206
|
if (!appid || !name) {
|
|
10310
10207
|
continue;
|
|
10311
10208
|
}
|
|
10312
10209
|
entries.push({
|
|
10313
10210
|
appid,
|
|
10314
10211
|
name,
|
|
10315
|
-
type: normalizeAppCatalogType(
|
|
10316
|
-
lastModified: toNumber(
|
|
10317
|
-
priceChangeNumber: toNumber(
|
|
10212
|
+
type: normalizeAppCatalogType(record2),
|
|
10213
|
+
lastModified: toNumber(record2?.last_modified),
|
|
10214
|
+
priceChangeNumber: toNumber(record2?.price_change_number)
|
|
10318
10215
|
});
|
|
10319
10216
|
}
|
|
10320
10217
|
const lastAppId = normalizeScalarInput(getNestedValue(data, "response", "last_appid")) ?? entries.at(-1)?.appid;
|
|
@@ -10830,10 +10727,10 @@ function createSteamBaseRuntime(spec2, config) {
|
|
|
10830
10727
|
apiKey
|
|
10831
10728
|
);
|
|
10832
10729
|
for (const player of getNestedArray(result.data, "response", "players")) {
|
|
10833
|
-
const
|
|
10730
|
+
const record2 = normalizePlayerSummary({ response: { players: [player] } });
|
|
10834
10731
|
const steamid = getStringValue(asRecord(player)?.steamid);
|
|
10835
|
-
if (steamid &&
|
|
10836
|
-
summaryMap.set(steamid,
|
|
10732
|
+
if (steamid && record2) {
|
|
10733
|
+
summaryMap.set(steamid, record2);
|
|
10837
10734
|
}
|
|
10838
10735
|
}
|
|
10839
10736
|
}
|
|
@@ -10849,10 +10746,10 @@ function createSteamBaseRuntime(spec2, config) {
|
|
|
10849
10746
|
apiKey
|
|
10850
10747
|
);
|
|
10851
10748
|
for (const player of getNestedArray(result.data, "players")) {
|
|
10852
|
-
const
|
|
10749
|
+
const record2 = normalizePlayerBan({ players: [player] });
|
|
10853
10750
|
const steamid = getStringValue(asRecord(player)?.SteamId);
|
|
10854
|
-
if (steamid &&
|
|
10855
|
-
banMap.set(steamid,
|
|
10751
|
+
if (steamid && record2) {
|
|
10752
|
+
banMap.set(steamid, record2);
|
|
10856
10753
|
}
|
|
10857
10754
|
}
|
|
10858
10755
|
}
|
|
@@ -11989,174 +11886,8 @@ function registerAppTools(server, runtime2) {
|
|
|
11989
11886
|
);
|
|
11990
11887
|
}
|
|
11991
11888
|
|
|
11992
|
-
// src/tools/generated.ts
|
|
11993
|
-
function registerGeneratedTools(server, runtime2) {
|
|
11994
|
-
for (const method of runtime2.spec.methods) {
|
|
11995
|
-
const inputSchema = buildInputSchema(method, {
|
|
11996
|
-
defaultSteamId: runtime2.config.defaultSteamId
|
|
11997
|
-
});
|
|
11998
|
-
const annotations = {
|
|
11999
|
-
readOnlyHint: method.httpMethod === "GET",
|
|
12000
|
-
openWorldHint: true
|
|
12001
|
-
};
|
|
12002
|
-
server.registerTool(
|
|
12003
|
-
method.toolName,
|
|
12004
|
-
{
|
|
12005
|
-
title: createGeneratedToolTitle(method),
|
|
12006
|
-
description: createToolDescription(method),
|
|
12007
|
-
...inputSchema ? { inputSchema } : {},
|
|
12008
|
-
annotations
|
|
12009
|
-
},
|
|
12010
|
-
async (args) => runtime2.executeSteamMethod(method, args ?? {})
|
|
12011
|
-
);
|
|
12012
|
-
}
|
|
12013
|
-
}
|
|
12014
|
-
|
|
12015
|
-
// src/tools/helpers.ts
|
|
12016
|
-
import * as z3 from "zod/v4";
|
|
12017
|
-
function registerHelperTools(server, runtime2) {
|
|
12018
|
-
server.registerTool(
|
|
12019
|
-
"steam_list_interfaces",
|
|
12020
|
-
{
|
|
12021
|
-
title: "Steam \u63A5\u53E3\u5217\u8868",
|
|
12022
|
-
description: "\u5217\u51FA\u5F53\u524D\u5DF2\u540C\u6B65\u7684 Steam Web API \u63A5\u53E3\u3002",
|
|
12023
|
-
inputSchema: {
|
|
12024
|
-
search: z3.string().optional().describe("\u53EF\u9009\u5173\u952E\u5B57\uFF0C\u5927\u5C0F\u5199\u4E0D\u654F\u611F\uFF0C\u5339\u914D\u63A5\u53E3\u540D\u6216\u63A5\u53E3\u63CF\u8FF0\u3002"),
|
|
12025
|
-
serviceOnly: z3.boolean().optional().describe("\u662F\u5426\u53EA\u8FD4\u56DE Steam Service Interface\u3002")
|
|
12026
|
-
},
|
|
12027
|
-
annotations: {
|
|
12028
|
-
readOnlyHint: true,
|
|
12029
|
-
openWorldHint: false
|
|
12030
|
-
}
|
|
12031
|
-
},
|
|
12032
|
-
async ({ search, serviceOnly }) => {
|
|
12033
|
-
const query = search?.toLowerCase();
|
|
12034
|
-
const interfaces = runtime2.spec.interfaces.filter((entry) => {
|
|
12035
|
-
if (serviceOnly && !entry.serviceInterface) {
|
|
12036
|
-
return false;
|
|
12037
|
-
}
|
|
12038
|
-
if (!query) {
|
|
12039
|
-
return true;
|
|
12040
|
-
}
|
|
12041
|
-
return entry.name.toLowerCase().includes(query) || entry.description.toLowerCase().includes(query);
|
|
12042
|
-
});
|
|
12043
|
-
const content = {
|
|
12044
|
-
generatedAt: runtime2.spec.generatedAt,
|
|
12045
|
-
interfaceCount: interfaces.length,
|
|
12046
|
-
interfaces: interfaces.map((entry) => ({
|
|
12047
|
-
name: entry.name,
|
|
12048
|
-
description: entry.description,
|
|
12049
|
-
serviceInterface: entry.serviceInterface,
|
|
12050
|
-
sourceUrl: entry.sourceUrl,
|
|
12051
|
-
methodCount: runtime2.spec.methods.filter(
|
|
12052
|
-
(method) => method.interfaceName === entry.name
|
|
12053
|
-
).length
|
|
12054
|
-
}))
|
|
12055
|
-
};
|
|
12056
|
-
return runtime2.createJsonToolResult(content);
|
|
12057
|
-
}
|
|
12058
|
-
);
|
|
12059
|
-
server.registerTool(
|
|
12060
|
-
"steam_list_methods",
|
|
12061
|
-
{
|
|
12062
|
-
title: "Steam \u65B9\u6CD5\u641C\u7D22",
|
|
12063
|
-
description: "\u641C\u7D22\u5F53\u524D\u5DF2\u540C\u6B65\u7684 Steam Web API \u65B9\u6CD5\u76EE\u5F55\u3002",
|
|
12064
|
-
inputSchema: {
|
|
12065
|
-
interfaceName: z3.string().optional().describe("\u53EF\u9009\u63A5\u53E3\u540D\u8FC7\u6EE4\uFF0C\u4F8B\u5982 ISteamUserStats\u3002"),
|
|
12066
|
-
search: z3.string().optional().describe("\u53EF\u9009\u5173\u952E\u5B57\uFF0C\u5927\u5C0F\u5199\u4E0D\u654F\u611F\uFF0C\u5339\u914D\u65B9\u6CD5\u540D\u6216\u65B9\u6CD5\u63CF\u8FF0\u3002"),
|
|
12067
|
-
auth: z3.enum(["any", "anonymous", "userKey", "publisherKey"]).optional().describe("\u6309\u9274\u6743\u8981\u6C42\u8FC7\u6EE4\u3002"),
|
|
12068
|
-
limit: z3.number().int().min(1).max(500).optional().describe("\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u4E2A\u65B9\u6CD5\uFF0C\u9ED8\u8BA4 50\u3002")
|
|
12069
|
-
},
|
|
12070
|
-
annotations: {
|
|
12071
|
-
readOnlyHint: true,
|
|
12072
|
-
openWorldHint: false
|
|
12073
|
-
}
|
|
12074
|
-
},
|
|
12075
|
-
async ({ interfaceName, search, auth = "any", limit = 50 }) => {
|
|
12076
|
-
const query = search?.toLowerCase();
|
|
12077
|
-
const methods = runtime2.spec.methods.filter((method) => {
|
|
12078
|
-
if (interfaceName && method.interfaceName !== interfaceName) {
|
|
12079
|
-
return false;
|
|
12080
|
-
}
|
|
12081
|
-
if (auth === "anonymous" && !method.supportsAnonymous) {
|
|
12082
|
-
return false;
|
|
12083
|
-
}
|
|
12084
|
-
if (auth === "userKey" && !method.requiresUserKey) {
|
|
12085
|
-
return false;
|
|
12086
|
-
}
|
|
12087
|
-
if (auth === "publisherKey" && !method.requiresPublisherKey) {
|
|
12088
|
-
return false;
|
|
12089
|
-
}
|
|
12090
|
-
if (!query) {
|
|
12091
|
-
return true;
|
|
12092
|
-
}
|
|
12093
|
-
return method.methodName.toLowerCase().includes(query) || method.interfaceName.toLowerCase().includes(query) || method.description.toLowerCase().includes(query);
|
|
12094
|
-
});
|
|
12095
|
-
const content = {
|
|
12096
|
-
generatedAt: runtime2.spec.generatedAt,
|
|
12097
|
-
totalMatches: methods.length,
|
|
12098
|
-
returned: Math.min(methods.length, limit),
|
|
12099
|
-
methods: methods.slice(0, limit).map((method) => ({
|
|
12100
|
-
interfaceName: method.interfaceName,
|
|
12101
|
-
methodName: method.methodName,
|
|
12102
|
-
toolName: method.toolName,
|
|
12103
|
-
httpMethod: method.httpMethod,
|
|
12104
|
-
serviceInterface: method.serviceInterface,
|
|
12105
|
-
requiresUserKey: method.requiresUserKey,
|
|
12106
|
-
requiresPublisherKey: method.requiresPublisherKey,
|
|
12107
|
-
supportsAnonymous: method.supportsAnonymous,
|
|
12108
|
-
sourceUrl: method.sourceUrl
|
|
12109
|
-
}))
|
|
12110
|
-
};
|
|
12111
|
-
return runtime2.createJsonToolResult(content);
|
|
12112
|
-
}
|
|
12113
|
-
);
|
|
12114
|
-
server.registerTool(
|
|
12115
|
-
"steam_get_method_details",
|
|
12116
|
-
{
|
|
12117
|
-
title: "Steam \u65B9\u6CD5\u8BE6\u60C5",
|
|
12118
|
-
description: "\u67E5\u770B\u67D0\u4E2A\u5DF2\u540C\u6B65 Steam Web API \u65B9\u6CD5\u7684\u5B8C\u6574\u5143\u4FE1\u606F\u3002",
|
|
12119
|
-
inputSchema: {
|
|
12120
|
-
toolName: z3.string().optional().describe("\u751F\u6210\u540E\u7684 MCP tool \u540D\uFF0C\u4F8B\u5982 steam_i_player_service_get_owned_games\u3002"),
|
|
12121
|
-
interfaceName: z3.string().optional().describe("\u4E0D\u4F7F\u7528 toolName \u65F6\u53EF\u4F20\u63A5\u53E3\u540D\u3002"),
|
|
12122
|
-
methodName: z3.string().optional().describe("\u4E0D\u4F7F\u7528 toolName \u65F6\u53EF\u4F20\u65B9\u6CD5\u540D\u3002")
|
|
12123
|
-
},
|
|
12124
|
-
annotations: {
|
|
12125
|
-
readOnlyHint: true,
|
|
12126
|
-
openWorldHint: false
|
|
12127
|
-
}
|
|
12128
|
-
},
|
|
12129
|
-
async ({ toolName, interfaceName, methodName }) => {
|
|
12130
|
-
const method = runtime2.resolveMethod({ toolName, interfaceName, methodName });
|
|
12131
|
-
return runtime2.createJsonToolResult(method);
|
|
12132
|
-
}
|
|
12133
|
-
);
|
|
12134
|
-
server.registerTool(
|
|
12135
|
-
"steam_call_raw",
|
|
12136
|
-
{
|
|
12137
|
-
title: "Steam \u539F\u59CB\u8C03\u7528",
|
|
12138
|
-
description: "\u6309\u63A5\u53E3\u540D\u548C\u65B9\u6CD5\u540D\u76F4\u63A5\u8C03\u7528\u4EFB\u610F\u5DF2\u540C\u6B65\u7684 Steam Web API \u65B9\u6CD5\u3002\u9002\u5408\u5728\u751F\u6210\u5DE5\u5177\u7EA6\u675F\u8FC7\u4E25\u65F6\u515C\u5E95\u4F7F\u7528\u3002",
|
|
12139
|
-
inputSchema: {
|
|
12140
|
-
interfaceName: z3.string().describe("Steam Web API \u63A5\u53E3\u540D\uFF0C\u4F8B\u5982 ISteamUserStats\u3002"),
|
|
12141
|
-
methodName: z3.string().describe("Steam Web API \u65B9\u6CD5\u540D\uFF0C\u4F8B\u5982 GetNumberOfCurrentPlayers\u3002"),
|
|
12142
|
-
params: z3.record(z3.string(), z3.any()).optional().describe("\u539F\u59CB\u53C2\u6570\u5BF9\u8C61\uFF0C\u952E\u540D\u53EF\u4EE5\u4F7F\u7528 Steam \u539F\u59CB\u53C2\u6570\u540D\u6216\u751F\u6210\u540E\u7684\u8F93\u5165\u53C2\u6570\u540D\u3002"),
|
|
12143
|
-
key: z3.string().optional().describe("\u53EF\u9009 API key \u8986\u76D6\u503C\uFF1B\u4E0D\u4F20\u65F6\u56DE\u9000\u5230 STEAM_WEB_API_KEY\u3002")
|
|
12144
|
-
},
|
|
12145
|
-
annotations: {
|
|
12146
|
-
readOnlyHint: false,
|
|
12147
|
-
openWorldHint: true
|
|
12148
|
-
}
|
|
12149
|
-
},
|
|
12150
|
-
async ({ interfaceName, methodName, params = {}, key }) => {
|
|
12151
|
-
const method = runtime2.resolveMethod({ interfaceName, methodName });
|
|
12152
|
-
const mappedArgs = runtime2.mapRawParams(method, params);
|
|
12153
|
-
return runtime2.executeSteamMethod(method, { ...mappedArgs, key });
|
|
12154
|
-
}
|
|
12155
|
-
);
|
|
12156
|
-
}
|
|
12157
|
-
|
|
12158
11889
|
// src/tools/me.ts
|
|
12159
|
-
import * as
|
|
11890
|
+
import * as z3 from "zod/v4";
|
|
12160
11891
|
|
|
12161
11892
|
// src/services/account.ts
|
|
12162
11893
|
async function buildRecentlyPlayedData(runtime2, input) {
|
|
@@ -12899,15 +12630,15 @@ async function buildAchievementHuntData(runtime2, input) {
|
|
|
12899
12630
|
warnings: [
|
|
12900
12631
|
...runtime2.collectWarnings([playerSummaryCall, ownedGamesCall]),
|
|
12901
12632
|
...inspectedGames.flatMap((entry) => {
|
|
12902
|
-
const
|
|
12903
|
-
if (!
|
|
12633
|
+
const record2 = asRecord(entry);
|
|
12634
|
+
if (!record2) {
|
|
12904
12635
|
return [];
|
|
12905
12636
|
}
|
|
12906
|
-
if (Array.isArray(
|
|
12907
|
-
return
|
|
12637
|
+
if (Array.isArray(record2.warnings)) {
|
|
12638
|
+
return record2.warnings;
|
|
12908
12639
|
}
|
|
12909
|
-
if (typeof
|
|
12910
|
-
return [`appid ${
|
|
12640
|
+
if (typeof record2.error === "string") {
|
|
12641
|
+
return [`appid ${record2.appid ?? "unknown"}: ${record2.error}`];
|
|
12911
12642
|
}
|
|
12912
12643
|
return [];
|
|
12913
12644
|
})
|
|
@@ -12952,9 +12683,9 @@ async function buildLibraryCompareData(runtime2, input) {
|
|
|
12952
12683
|
const summaryMap = /* @__PURE__ */ new Map();
|
|
12953
12684
|
for (const player of getNestedArray(summaryCall.data, "response", "players")) {
|
|
12954
12685
|
const steamid = getStringValue(asRecord(player)?.steamid);
|
|
12955
|
-
const
|
|
12956
|
-
if (steamid &&
|
|
12957
|
-
summaryMap.set(steamid,
|
|
12686
|
+
const record2 = normalizePlayerSummary({ response: { players: [player] } });
|
|
12687
|
+
if (steamid && record2) {
|
|
12688
|
+
summaryMap.set(steamid, record2);
|
|
12958
12689
|
}
|
|
12959
12690
|
}
|
|
12960
12691
|
const myOwnedGames = normalizeOwnedGames(myOwnedGamesCall.data).games;
|
|
@@ -13080,9 +12811,9 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13080
12811
|
title: "\u6211\u7684 Steam \u8D44\u6599",
|
|
13081
12812
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684 Steam \u8D44\u6599\u603B\u89C8\u3002",
|
|
13082
12813
|
inputSchema: {
|
|
13083
|
-
key:
|
|
13084
|
-
includeRecentlyPlayed:
|
|
13085
|
-
recentGamesCount:
|
|
12814
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
12815
|
+
includeRecentlyPlayed: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6700\u8FD1\u6E38\u73A9\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
12816
|
+
recentGamesCount: z3.number().int().min(1).max(20).optional().describe("\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 3\u3002")
|
|
13086
12817
|
},
|
|
13087
12818
|
annotations: {
|
|
13088
12819
|
readOnlyHint: true,
|
|
@@ -13110,12 +12841,12 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13110
12841
|
title: "\u6211\u7684 Steam \u6E38\u620F\u5E93",
|
|
13111
12842
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u6E38\u620F\u5E93\u603B\u89C8\u3002",
|
|
13112
12843
|
inputSchema: {
|
|
13113
|
-
key:
|
|
13114
|
-
includeAppInfo:
|
|
13115
|
-
includePlayedFreeGames:
|
|
13116
|
-
includeRecentGames:
|
|
13117
|
-
recentGamesCount:
|
|
13118
|
-
topGamesCount:
|
|
12844
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
12845
|
+
includeAppInfo: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6E38\u620F\u540D\u79F0\u548C\u56FE\u6807\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
12846
|
+
includePlayedFreeGames: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u73A9\u8FC7\u7684\u514D\u8D39\u6E38\u620F\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
12847
|
+
includeRecentGames: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6700\u8FD1\u6E38\u73A9\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
12848
|
+
recentGamesCount: z3.number().int().min(1).max(20).optional().describe("\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 5\u3002"),
|
|
12849
|
+
topGamesCount: z3.number().int().min(1).max(50).optional().describe("\u6309\u6E38\u73A9\u65F6\u957F\u6392\u5E8F\u8FD4\u56DE\u524D\u591A\u5C11\u4E2A\u6E38\u620F\uFF0C\u9ED8\u8BA4 10\u3002")
|
|
13119
12850
|
},
|
|
13120
12851
|
annotations: {
|
|
13121
12852
|
readOnlyHint: true,
|
|
@@ -13153,8 +12884,8 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13153
12884
|
title: "\u6211\u7684\u6700\u8FD1\u6E38\u73A9",
|
|
13154
12885
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u3002",
|
|
13155
12886
|
inputSchema: {
|
|
13156
|
-
key:
|
|
13157
|
-
count:
|
|
12887
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
12888
|
+
count: z3.number().int().min(1).max(20).optional().describe("\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 10\u3002")
|
|
13158
12889
|
},
|
|
13159
12890
|
annotations: {
|
|
13160
12891
|
readOnlyHint: true,
|
|
@@ -13181,7 +12912,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13181
12912
|
title: "\u6211\u7684 Steam \u5FBD\u7AE0",
|
|
13182
12913
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u7B49\u7EA7\u548C\u5FBD\u7AE0\u4FE1\u606F\u3002",
|
|
13183
12914
|
inputSchema: {
|
|
13184
|
-
key:
|
|
12915
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002")
|
|
13185
12916
|
},
|
|
13186
12917
|
annotations: {
|
|
13187
12918
|
readOnlyHint: true,
|
|
@@ -13207,11 +12938,11 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13207
12938
|
title: "\u6211\u7684 Steam \u6210\u5C31\u603B\u89C8",
|
|
13208
12939
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u5728\u67D0\u4E2A\u6E38\u620F\u4E2D\u7684\u6210\u5C31\u603B\u89C8\u3002",
|
|
13209
12940
|
inputSchema: {
|
|
13210
|
-
appid:
|
|
13211
|
-
key:
|
|
13212
|
-
language:
|
|
13213
|
-
includeStats:
|
|
13214
|
-
recentUnlockedCount:
|
|
12941
|
+
appid: z3.union([z3.string(), z3.number()]).describe("\u8981\u67E5\u770B\u7684 Steam AppID\u3002"),
|
|
12942
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
12943
|
+
language: z3.string().optional().describe("\u53EF\u9009\u8BED\u8A00\u4EE3\u7801\uFF0C\u4F8B\u5982 'schinese' \u6216 'english'\u3002"),
|
|
12944
|
+
includeStats: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u8BE5\u6E38\u620F\u7684\u73A9\u5BB6\u7EDF\u8BA1\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
12945
|
+
recentUnlockedCount: z3.number().int().min(1).max(50).optional().describe("\u9AD8\u4EAE\u5C55\u793A\u6700\u8FD1\u89E3\u9501\u6210\u5C31\u7684\u6570\u91CF\uFF0C\u9ED8\u8BA4 10\u3002")
|
|
13215
12946
|
},
|
|
13216
12947
|
annotations: {
|
|
13217
12948
|
readOnlyHint: true,
|
|
@@ -13247,11 +12978,11 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13247
12978
|
title: "\u6211\u7684 Steam \u597D\u53CB",
|
|
13248
12979
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u597D\u53CB\u5217\u8868\uFF0C\u5E76\u53EF\u9009\u9644\u5E26\u8D44\u6599\u8865\u5145\u4FE1\u606F\u3002",
|
|
13249
12980
|
inputSchema: {
|
|
13250
|
-
key:
|
|
13251
|
-
relationship:
|
|
13252
|
-
includeSummaries:
|
|
13253
|
-
includeBans:
|
|
13254
|
-
limit:
|
|
12981
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
12982
|
+
relationship: z3.string().optional().describe("\u597D\u53CB\u5173\u7CFB\u8FC7\u6EE4\u6761\u4EF6\uFF0C\u9ED8\u8BA4 'friend'\u3002"),
|
|
12983
|
+
includeSummaries: z3.boolean().optional().describe("\u662F\u5426\u4E3A\u597D\u53CB\u8865\u5145\u8D44\u6599\u6458\u8981\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
12984
|
+
includeBans: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u597D\u53CB\u5C01\u7981\u6458\u8981\uFF0C\u9ED8\u8BA4 false\u3002"),
|
|
12985
|
+
limit: z3.number().int().min(1).max(500).optional().describe("\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u4F4D\u597D\u53CB\uFF0C\u9ED8\u8BA4 100\u3002")
|
|
13255
12986
|
},
|
|
13256
12987
|
annotations: {
|
|
13257
12988
|
readOnlyHint: true,
|
|
@@ -13287,10 +13018,10 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13287
13018
|
title: "\u6211\u7684\u597D\u53CB\u52A8\u6001",
|
|
13288
13019
|
description: "\u7A81\u51FA\u663E\u793A\u54EA\u4E9B\u597D\u53CB\u6B63\u5728\u6E38\u620F\u3001\u5728\u7EBF\uFF0C\u6216\u6700\u8FD1\u6D3B\u8DC3\u8FC7\u3002",
|
|
13289
13020
|
inputSchema: {
|
|
13290
|
-
key:
|
|
13291
|
-
limit:
|
|
13292
|
-
onlyInGame:
|
|
13293
|
-
includeBans:
|
|
13021
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13022
|
+
limit: z3.number().int().min(1).max(500).optional().describe("\u6700\u591A\u68C0\u67E5\u591A\u5C11\u4F4D\u597D\u53CB\uFF0C\u9ED8\u8BA4 100\u3002"),
|
|
13023
|
+
onlyInGame: z3.boolean().optional().describe("\u662F\u5426\u53EA\u8FD4\u56DE\u5F53\u524D\u6B63\u5728\u6E38\u620F\u7684\u597D\u53CB\uFF0C\u9ED8\u8BA4 false\u3002"),
|
|
13024
|
+
includeBans: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u8FD4\u56DE\u597D\u53CB\u7684\u5C01\u7981\u6458\u8981\uFF0C\u9ED8\u8BA4 false\u3002")
|
|
13294
13025
|
},
|
|
13295
13026
|
annotations: {
|
|
13296
13027
|
readOnlyHint: true,
|
|
@@ -13319,12 +13050,12 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13319
13050
|
title: "\u6211\u7684\u597D\u53CB\u7F51\u7EDC",
|
|
13320
13051
|
description: "\u4E3A\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u751F\u6210\u597D\u53CB\u7F51\u7EDC\u89C6\u56FE\uFF0C\u5305\u542B\u6D3B\u52A8\u5206\u7EC4\u548C\u9002\u5408\u56FE\u8C31\u5C55\u793A\u7684 nodes/edges\u3002",
|
|
13321
13052
|
inputSchema: {
|
|
13322
|
-
key:
|
|
13323
|
-
limit:
|
|
13324
|
-
activityWindowHours:
|
|
13325
|
-
includeBans:
|
|
13326
|
-
includeGraph:
|
|
13327
|
-
includeGameNodes:
|
|
13053
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13054
|
+
limit: z3.number().int().min(1).max(500).optional().describe("\u6700\u591A\u68C0\u67E5\u591A\u5C11\u4F4D\u597D\u53CB\uFF0C\u9ED8\u8BA4 150\u3002"),
|
|
13055
|
+
activityWindowHours: z3.number().int().min(1).max(720).optional().describe("\u591A\u5C11\u5C0F\u65F6\u5185\u7B97\u201C\u6700\u8FD1\u6D3B\u8DC3\u201D\uFF0C\u9ED8\u8BA4 72\u3002"),
|
|
13056
|
+
includeBans: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u8FD4\u56DE\u597D\u53CB\u7684\u5C01\u7981\u6458\u8981\uFF0C\u9ED8\u8BA4 false\u3002"),
|
|
13057
|
+
includeGraph: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u9002\u5408\u56FE\u8C31\u6E32\u67D3\u7684 nodes \u548C edges\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13058
|
+
includeGameNodes: z3.boolean().optional().describe("\u56FE\u8C31\u8F93\u51FA\u4E2D\u662F\u5426\u5305\u542B\u5F53\u524D\u6B63\u5728\u73A9\u7684\u6E38\u620F\u8282\u70B9\uFF0C\u9ED8\u8BA4 true\u3002")
|
|
13328
13059
|
},
|
|
13329
13060
|
annotations: {
|
|
13330
13061
|
readOnlyHint: true,
|
|
@@ -13362,7 +13093,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13362
13093
|
title: "\u6211\u7684\u5C01\u7981\u72B6\u6001",
|
|
13363
13094
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u5C01\u7981\u6458\u8981\u3002",
|
|
13364
13095
|
inputSchema: {
|
|
13365
|
-
key:
|
|
13096
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002")
|
|
13366
13097
|
},
|
|
13367
13098
|
annotations: {
|
|
13368
13099
|
readOnlyHint: true,
|
|
@@ -13388,12 +13119,12 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13388
13119
|
title: "\u6211\u7684\u6E38\u620F\u5E93\u5BF9\u6BD4",
|
|
13389
13120
|
description: "\u628A\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u6E38\u620F\u5E93\u4E0E\u53E6\u4E00\u4F4D\u73A9\u5BB6\u8FDB\u884C\u5BF9\u6BD4\u3002",
|
|
13390
13121
|
inputSchema: {
|
|
13391
|
-
steamid:
|
|
13392
|
-
vanityUrl:
|
|
13393
|
-
key:
|
|
13394
|
-
includeOnlyMineSample:
|
|
13395
|
-
includeOnlyOtherSample:
|
|
13396
|
-
includeSharedTop:
|
|
13122
|
+
steamid: z3.union([z3.string(), z3.number()]).optional().describe("\u5BF9\u65B9\u73A9\u5BB6\u7684 SteamID64\u3002\u4E0E vanityUrl \u4E8C\u9009\u4E00\u3002"),
|
|
13123
|
+
vanityUrl: z3.string().optional().describe("\u5BF9\u65B9\u73A9\u5BB6\u7684 Steam \u81EA\u5B9A\u4E49\u4E3B\u9875\u6807\u8BC6\u3002\u4E0E steamid \u4E8C\u9009\u4E00\u3002"),
|
|
13124
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13125
|
+
includeOnlyMineSample: z3.number().int().min(1).max(50).optional().describe("\u4F60\u7684\u5E93\u4E2D\u72EC\u6709\u6E38\u620F\u91C7\u6837\u6570\u91CF\uFF0C\u9ED8\u8BA4 10\u3002"),
|
|
13126
|
+
includeOnlyOtherSample: z3.number().int().min(1).max(50).optional().describe("\u5BF9\u65B9\u5E93\u4E2D\u72EC\u6709\u6E38\u620F\u91C7\u6837\u6570\u91CF\uFF0C\u9ED8\u8BA4 10\u3002"),
|
|
13127
|
+
includeSharedTop: z3.number().int().min(1).max(50).optional().describe("\u5171\u540C\u62E5\u6709\u6E38\u620F\u91CC\u6309\u603B\u6E38\u73A9\u65F6\u957F\u9AD8\u4EAE\u591A\u5C11\u4E2A\uFF0C\u9ED8\u8BA4 20\u3002")
|
|
13397
13128
|
},
|
|
13398
13129
|
annotations: {
|
|
13399
13130
|
readOnlyHint: true,
|
|
@@ -13431,13 +13162,13 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13431
13162
|
title: "\u6211\u7684\u79EF\u538B\u6E38\u620F\u5019\u9009",
|
|
13432
13163
|
description: "\u4ECE\u5DF2\u62E5\u6709\u6E38\u620F\u91CC\u627E\u51FA\u51E0\u4E4E\u6CA1\u73A9\u6216\u8FD8\u6CA1\u5F00\u59CB\u7684\u5019\u9009\uFF0C\u5E76\u53EF\u9009\u9644\u5E26\u70ED\u5EA6\u548C\u65B0\u95FB\u4FE1\u53F7\u3002",
|
|
13433
13164
|
inputSchema: {
|
|
13434
|
-
key:
|
|
13435
|
-
limit:
|
|
13436
|
-
maxPlaytimeHours:
|
|
13437
|
-
minDaysSinceLastPlayed:
|
|
13438
|
-
includeCurrentPlayers:
|
|
13439
|
-
includeNews:
|
|
13440
|
-
preferCommunityVisibleStats:
|
|
13165
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13166
|
+
limit: z3.number().int().min(1).max(30).optional().describe("\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u4E2A\u79EF\u538B\u5019\u9009\uFF0C\u9ED8\u8BA4 12\u3002"),
|
|
13167
|
+
maxPlaytimeHours: z3.number().min(0).max(20).optional().describe("\u53EA\u5305\u542B\u6E38\u73A9\u65F6\u957F\u4E0D\u8D85\u8FC7\u8BE5\u5C0F\u65F6\u6570\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 2\u3002"),
|
|
13168
|
+
minDaysSinceLastPlayed: z3.number().int().min(0).max(3650).optional().describe("\u53EA\u5305\u542B\u81F3\u5C11\u8FD9\u4E48\u591A\u5929\u6CA1\u6709\u6E38\u73A9\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 30\u3002"),
|
|
13169
|
+
includeCurrentPlayers: z3.boolean().optional().describe("\u662F\u5426\u4E3A\u5019\u9009\u6E38\u620F\u9644\u5E26\u5F53\u524D\u5168\u7403\u5728\u7EBF\u4EBA\u6570\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13170
|
+
includeNews: z3.boolean().optional().describe("\u662F\u5426\u4E3A\u5019\u9009\u6E38\u620F\u9644\u5E26\u4E00\u6761\u6700\u8FD1\u65B0\u95FB\uFF0C\u9ED8\u8BA4 false\u3002"),
|
|
13171
|
+
preferCommunityVisibleStats: z3.boolean().optional().describe("\u662F\u5426\u8BA9\u5E26\u793E\u533A\u53EF\u89C1\u7EDF\u8BA1\u7684\u6E38\u620F\u83B7\u5F97\u66F4\u9AD8\u6392\u5E8F\u6743\u91CD\uFF0C\u9ED8\u8BA4 true\u3002")
|
|
13441
13172
|
},
|
|
13442
13173
|
annotations: {
|
|
13443
13174
|
readOnlyHint: true,
|
|
@@ -13477,19 +13208,19 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13477
13208
|
title: "\u6211\u7684\u6210\u5C31\u72E9\u730E",
|
|
13478
13209
|
description: "\u4ECE\u4F60\u7684\u6E38\u620F\u5E93\u91CC\u6311\u51FA\u6700\u63A5\u8FD1\u5168\u6210\u5C31\u5B8C\u6210\u7684\u5019\u9009\u6E38\u620F\u3002",
|
|
13479
13210
|
inputSchema: {
|
|
13480
|
-
key:
|
|
13481
|
-
language:
|
|
13482
|
-
source:
|
|
13483
|
-
appids:
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
|
|
13211
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13212
|
+
language: z3.string().optional().describe("\u53EF\u9009\u7684\u6210\u5C31 schema \u8BED\u8A00\u4EE3\u7801\u3002"),
|
|
13213
|
+
source: z3.enum(["recent", "topOwned", "mixed", "explicit"]).optional().describe("\u5982\u4F55\u9009\u62E9\u8981\u68C0\u67E5\u7684\u6E38\u620F\u6765\u6E90\uFF0C\u9ED8\u8BA4 'mixed'\u3002"),
|
|
13214
|
+
appids: z3.union([
|
|
13215
|
+
z3.string(),
|
|
13216
|
+
z3.number(),
|
|
13217
|
+
z3.array(z3.union([z3.string(), z3.number()]))
|
|
13487
13218
|
]).optional().describe("\u663E\u5F0F\u6307\u5B9A\u8981\u68C0\u67E5\u7684 AppID\uFF1B\u5F53 source \u4E3A 'explicit' \u65F6\u5FC5\u586B\u3002"),
|
|
13488
|
-
inspectCount:
|
|
13489
|
-
limit:
|
|
13490
|
-
minCompletionRate:
|
|
13491
|
-
maxRemainingAchievements:
|
|
13492
|
-
recentUnlockedCount:
|
|
13219
|
+
inspectCount: z3.number().int().min(1).max(30).optional().describe("\u5728\u7B5B\u9009\u524D\u6700\u591A\u68C0\u67E5\u591A\u5C11\u4E2A\u6E38\u620F\uFF0C\u9ED8\u8BA4 12\u3002"),
|
|
13220
|
+
limit: z3.number().int().min(1).max(20).optional().describe("\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u4E2A\u6210\u5C31\u72E9\u730E\u5019\u9009\uFF0C\u9ED8\u8BA4 8\u3002"),
|
|
13221
|
+
minCompletionRate: z3.number().min(0).max(100).optional().describe("\u53EA\u5305\u542B\u5B8C\u6210\u7387\u4E0D\u4F4E\u4E8E\u8BE5\u503C\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 50\u3002"),
|
|
13222
|
+
maxRemainingAchievements: z3.number().int().min(0).max(200).optional().describe("\u53EA\u5305\u542B\u5269\u4F59\u672A\u89E3\u9501\u6210\u5C31\u4E0D\u8D85\u8FC7\u8BE5\u6570\u91CF\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 20\u3002"),
|
|
13223
|
+
recentUnlockedCount: z3.number().int().min(1).max(20).optional().describe("\u6BCF\u4E2A\u6E38\u620F\u4FDD\u7559\u591A\u5C11\u6761\u6700\u8FD1\u89E3\u9501\u6210\u5C31\uFF0C\u9ED8\u8BA4 5\u3002")
|
|
13493
13224
|
},
|
|
13494
13225
|
annotations: {
|
|
13495
13226
|
readOnlyHint: true,
|
|
@@ -13533,15 +13264,15 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13533
13264
|
title: "\u6211\u7684\u6E38\u620F\u5FEB\u7167",
|
|
13534
13265
|
description: "\u9488\u5BF9\u5355\u4E2A AppID \u805A\u5408\u6211\u662F\u5426\u62E5\u6709\u3001\u6E38\u73A9\u65F6\u957F\u3001\u6210\u5C31\u3001\u7EDF\u8BA1\u3001\u65B0\u95FB\u548C\u5F53\u524D\u5728\u7EBF\u4EBA\u6570\u3002",
|
|
13535
13266
|
inputSchema: {
|
|
13536
|
-
appid:
|
|
13537
|
-
key:
|
|
13538
|
-
language:
|
|
13539
|
-
includeAchievements:
|
|
13540
|
-
includeStats:
|
|
13541
|
-
includeNews:
|
|
13542
|
-
includePlayerCount:
|
|
13543
|
-
newsCount:
|
|
13544
|
-
newsMaxLength:
|
|
13267
|
+
appid: z3.union([z3.string(), z3.number()]).describe("\u8981\u67E5\u770B\u7684 Steam AppID\u3002"),
|
|
13268
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13269
|
+
language: z3.string().optional().describe("\u53EF\u9009\u8BED\u8A00\u4EE3\u7801\uFF0C\u4F8B\u5982 'schinese' \u6216 'english'\u3002"),
|
|
13270
|
+
includeAchievements: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u4E2A\u4EBA\u6210\u5C31\u660E\u7EC6\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13271
|
+
includeStats: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u4E2A\u4EBA\u6E38\u620F\u7EDF\u8BA1\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13272
|
+
includeNews: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6700\u8FD1 Steam \u65B0\u95FB\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13273
|
+
includePlayerCount: z3.boolean().optional().describe("\u662F\u5426\u5305\u542B\u5F53\u524D\u5168\u7403\u5728\u7EBF\u4EBA\u6570\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13274
|
+
newsCount: z3.number().int().min(1).max(10).optional().describe("\u8FD4\u56DE\u591A\u5C11\u6761\u65B0\u95FB\uFF0C\u9ED8\u8BA4 3\u3002"),
|
|
13275
|
+
newsMaxLength: z3.number().int().min(0).max(1e3).optional().describe("\u6BCF\u6761\u65B0\u95FB\u5185\u5BB9\u7684\u6700\u5927\u957F\u5EA6\uFF0C\u9ED8\u8BA4 180\u3002")
|
|
13545
13276
|
},
|
|
13546
13277
|
annotations: {
|
|
13547
13278
|
readOnlyHint: true,
|
|
@@ -13585,7 +13316,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13585
13316
|
title: "\u6211\u7684 Steam \u7FA4\u7EC4",
|
|
13586
13317
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u7FA4\u7EC4\u5217\u8868\u3002\u6CE8\u610F\uFF1ASteam \u6587\u6863\u628A\u5E95\u5C42\u63A5\u53E3\u6807\u8BB0\u4E3A publisher-key-only\u3002",
|
|
13587
13318
|
inputSchema: {
|
|
13588
|
-
key:
|
|
13319
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002")
|
|
13589
13320
|
},
|
|
13590
13321
|
annotations: {
|
|
13591
13322
|
readOnlyHint: true,
|
|
@@ -13611,18 +13342,18 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13611
13342
|
title: "\u6211\u7684 Steam \u5173\u6CE8\u6D41",
|
|
13612
13343
|
description: "\u4EE5\u5173\u6CE8\u6D41\u7684\u5F62\u5F0F\u67E5\u770B\u4F60\u6700\u8FD1\u73A9\u8FC7\u6216\u5173\u5FC3\u7684\u5E94\u7528\uFF0C\u9ED8\u8BA4\u6309\u6700\u8FD1\u6E38\u73A9\u7684 AppID \u805A\u5408\u65B0\u95FB\u548C\u70ED\u5EA6\u3002",
|
|
13613
13344
|
inputSchema: {
|
|
13614
|
-
key:
|
|
13615
|
-
source:
|
|
13616
|
-
appids:
|
|
13617
|
-
|
|
13618
|
-
|
|
13619
|
-
|
|
13345
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13346
|
+
source: z3.enum(["recent", "topOwned", "mixed", "explicit"]).optional().describe("\u5982\u4F55\u4E3A\u5173\u6CE8\u6D41\u9009\u62E9\u5E94\u7528\u6765\u6E90\uFF0C\u9ED8\u8BA4 'recent'\u3002"),
|
|
13347
|
+
appids: z3.union([
|
|
13348
|
+
z3.string(),
|
|
13349
|
+
z3.number(),
|
|
13350
|
+
z3.array(z3.union([z3.string(), z3.number()]))
|
|
13620
13351
|
]).optional().describe("\u663E\u5F0F\u6307\u5B9A\u8981\u5173\u6CE8\u7684 appid\uFF1B\u5F53 source \u4E3A 'explicit' \u65F6\u5FC5\u586B\u3002"),
|
|
13621
|
-
limitApps:
|
|
13622
|
-
newsPerApp:
|
|
13623
|
-
newsMaxLength:
|
|
13624
|
-
includePlayerCount:
|
|
13625
|
-
includeOwnedContext:
|
|
13352
|
+
limitApps: z3.number().int().min(1).max(20).optional().describe("\u6700\u591A\u5305\u542B\u591A\u5C11\u4E2A\u5E94\u7528\uFF0C\u9ED8\u8BA4 5\u3002"),
|
|
13353
|
+
newsPerApp: z3.number().int().min(1).max(10).optional().describe("\u6BCF\u4E2A\u5E94\u7528\u6293\u53D6\u591A\u5C11\u6761\u65B0\u95FB\uFF0C\u9ED8\u8BA4 2\u3002"),
|
|
13354
|
+
newsMaxLength: z3.number().int().min(0).max(500).optional().describe("\u6BCF\u6761\u65B0\u95FB\u5185\u5BB9\u7684\u6700\u5927\u957F\u5EA6\uFF0C\u9ED8\u8BA4 160\u3002"),
|
|
13355
|
+
includePlayerCount: z3.boolean().optional().describe("\u662F\u5426\u4E3A\u6BCF\u4E2A\u5E94\u7528\u9644\u5E26\u5F53\u524D\u5728\u7EBF\u4EBA\u6570\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13356
|
+
includeOwnedContext: z3.boolean().optional().describe("\u662F\u5426\u9644\u5E26\u4F60\u662F\u5426\u62E5\u6709\u8BE5\u5E94\u7528\u4EE5\u53CA\u4F60\u7684\u6E38\u73A9\u65F6\u957F\uFF0C\u9ED8\u8BA4 true\u3002")
|
|
13626
13357
|
},
|
|
13627
13358
|
annotations: {
|
|
13628
13359
|
readOnlyHint: true,
|
|
@@ -13661,7 +13392,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13661
13392
|
}
|
|
13662
13393
|
|
|
13663
13394
|
// src/tools/overview.ts
|
|
13664
|
-
import * as
|
|
13395
|
+
import * as z4 from "zod/v4";
|
|
13665
13396
|
function registerOverviewTools(server, runtime2) {
|
|
13666
13397
|
server.registerTool(
|
|
13667
13398
|
"steam_get_player_profile_overview",
|
|
@@ -13669,11 +13400,11 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13669
13400
|
title: "Steam \u73A9\u5BB6\u8D44\u6599\u603B\u89C8",
|
|
13670
13401
|
description: "\u805A\u5408\u73A9\u5BB6\u7684 Steam \u8D44\u6599\u3001\u5C01\u7981\u72B6\u6001\u3001\u7B49\u7EA7\u3001\u5FBD\u7AE0\u548C\u6700\u8FD1\u6E38\u73A9\u4FE1\u606F\u3002",
|
|
13671
13402
|
inputSchema: {
|
|
13672
|
-
steamid:
|
|
13673
|
-
vanityUrl:
|
|
13674
|
-
key:
|
|
13675
|
-
includeRecentlyPlayed:
|
|
13676
|
-
recentGamesCount:
|
|
13403
|
+
steamid: z4.union([z4.string(), z4.number()]).optional().describe("\u73A9\u5BB6\u7684 SteamID64\u3002\u4E0E vanityUrl \u4E8C\u9009\u4E00\uFF1B\u82E5\u90FD\u4E0D\u4F20\u4E14\u5DF2\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u9ED8\u8BA4\u4F7F\u7528\u8BE5\u503C\u3002"),
|
|
13404
|
+
vanityUrl: z4.string().optional().describe("\u73A9\u5BB6\u7684 Steam \u81EA\u5B9A\u4E49\u4E3B\u9875\u6807\u8BC6\uFF0C\u4F8B\u5982 'gaben'\u3002\u4E0E steamid \u4E8C\u9009\u4E00\uFF1B\u82E5\u90FD\u4E0D\u4F20\u4E14\u5DF2\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u9ED8\u8BA4\u4F7F\u7528\u8BE5\u503C\u3002"),
|
|
13405
|
+
key: z4.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13406
|
+
includeRecentlyPlayed: z4.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6700\u8FD1\u6E38\u73A9\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13407
|
+
recentGamesCount: z4.number().int().min(1).max(20).optional().describe("\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 3\u3002")
|
|
13677
13408
|
},
|
|
13678
13409
|
annotations: {
|
|
13679
13410
|
readOnlyHint: true,
|
|
@@ -13711,14 +13442,14 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13711
13442
|
title: "Steam \u6E38\u620F\u5E93\u603B\u89C8",
|
|
13712
13443
|
description: "\u805A\u5408\u73A9\u5BB6\u62E5\u6709\u7684\u6E38\u620F\u3001\u6700\u8FD1\u6D3B\u52A8\u548C\u6309\u65F6\u957F\u6392\u5E8F\u7684\u5E38\u73A9\u6E38\u620F\u3002",
|
|
13713
13444
|
inputSchema: {
|
|
13714
|
-
steamid:
|
|
13715
|
-
vanityUrl:
|
|
13716
|
-
key:
|
|
13717
|
-
includeAppInfo:
|
|
13718
|
-
includePlayedFreeGames:
|
|
13719
|
-
includeRecentGames:
|
|
13720
|
-
recentGamesCount:
|
|
13721
|
-
topGamesCount:
|
|
13445
|
+
steamid: z4.union([z4.string(), z4.number()]).optional().describe("\u73A9\u5BB6\u7684 SteamID64\u3002\u4E0E vanityUrl \u4E8C\u9009\u4E00\uFF1B\u82E5\u90FD\u4E0D\u4F20\u4E14\u5DF2\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u9ED8\u8BA4\u4F7F\u7528\u8BE5\u503C\u3002"),
|
|
13446
|
+
vanityUrl: z4.string().optional().describe("\u73A9\u5BB6\u7684 Steam \u81EA\u5B9A\u4E49\u4E3B\u9875\u6807\u8BC6\uFF0C\u4F8B\u5982 'gaben'\u3002\u4E0E steamid \u4E8C\u9009\u4E00\uFF1B\u82E5\u90FD\u4E0D\u4F20\u4E14\u5DF2\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u9ED8\u8BA4\u4F7F\u7528\u8BE5\u503C\u3002"),
|
|
13447
|
+
key: z4.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13448
|
+
includeAppInfo: z4.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6E38\u620F\u540D\u79F0\u548C\u56FE\u6807\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13449
|
+
includePlayedFreeGames: z4.boolean().optional().describe("\u662F\u5426\u5305\u542B\u73A9\u8FC7\u7684\u514D\u8D39\u6E38\u620F\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13450
|
+
includeRecentGames: z4.boolean().optional().describe("\u662F\u5426\u5305\u542B\u6700\u8FD1\u6E38\u73A9\u7684\u6E38\u620F\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13451
|
+
recentGamesCount: z4.number().int().min(1).max(20).optional().describe("\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 5\u3002"),
|
|
13452
|
+
topGamesCount: z4.number().int().min(1).max(50).optional().describe("\u6309\u6E38\u73A9\u65F6\u957F\u6392\u5E8F\u8FD4\u56DE\u524D\u591A\u5C11\u4E2A\u6E38\u620F\uFF0C\u9ED8\u8BA4 10\u3002")
|
|
13722
13453
|
},
|
|
13723
13454
|
annotations: {
|
|
13724
13455
|
readOnlyHint: true,
|
|
@@ -13759,13 +13490,13 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13759
13490
|
title: "Steam \u6210\u5C31\u603B\u89C8",
|
|
13760
13491
|
description: "\u805A\u5408\u67D0\u4E2A\u6E38\u620F\u7684\u73A9\u5BB6\u6210\u5C31\u3001\u6E38\u620F schema\u3001\u5168\u5C40\u5B8C\u6210\u7387\u548C\u53EF\u9009\u7684\u4E2A\u4EBA\u7EDF\u8BA1\u3002",
|
|
13761
13492
|
inputSchema: {
|
|
13762
|
-
steamid:
|
|
13763
|
-
vanityUrl:
|
|
13764
|
-
appid:
|
|
13765
|
-
key:
|
|
13766
|
-
language:
|
|
13767
|
-
includeStats:
|
|
13768
|
-
recentUnlockedCount:
|
|
13493
|
+
steamid: z4.union([z4.string(), z4.number()]).optional().describe("\u73A9\u5BB6\u7684 SteamID64\u3002\u4E0E vanityUrl \u4E8C\u9009\u4E00\uFF1B\u82E5\u90FD\u4E0D\u4F20\u4E14\u5DF2\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u9ED8\u8BA4\u4F7F\u7528\u8BE5\u503C\u3002"),
|
|
13494
|
+
vanityUrl: z4.string().optional().describe("\u73A9\u5BB6\u7684 Steam \u81EA\u5B9A\u4E49\u4E3B\u9875\u6807\u8BC6\uFF0C\u4F8B\u5982 'gaben'\u3002\u4E0E steamid \u4E8C\u9009\u4E00\uFF1B\u82E5\u90FD\u4E0D\u4F20\u4E14\u5DF2\u914D\u7F6E STEAM_DEFAULT_STEAMID\uFF0C\u5219\u9ED8\u8BA4\u4F7F\u7528\u8BE5\u503C\u3002"),
|
|
13495
|
+
appid: z4.union([z4.string(), z4.number()]).describe("\u8981\u67E5\u770B\u7684 Steam AppID\u3002"),
|
|
13496
|
+
key: z4.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002"),
|
|
13497
|
+
language: z4.string().optional().describe("\u53EF\u9009\u8BED\u8A00\u4EE3\u7801\uFF0C\u4F8B\u5982 'schinese' \u6216 'english'\u3002"),
|
|
13498
|
+
includeStats: z4.boolean().optional().describe("\u662F\u5426\u5305\u542B\u8BE5\u6E38\u620F\u7684\u73A9\u5BB6\u7EDF\u8BA1\uFF0C\u9ED8\u8BA4 true\u3002"),
|
|
13499
|
+
recentUnlockedCount: z4.number().int().min(1).max(50).optional().describe("\u9AD8\u4EAE\u5C55\u793A\u6700\u8FD1\u89E3\u9501\u6210\u5C31\u7684\u6570\u91CF\uFF0C\u9ED8\u8BA4 10\u3002")
|
|
13769
13500
|
},
|
|
13770
13501
|
annotations: {
|
|
13771
13502
|
readOnlyHint: true,
|
|
@@ -13804,12 +13535,12 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13804
13535
|
title: "Steam \u65B0\u95FB\u603B\u89C8",
|
|
13805
13536
|
description: "\u805A\u5408\u67D0\u4E2A\u5E94\u7528\u7684 Steam \u65B0\u95FB\uFF0C\u5E76\u53EF\u9009\u9644\u5E26\u5F53\u524D\u5728\u7EBF\u4EBA\u6570\u3002",
|
|
13806
13537
|
inputSchema: {
|
|
13807
|
-
appid:
|
|
13808
|
-
count:
|
|
13809
|
-
maxlength:
|
|
13810
|
-
enddate:
|
|
13811
|
-
feeds:
|
|
13812
|
-
includePlayerCount:
|
|
13538
|
+
appid: z4.union([z4.string(), z4.number()]).describe("\u8981\u67E5\u770B\u7684 Steam AppID\u3002"),
|
|
13539
|
+
count: z4.number().int().min(1).max(20).optional().describe("\u8FD4\u56DE\u591A\u5C11\u6761\u65B0\u95FB\uFF0C\u9ED8\u8BA4 5\u3002"),
|
|
13540
|
+
maxlength: z4.number().int().min(0).max(5e3).optional().describe("\u6BCF\u6761\u65B0\u95FB\u5185\u5BB9\u7684\u6700\u5927\u957F\u5EA6\uFF0C\u9ED8\u8BA4 300\u3002"),
|
|
13541
|
+
enddate: z4.number().int().optional().describe("\u53EF\u9009\u7684 Unix \u65F6\u95F4\u6233\u4E0A\u9650\uFF0C\u53EA\u8FD4\u56DE\u66F4\u65E9\u7684\u65B0\u95FB\u3002"),
|
|
13542
|
+
feeds: z4.union([z4.string(), z4.array(z4.string())]).optional().describe("\u53EF\u9009\u7684 feed \u540D\u79F0\u6216 feed \u5217\u8868\u3002"),
|
|
13543
|
+
includePlayerCount: z4.boolean().optional().describe("\u662F\u5426\u5305\u542B\u5F53\u524D\u5728\u7EBF\u4EBA\u6570\uFF0C\u9ED8\u8BA4 true\u3002")
|
|
13813
13544
|
},
|
|
13814
13545
|
annotations: {
|
|
13815
13546
|
readOnlyHint: true,
|
|
@@ -13844,8 +13575,6 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13844
13575
|
|
|
13845
13576
|
// src/server.ts
|
|
13846
13577
|
var spec = applyGeneratedToolTitles(steam_web_api_spec_default);
|
|
13847
|
-
var generatedToolsEnabled = toBoolean(process.env.STEAM_ENABLE_GENERATED_TOOLS) ?? false;
|
|
13848
|
-
var helperToolCount = 4;
|
|
13849
13578
|
var runtime = createSteamBaseRuntime(spec, {
|
|
13850
13579
|
apiKey: process.env.STEAM_WEB_API_KEY,
|
|
13851
13580
|
defaultSteamId: normalizeScalarInput(process.env.STEAM_DEFAULT_STEAMID),
|
|
@@ -13855,34 +13584,22 @@ var runtime = createSteamBaseRuntime(spec, {
|
|
|
13855
13584
|
),
|
|
13856
13585
|
timeoutMs: Number.parseInt(process.env.STEAM_REQUEST_TIMEOUT_MS ?? "30000", 10)
|
|
13857
13586
|
});
|
|
13858
|
-
function createAdvancedToolsStatus() {
|
|
13859
|
-
if (!generatedToolsEnabled) {
|
|
13860
|
-
return "advanced tools: disabled";
|
|
13861
|
-
}
|
|
13862
|
-
return `advanced tools: enabled (${helperToolCount} helper + ${runtime.spec.methodCount} generated)`;
|
|
13863
|
-
}
|
|
13864
13587
|
function createServer() {
|
|
13865
13588
|
const server = new McpServer({
|
|
13866
13589
|
name: "steam-tools-mcp",
|
|
13867
|
-
version: "0.1.
|
|
13590
|
+
version: "0.1.2",
|
|
13868
13591
|
websiteUrl: "https://partner.steamgames.com/doc/webapi"
|
|
13869
13592
|
});
|
|
13870
13593
|
registerOverviewTools(server, runtime);
|
|
13871
13594
|
registerAppTools(server, runtime);
|
|
13872
13595
|
registerMyAccountTools(server, runtime);
|
|
13873
|
-
if (generatedToolsEnabled) {
|
|
13874
|
-
registerHelperTools(server, runtime);
|
|
13875
|
-
registerGeneratedTools(server, runtime);
|
|
13876
|
-
}
|
|
13877
13596
|
return server;
|
|
13878
13597
|
}
|
|
13879
13598
|
async function startStdioServer() {
|
|
13880
13599
|
const server = createServer();
|
|
13881
13600
|
const transport = new StdioServerTransport();
|
|
13882
13601
|
await server.connect(transport);
|
|
13883
|
-
console.error(
|
|
13884
|
-
`steam-tools-mcp running over stdio. ${createAdvancedToolsStatus()}.`
|
|
13885
|
-
);
|
|
13602
|
+
console.error("steam-tools-mcp running over stdio.");
|
|
13886
13603
|
}
|
|
13887
13604
|
async function handleHttpRequest(req, res) {
|
|
13888
13605
|
const server = createServer();
|
|
@@ -13920,9 +13637,7 @@ async function startHttpServer() {
|
|
|
13920
13637
|
ok: true,
|
|
13921
13638
|
generatedAt: runtime.spec.generatedAt,
|
|
13922
13639
|
methodCount: runtime.spec.methodCount,
|
|
13923
|
-
interfaceCount: runtime.spec.interfaceCount
|
|
13924
|
-
generatedToolsEnabled,
|
|
13925
|
-
enabledGeneratedToolCount: generatedToolsEnabled ? runtime.spec.methodCount : 0
|
|
13640
|
+
interfaceCount: runtime.spec.interfaceCount
|
|
13926
13641
|
});
|
|
13927
13642
|
});
|
|
13928
13643
|
app.post("/mcp", async (req, res) => {
|
|
@@ -13954,9 +13669,7 @@ async function startHttpServer() {
|
|
|
13954
13669
|
reject(error);
|
|
13955
13670
|
return;
|
|
13956
13671
|
}
|
|
13957
|
-
console.log(
|
|
13958
|
-
`steam-tools-mcp listening on http://${host}:${port}/mcp. ${createAdvancedToolsStatus()}.`
|
|
13959
|
-
);
|
|
13672
|
+
console.log(`steam-tools-mcp listening on http://${host}:${port}/mcp.`);
|
|
13960
13673
|
resolve();
|
|
13961
13674
|
});
|
|
13962
13675
|
server.on("error", reject);
|
package/docs/configuration.md
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
这份文档列出 `@xiawan-play/steam-tools-mcp` 当前支持的全部环境变量,并说明默认值、用途和推荐使用场景。
|
|
4
4
|
|
|
5
|
-
README 里的 MCP 配置示例只保留最常用的
|
|
5
|
+
README 里的 MCP 配置示例只保留最常用的 2 项:
|
|
6
6
|
|
|
7
7
|
- `STEAM_WEB_API_KEY`
|
|
8
8
|
- `STEAM_DEFAULT_STEAMID`
|
|
9
|
-
- `STEAM_ENABLE_GENERATED_TOOLS`
|
|
10
9
|
|
|
11
10
|
如果你需要更细的控制,再参考本文即可。
|
|
12
11
|
|
|
@@ -16,7 +15,6 @@ README 里的 MCP 配置示例只保留最常用的 3 项:
|
|
|
16
15
|
| --- | --- | --- | --- |
|
|
17
16
|
| `STEAM_WEB_API_KEY` | 无 | 默认使用的 Steam Web API Key。很多资料、游戏库、成就、应用目录相关接口都依赖它。 | 只要你要查“我的资料 / 我的库 / 我的成就”这类信息,就建议配置。 |
|
|
18
17
|
| `STEAM_DEFAULT_STEAMID` | 无 | 默认查询账号的 SteamID64。`steam_me_*` 工具和部分带 `steamid` / `steamids` 的工具会自动使用它。 | 你长期绑定自己的账号使用时,强烈建议配置。 |
|
|
19
|
-
| `STEAM_ENABLE_GENERATED_TOOLS` | `false` | 是否开启辅助探索工具和完整的自动生成 Steam Web API 方法工具集。 | 你想把辅助调试工具和底层 Steam 方法工具一起暴露给 MCP 时再开启。 |
|
|
20
18
|
|
|
21
19
|
## 高级可选参数
|
|
22
20
|
|
|
@@ -57,22 +55,7 @@ README 里的 MCP 配置示例只保留最常用的 3 项:
|
|
|
57
55
|
{
|
|
58
56
|
"env": {
|
|
59
57
|
"STEAM_WEB_API_KEY": "YOUR_WEB_API_KEY",
|
|
60
|
-
"STEAM_DEFAULT_STEAMID": "YOUR_STEAM_ID64"
|
|
61
|
-
"STEAM_ENABLE_GENERATED_TOOLS": "false"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### 3. 全量模式
|
|
67
|
-
|
|
68
|
-
适合高级用户、调试或需要完整 Steam Web API 方法集时使用。
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"env": {
|
|
73
|
-
"STEAM_WEB_API_KEY": "YOUR_WEB_API_KEY",
|
|
74
|
-
"STEAM_DEFAULT_STEAMID": "YOUR_STEAM_ID64",
|
|
75
|
-
"STEAM_ENABLE_GENERATED_TOOLS": "true"
|
|
58
|
+
"STEAM_DEFAULT_STEAMID": "YOUR_STEAM_ID64"
|
|
76
59
|
}
|
|
77
60
|
}
|
|
78
61
|
```
|
|
@@ -80,8 +63,6 @@ README 里的 MCP 配置示例只保留最常用的 3 项:
|
|
|
80
63
|
## 使用建议
|
|
81
64
|
|
|
82
65
|
- 如果你主要是自己用,推荐至少配置 `STEAM_WEB_API_KEY` 和 `STEAM_DEFAULT_STEAMID`。
|
|
83
|
-
- 如果你只是想要“好用的 MCP 工具”,保持 `STEAM_ENABLE_GENERATED_TOOLS=false` 即可;此时默认只暴露高频工具和 `steam_me_*` 快捷工具。
|
|
84
|
-
- 如果你需要方法目录检索、原始调试调用,或者想展开全量官方方法,再开启 `STEAM_ENABLE_GENERATED_TOOLS=true`。
|
|
85
66
|
- 如果你的 MCP 客户端会直接拉起本地进程,通常不需要配置 `MCP_TRANSPORT`、`HOST`、`PORT`。
|
|
86
67
|
- 如果你不需要调优缓存和网络行为,可以完全不配置 `STEAM_APP_LIST_CACHE_TTL_MS` 和 `STEAM_REQUEST_TIMEOUT_MS`。
|
|
87
68
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiawan-play/steam-tools-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "A Steam MCP server with Chinese-friendly high-level tools
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "A Steam MCP server with Chinese-friendly high-level tools for profile, library, achievements, news, and app discovery.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./dist/server.js",
|