@xiawan-play/steam-tools-mcp 0.1.0 → 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 +141 -427
- 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,125 +9948,22 @@ 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);
|
|
10067
9964
|
const url = new URL(endpoint);
|
|
10068
9965
|
const requestValues = buildRequestValueMap(method, args, options?.apiKey);
|
|
10069
|
-
if (method.
|
|
9966
|
+
if (!method.requiresPublisherKey && url.hostname === "partner.steam-api.com") {
|
|
10070
9967
|
url.hostname = "api.steampowered.com";
|
|
10071
9968
|
}
|
|
10072
9969
|
const requestInit = {
|
|
@@ -10076,7 +9973,8 @@ async function callSteamApi(method, args, options) {
|
|
|
10076
9973
|
},
|
|
10077
9974
|
signal: AbortSignal.timeout(timeoutMs)
|
|
10078
9975
|
};
|
|
10079
|
-
|
|
9976
|
+
const useInputJson = method.serviceInterface && url.hostname === "partner.steam-api.com";
|
|
9977
|
+
if (useInputJson) {
|
|
10080
9978
|
const inputJson = JSON.stringify(requestValues);
|
|
10081
9979
|
if (method.httpMethod === "GET") {
|
|
10082
9980
|
url.searchParams.set("input_json", inputJson);
|
|
@@ -10302,18 +10200,18 @@ function parseAppCatalogPage(data) {
|
|
|
10302
10200
|
];
|
|
10303
10201
|
const entries = [];
|
|
10304
10202
|
for (const entry of rawEntries) {
|
|
10305
|
-
const
|
|
10306
|
-
const appid = normalizeScalarInput(
|
|
10307
|
-
const name = getStringValue(
|
|
10203
|
+
const record2 = asRecord(entry);
|
|
10204
|
+
const appid = normalizeScalarInput(record2?.appid);
|
|
10205
|
+
const name = getStringValue(record2?.name);
|
|
10308
10206
|
if (!appid || !name) {
|
|
10309
10207
|
continue;
|
|
10310
10208
|
}
|
|
10311
10209
|
entries.push({
|
|
10312
10210
|
appid,
|
|
10313
10211
|
name,
|
|
10314
|
-
type: normalizeAppCatalogType(
|
|
10315
|
-
lastModified: toNumber(
|
|
10316
|
-
priceChangeNumber: toNumber(
|
|
10212
|
+
type: normalizeAppCatalogType(record2),
|
|
10213
|
+
lastModified: toNumber(record2?.last_modified),
|
|
10214
|
+
priceChangeNumber: toNumber(record2?.price_change_number)
|
|
10317
10215
|
});
|
|
10318
10216
|
}
|
|
10319
10217
|
const lastAppId = normalizeScalarInput(getNestedValue(data, "response", "last_appid")) ?? entries.at(-1)?.appid;
|
|
@@ -10829,10 +10727,10 @@ function createSteamBaseRuntime(spec2, config) {
|
|
|
10829
10727
|
apiKey
|
|
10830
10728
|
);
|
|
10831
10729
|
for (const player of getNestedArray(result.data, "response", "players")) {
|
|
10832
|
-
const
|
|
10730
|
+
const record2 = normalizePlayerSummary({ response: { players: [player] } });
|
|
10833
10731
|
const steamid = getStringValue(asRecord(player)?.steamid);
|
|
10834
|
-
if (steamid &&
|
|
10835
|
-
summaryMap.set(steamid,
|
|
10732
|
+
if (steamid && record2) {
|
|
10733
|
+
summaryMap.set(steamid, record2);
|
|
10836
10734
|
}
|
|
10837
10735
|
}
|
|
10838
10736
|
}
|
|
@@ -10848,10 +10746,10 @@ function createSteamBaseRuntime(spec2, config) {
|
|
|
10848
10746
|
apiKey
|
|
10849
10747
|
);
|
|
10850
10748
|
for (const player of getNestedArray(result.data, "players")) {
|
|
10851
|
-
const
|
|
10749
|
+
const record2 = normalizePlayerBan({ players: [player] });
|
|
10852
10750
|
const steamid = getStringValue(asRecord(player)?.SteamId);
|
|
10853
|
-
if (steamid &&
|
|
10854
|
-
banMap.set(steamid,
|
|
10751
|
+
if (steamid && record2) {
|
|
10752
|
+
banMap.set(steamid, record2);
|
|
10855
10753
|
}
|
|
10856
10754
|
}
|
|
10857
10755
|
}
|
|
@@ -11988,174 +11886,8 @@ function registerAppTools(server, runtime2) {
|
|
|
11988
11886
|
);
|
|
11989
11887
|
}
|
|
11990
11888
|
|
|
11991
|
-
// src/tools/generated.ts
|
|
11992
|
-
function registerGeneratedTools(server, runtime2) {
|
|
11993
|
-
for (const method of runtime2.spec.methods) {
|
|
11994
|
-
const inputSchema = buildInputSchema(method, {
|
|
11995
|
-
defaultSteamId: runtime2.config.defaultSteamId
|
|
11996
|
-
});
|
|
11997
|
-
const annotations = {
|
|
11998
|
-
readOnlyHint: method.httpMethod === "GET",
|
|
11999
|
-
openWorldHint: true
|
|
12000
|
-
};
|
|
12001
|
-
server.registerTool(
|
|
12002
|
-
method.toolName,
|
|
12003
|
-
{
|
|
12004
|
-
title: createGeneratedToolTitle(method),
|
|
12005
|
-
description: createToolDescription(method),
|
|
12006
|
-
...inputSchema ? { inputSchema } : {},
|
|
12007
|
-
annotations
|
|
12008
|
-
},
|
|
12009
|
-
async (args) => runtime2.executeSteamMethod(method, args ?? {})
|
|
12010
|
-
);
|
|
12011
|
-
}
|
|
12012
|
-
}
|
|
12013
|
-
|
|
12014
|
-
// src/tools/helpers.ts
|
|
12015
|
-
import * as z3 from "zod/v4";
|
|
12016
|
-
function registerHelperTools(server, runtime2) {
|
|
12017
|
-
server.registerTool(
|
|
12018
|
-
"steam_list_interfaces",
|
|
12019
|
-
{
|
|
12020
|
-
title: "Steam \u63A5\u53E3\u5217\u8868",
|
|
12021
|
-
description: "\u5217\u51FA\u5F53\u524D\u5DF2\u540C\u6B65\u7684 Steam Web API \u63A5\u53E3\u3002",
|
|
12022
|
-
inputSchema: {
|
|
12023
|
-
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"),
|
|
12024
|
-
serviceOnly: z3.boolean().optional().describe("\u662F\u5426\u53EA\u8FD4\u56DE Steam Service Interface\u3002")
|
|
12025
|
-
},
|
|
12026
|
-
annotations: {
|
|
12027
|
-
readOnlyHint: true,
|
|
12028
|
-
openWorldHint: false
|
|
12029
|
-
}
|
|
12030
|
-
},
|
|
12031
|
-
async ({ search, serviceOnly }) => {
|
|
12032
|
-
const query = search?.toLowerCase();
|
|
12033
|
-
const interfaces = runtime2.spec.interfaces.filter((entry) => {
|
|
12034
|
-
if (serviceOnly && !entry.serviceInterface) {
|
|
12035
|
-
return false;
|
|
12036
|
-
}
|
|
12037
|
-
if (!query) {
|
|
12038
|
-
return true;
|
|
12039
|
-
}
|
|
12040
|
-
return entry.name.toLowerCase().includes(query) || entry.description.toLowerCase().includes(query);
|
|
12041
|
-
});
|
|
12042
|
-
const content = {
|
|
12043
|
-
generatedAt: runtime2.spec.generatedAt,
|
|
12044
|
-
interfaceCount: interfaces.length,
|
|
12045
|
-
interfaces: interfaces.map((entry) => ({
|
|
12046
|
-
name: entry.name,
|
|
12047
|
-
description: entry.description,
|
|
12048
|
-
serviceInterface: entry.serviceInterface,
|
|
12049
|
-
sourceUrl: entry.sourceUrl,
|
|
12050
|
-
methodCount: runtime2.spec.methods.filter(
|
|
12051
|
-
(method) => method.interfaceName === entry.name
|
|
12052
|
-
).length
|
|
12053
|
-
}))
|
|
12054
|
-
};
|
|
12055
|
-
return runtime2.createJsonToolResult(content);
|
|
12056
|
-
}
|
|
12057
|
-
);
|
|
12058
|
-
server.registerTool(
|
|
12059
|
-
"steam_list_methods",
|
|
12060
|
-
{
|
|
12061
|
-
title: "Steam \u65B9\u6CD5\u641C\u7D22",
|
|
12062
|
-
description: "\u641C\u7D22\u5F53\u524D\u5DF2\u540C\u6B65\u7684 Steam Web API \u65B9\u6CD5\u76EE\u5F55\u3002",
|
|
12063
|
-
inputSchema: {
|
|
12064
|
-
interfaceName: z3.string().optional().describe("\u53EF\u9009\u63A5\u53E3\u540D\u8FC7\u6EE4\uFF0C\u4F8B\u5982 ISteamUserStats\u3002"),
|
|
12065
|
-
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"),
|
|
12066
|
-
auth: z3.enum(["any", "anonymous", "userKey", "publisherKey"]).optional().describe("\u6309\u9274\u6743\u8981\u6C42\u8FC7\u6EE4\u3002"),
|
|
12067
|
-
limit: z3.number().int().min(1).max(500).optional().describe("\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u4E2A\u65B9\u6CD5\uFF0C\u9ED8\u8BA4 50\u3002")
|
|
12068
|
-
},
|
|
12069
|
-
annotations: {
|
|
12070
|
-
readOnlyHint: true,
|
|
12071
|
-
openWorldHint: false
|
|
12072
|
-
}
|
|
12073
|
-
},
|
|
12074
|
-
async ({ interfaceName, search, auth = "any", limit = 50 }) => {
|
|
12075
|
-
const query = search?.toLowerCase();
|
|
12076
|
-
const methods = runtime2.spec.methods.filter((method) => {
|
|
12077
|
-
if (interfaceName && method.interfaceName !== interfaceName) {
|
|
12078
|
-
return false;
|
|
12079
|
-
}
|
|
12080
|
-
if (auth === "anonymous" && !method.supportsAnonymous) {
|
|
12081
|
-
return false;
|
|
12082
|
-
}
|
|
12083
|
-
if (auth === "userKey" && !method.requiresUserKey) {
|
|
12084
|
-
return false;
|
|
12085
|
-
}
|
|
12086
|
-
if (auth === "publisherKey" && !method.requiresPublisherKey) {
|
|
12087
|
-
return false;
|
|
12088
|
-
}
|
|
12089
|
-
if (!query) {
|
|
12090
|
-
return true;
|
|
12091
|
-
}
|
|
12092
|
-
return method.methodName.toLowerCase().includes(query) || method.interfaceName.toLowerCase().includes(query) || method.description.toLowerCase().includes(query);
|
|
12093
|
-
});
|
|
12094
|
-
const content = {
|
|
12095
|
-
generatedAt: runtime2.spec.generatedAt,
|
|
12096
|
-
totalMatches: methods.length,
|
|
12097
|
-
returned: Math.min(methods.length, limit),
|
|
12098
|
-
methods: methods.slice(0, limit).map((method) => ({
|
|
12099
|
-
interfaceName: method.interfaceName,
|
|
12100
|
-
methodName: method.methodName,
|
|
12101
|
-
toolName: method.toolName,
|
|
12102
|
-
httpMethod: method.httpMethod,
|
|
12103
|
-
serviceInterface: method.serviceInterface,
|
|
12104
|
-
requiresUserKey: method.requiresUserKey,
|
|
12105
|
-
requiresPublisherKey: method.requiresPublisherKey,
|
|
12106
|
-
supportsAnonymous: method.supportsAnonymous,
|
|
12107
|
-
sourceUrl: method.sourceUrl
|
|
12108
|
-
}))
|
|
12109
|
-
};
|
|
12110
|
-
return runtime2.createJsonToolResult(content);
|
|
12111
|
-
}
|
|
12112
|
-
);
|
|
12113
|
-
server.registerTool(
|
|
12114
|
-
"steam_get_method_details",
|
|
12115
|
-
{
|
|
12116
|
-
title: "Steam \u65B9\u6CD5\u8BE6\u60C5",
|
|
12117
|
-
description: "\u67E5\u770B\u67D0\u4E2A\u5DF2\u540C\u6B65 Steam Web API \u65B9\u6CD5\u7684\u5B8C\u6574\u5143\u4FE1\u606F\u3002",
|
|
12118
|
-
inputSchema: {
|
|
12119
|
-
toolName: z3.string().optional().describe("\u751F\u6210\u540E\u7684 MCP tool \u540D\uFF0C\u4F8B\u5982 steam_i_player_service_get_owned_games\u3002"),
|
|
12120
|
-
interfaceName: z3.string().optional().describe("\u4E0D\u4F7F\u7528 toolName \u65F6\u53EF\u4F20\u63A5\u53E3\u540D\u3002"),
|
|
12121
|
-
methodName: z3.string().optional().describe("\u4E0D\u4F7F\u7528 toolName \u65F6\u53EF\u4F20\u65B9\u6CD5\u540D\u3002")
|
|
12122
|
-
},
|
|
12123
|
-
annotations: {
|
|
12124
|
-
readOnlyHint: true,
|
|
12125
|
-
openWorldHint: false
|
|
12126
|
-
}
|
|
12127
|
-
},
|
|
12128
|
-
async ({ toolName, interfaceName, methodName }) => {
|
|
12129
|
-
const method = runtime2.resolveMethod({ toolName, interfaceName, methodName });
|
|
12130
|
-
return runtime2.createJsonToolResult(method);
|
|
12131
|
-
}
|
|
12132
|
-
);
|
|
12133
|
-
server.registerTool(
|
|
12134
|
-
"steam_call_raw",
|
|
12135
|
-
{
|
|
12136
|
-
title: "Steam \u539F\u59CB\u8C03\u7528",
|
|
12137
|
-
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",
|
|
12138
|
-
inputSchema: {
|
|
12139
|
-
interfaceName: z3.string().describe("Steam Web API \u63A5\u53E3\u540D\uFF0C\u4F8B\u5982 ISteamUserStats\u3002"),
|
|
12140
|
-
methodName: z3.string().describe("Steam Web API \u65B9\u6CD5\u540D\uFF0C\u4F8B\u5982 GetNumberOfCurrentPlayers\u3002"),
|
|
12141
|
-
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"),
|
|
12142
|
-
key: z3.string().optional().describe("\u53EF\u9009 API key \u8986\u76D6\u503C\uFF1B\u4E0D\u4F20\u65F6\u56DE\u9000\u5230 STEAM_WEB_API_KEY\u3002")
|
|
12143
|
-
},
|
|
12144
|
-
annotations: {
|
|
12145
|
-
readOnlyHint: false,
|
|
12146
|
-
openWorldHint: true
|
|
12147
|
-
}
|
|
12148
|
-
},
|
|
12149
|
-
async ({ interfaceName, methodName, params = {}, key }) => {
|
|
12150
|
-
const method = runtime2.resolveMethod({ interfaceName, methodName });
|
|
12151
|
-
const mappedArgs = runtime2.mapRawParams(method, params);
|
|
12152
|
-
return runtime2.executeSteamMethod(method, { ...mappedArgs, key });
|
|
12153
|
-
}
|
|
12154
|
-
);
|
|
12155
|
-
}
|
|
12156
|
-
|
|
12157
11889
|
// src/tools/me.ts
|
|
12158
|
-
import * as
|
|
11890
|
+
import * as z3 from "zod/v4";
|
|
12159
11891
|
|
|
12160
11892
|
// src/services/account.ts
|
|
12161
11893
|
async function buildRecentlyPlayedData(runtime2, input) {
|
|
@@ -12898,15 +12630,15 @@ async function buildAchievementHuntData(runtime2, input) {
|
|
|
12898
12630
|
warnings: [
|
|
12899
12631
|
...runtime2.collectWarnings([playerSummaryCall, ownedGamesCall]),
|
|
12900
12632
|
...inspectedGames.flatMap((entry) => {
|
|
12901
|
-
const
|
|
12902
|
-
if (!
|
|
12633
|
+
const record2 = asRecord(entry);
|
|
12634
|
+
if (!record2) {
|
|
12903
12635
|
return [];
|
|
12904
12636
|
}
|
|
12905
|
-
if (Array.isArray(
|
|
12906
|
-
return
|
|
12637
|
+
if (Array.isArray(record2.warnings)) {
|
|
12638
|
+
return record2.warnings;
|
|
12907
12639
|
}
|
|
12908
|
-
if (typeof
|
|
12909
|
-
return [`appid ${
|
|
12640
|
+
if (typeof record2.error === "string") {
|
|
12641
|
+
return [`appid ${record2.appid ?? "unknown"}: ${record2.error}`];
|
|
12910
12642
|
}
|
|
12911
12643
|
return [];
|
|
12912
12644
|
})
|
|
@@ -12951,9 +12683,9 @@ async function buildLibraryCompareData(runtime2, input) {
|
|
|
12951
12683
|
const summaryMap = /* @__PURE__ */ new Map();
|
|
12952
12684
|
for (const player of getNestedArray(summaryCall.data, "response", "players")) {
|
|
12953
12685
|
const steamid = getStringValue(asRecord(player)?.steamid);
|
|
12954
|
-
const
|
|
12955
|
-
if (steamid &&
|
|
12956
|
-
summaryMap.set(steamid,
|
|
12686
|
+
const record2 = normalizePlayerSummary({ response: { players: [player] } });
|
|
12687
|
+
if (steamid && record2) {
|
|
12688
|
+
summaryMap.set(steamid, record2);
|
|
12957
12689
|
}
|
|
12958
12690
|
}
|
|
12959
12691
|
const myOwnedGames = normalizeOwnedGames(myOwnedGamesCall.data).games;
|
|
@@ -13079,9 +12811,9 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13079
12811
|
title: "\u6211\u7684 Steam \u8D44\u6599",
|
|
13080
12812
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684 Steam \u8D44\u6599\u603B\u89C8\u3002",
|
|
13081
12813
|
inputSchema: {
|
|
13082
|
-
key:
|
|
13083
|
-
includeRecentlyPlayed:
|
|
13084
|
-
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")
|
|
13085
12817
|
},
|
|
13086
12818
|
annotations: {
|
|
13087
12819
|
readOnlyHint: true,
|
|
@@ -13109,12 +12841,12 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13109
12841
|
title: "\u6211\u7684 Steam \u6E38\u620F\u5E93",
|
|
13110
12842
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u6E38\u620F\u5E93\u603B\u89C8\u3002",
|
|
13111
12843
|
inputSchema: {
|
|
13112
|
-
key:
|
|
13113
|
-
includeAppInfo:
|
|
13114
|
-
includePlayedFreeGames:
|
|
13115
|
-
includeRecentGames:
|
|
13116
|
-
recentGamesCount:
|
|
13117
|
-
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")
|
|
13118
12850
|
},
|
|
13119
12851
|
annotations: {
|
|
13120
12852
|
readOnlyHint: true,
|
|
@@ -13152,8 +12884,8 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13152
12884
|
title: "\u6211\u7684\u6700\u8FD1\u6E38\u73A9",
|
|
13153
12885
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u6700\u8FD1\u6E38\u73A9\u6E38\u620F\u3002",
|
|
13154
12886
|
inputSchema: {
|
|
13155
|
-
key:
|
|
13156
|
-
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")
|
|
13157
12889
|
},
|
|
13158
12890
|
annotations: {
|
|
13159
12891
|
readOnlyHint: true,
|
|
@@ -13180,7 +12912,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13180
12912
|
title: "\u6211\u7684 Steam \u5FBD\u7AE0",
|
|
13181
12913
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u7B49\u7EA7\u548C\u5FBD\u7AE0\u4FE1\u606F\u3002",
|
|
13182
12914
|
inputSchema: {
|
|
13183
|
-
key:
|
|
12915
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002")
|
|
13184
12916
|
},
|
|
13185
12917
|
annotations: {
|
|
13186
12918
|
readOnlyHint: true,
|
|
@@ -13206,11 +12938,11 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13206
12938
|
title: "\u6211\u7684 Steam \u6210\u5C31\u603B\u89C8",
|
|
13207
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",
|
|
13208
12940
|
inputSchema: {
|
|
13209
|
-
appid:
|
|
13210
|
-
key:
|
|
13211
|
-
language:
|
|
13212
|
-
includeStats:
|
|
13213
|
-
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")
|
|
13214
12946
|
},
|
|
13215
12947
|
annotations: {
|
|
13216
12948
|
readOnlyHint: true,
|
|
@@ -13246,11 +12978,11 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13246
12978
|
title: "\u6211\u7684 Steam \u597D\u53CB",
|
|
13247
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",
|
|
13248
12980
|
inputSchema: {
|
|
13249
|
-
key:
|
|
13250
|
-
relationship:
|
|
13251
|
-
includeSummaries:
|
|
13252
|
-
includeBans:
|
|
13253
|
-
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")
|
|
13254
12986
|
},
|
|
13255
12987
|
annotations: {
|
|
13256
12988
|
readOnlyHint: true,
|
|
@@ -13286,10 +13018,10 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13286
13018
|
title: "\u6211\u7684\u597D\u53CB\u52A8\u6001",
|
|
13287
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",
|
|
13288
13020
|
inputSchema: {
|
|
13289
|
-
key:
|
|
13290
|
-
limit:
|
|
13291
|
-
onlyInGame:
|
|
13292
|
-
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")
|
|
13293
13025
|
},
|
|
13294
13026
|
annotations: {
|
|
13295
13027
|
readOnlyHint: true,
|
|
@@ -13318,12 +13050,12 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13318
13050
|
title: "\u6211\u7684\u597D\u53CB\u7F51\u7EDC",
|
|
13319
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",
|
|
13320
13052
|
inputSchema: {
|
|
13321
|
-
key:
|
|
13322
|
-
limit:
|
|
13323
|
-
activityWindowHours:
|
|
13324
|
-
includeBans:
|
|
13325
|
-
includeGraph:
|
|
13326
|
-
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")
|
|
13327
13059
|
},
|
|
13328
13060
|
annotations: {
|
|
13329
13061
|
readOnlyHint: true,
|
|
@@ -13361,7 +13093,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13361
13093
|
title: "\u6211\u7684\u5C01\u7981\u72B6\u6001",
|
|
13362
13094
|
description: "\u5FEB\u6377\u67E5\u770B\u5DF2\u914D\u7F6E\u9ED8\u8BA4\u8D26\u53F7\u7684\u5C01\u7981\u6458\u8981\u3002",
|
|
13363
13095
|
inputSchema: {
|
|
13364
|
-
key:
|
|
13096
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002")
|
|
13365
13097
|
},
|
|
13366
13098
|
annotations: {
|
|
13367
13099
|
readOnlyHint: true,
|
|
@@ -13387,12 +13119,12 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13387
13119
|
title: "\u6211\u7684\u6E38\u620F\u5E93\u5BF9\u6BD4",
|
|
13388
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",
|
|
13389
13121
|
inputSchema: {
|
|
13390
|
-
steamid:
|
|
13391
|
-
vanityUrl:
|
|
13392
|
-
key:
|
|
13393
|
-
includeOnlyMineSample:
|
|
13394
|
-
includeOnlyOtherSample:
|
|
13395
|
-
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")
|
|
13396
13128
|
},
|
|
13397
13129
|
annotations: {
|
|
13398
13130
|
readOnlyHint: true,
|
|
@@ -13430,13 +13162,13 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13430
13162
|
title: "\u6211\u7684\u79EF\u538B\u6E38\u620F\u5019\u9009",
|
|
13431
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",
|
|
13432
13164
|
inputSchema: {
|
|
13433
|
-
key:
|
|
13434
|
-
limit:
|
|
13435
|
-
maxPlaytimeHours:
|
|
13436
|
-
minDaysSinceLastPlayed:
|
|
13437
|
-
includeCurrentPlayers:
|
|
13438
|
-
includeNews:
|
|
13439
|
-
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")
|
|
13440
13172
|
},
|
|
13441
13173
|
annotations: {
|
|
13442
13174
|
readOnlyHint: true,
|
|
@@ -13476,19 +13208,19 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13476
13208
|
title: "\u6211\u7684\u6210\u5C31\u72E9\u730E",
|
|
13477
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",
|
|
13478
13210
|
inputSchema: {
|
|
13479
|
-
key:
|
|
13480
|
-
language:
|
|
13481
|
-
source:
|
|
13482
|
-
appids:
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
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()]))
|
|
13486
13218
|
]).optional().describe("\u663E\u5F0F\u6307\u5B9A\u8981\u68C0\u67E5\u7684 AppID\uFF1B\u5F53 source \u4E3A 'explicit' \u65F6\u5FC5\u586B\u3002"),
|
|
13487
|
-
inspectCount:
|
|
13488
|
-
limit:
|
|
13489
|
-
minCompletionRate:
|
|
13490
|
-
maxRemainingAchievements:
|
|
13491
|
-
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")
|
|
13492
13224
|
},
|
|
13493
13225
|
annotations: {
|
|
13494
13226
|
readOnlyHint: true,
|
|
@@ -13532,15 +13264,15 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13532
13264
|
title: "\u6211\u7684\u6E38\u620F\u5FEB\u7167",
|
|
13533
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",
|
|
13534
13266
|
inputSchema: {
|
|
13535
|
-
appid:
|
|
13536
|
-
key:
|
|
13537
|
-
language:
|
|
13538
|
-
includeAchievements:
|
|
13539
|
-
includeStats:
|
|
13540
|
-
includeNews:
|
|
13541
|
-
includePlayerCount:
|
|
13542
|
-
newsCount:
|
|
13543
|
-
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")
|
|
13544
13276
|
},
|
|
13545
13277
|
annotations: {
|
|
13546
13278
|
readOnlyHint: true,
|
|
@@ -13584,7 +13316,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13584
13316
|
title: "\u6211\u7684 Steam \u7FA4\u7EC4",
|
|
13585
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",
|
|
13586
13318
|
inputSchema: {
|
|
13587
|
-
key:
|
|
13319
|
+
key: z3.string().optional().describe("\u53EF\u9009\u7684 Steam Web API key \u8986\u76D6\u503C\u3002")
|
|
13588
13320
|
},
|
|
13589
13321
|
annotations: {
|
|
13590
13322
|
readOnlyHint: true,
|
|
@@ -13610,18 +13342,18 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13610
13342
|
title: "\u6211\u7684 Steam \u5173\u6CE8\u6D41",
|
|
13611
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",
|
|
13612
13344
|
inputSchema: {
|
|
13613
|
-
key:
|
|
13614
|
-
source:
|
|
13615
|
-
appids:
|
|
13616
|
-
|
|
13617
|
-
|
|
13618
|
-
|
|
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()]))
|
|
13619
13351
|
]).optional().describe("\u663E\u5F0F\u6307\u5B9A\u8981\u5173\u6CE8\u7684 appid\uFF1B\u5F53 source \u4E3A 'explicit' \u65F6\u5FC5\u586B\u3002"),
|
|
13620
|
-
limitApps:
|
|
13621
|
-
newsPerApp:
|
|
13622
|
-
newsMaxLength:
|
|
13623
|
-
includePlayerCount:
|
|
13624
|
-
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")
|
|
13625
13357
|
},
|
|
13626
13358
|
annotations: {
|
|
13627
13359
|
readOnlyHint: true,
|
|
@@ -13660,7 +13392,7 @@ function registerMyAccountTools(server, runtime2) {
|
|
|
13660
13392
|
}
|
|
13661
13393
|
|
|
13662
13394
|
// src/tools/overview.ts
|
|
13663
|
-
import * as
|
|
13395
|
+
import * as z4 from "zod/v4";
|
|
13664
13396
|
function registerOverviewTools(server, runtime2) {
|
|
13665
13397
|
server.registerTool(
|
|
13666
13398
|
"steam_get_player_profile_overview",
|
|
@@ -13668,11 +13400,11 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13668
13400
|
title: "Steam \u73A9\u5BB6\u8D44\u6599\u603B\u89C8",
|
|
13669
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",
|
|
13670
13402
|
inputSchema: {
|
|
13671
|
-
steamid:
|
|
13672
|
-
vanityUrl:
|
|
13673
|
-
key:
|
|
13674
|
-
includeRecentlyPlayed:
|
|
13675
|
-
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")
|
|
13676
13408
|
},
|
|
13677
13409
|
annotations: {
|
|
13678
13410
|
readOnlyHint: true,
|
|
@@ -13710,14 +13442,14 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13710
13442
|
title: "Steam \u6E38\u620F\u5E93\u603B\u89C8",
|
|
13711
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",
|
|
13712
13444
|
inputSchema: {
|
|
13713
|
-
steamid:
|
|
13714
|
-
vanityUrl:
|
|
13715
|
-
key:
|
|
13716
|
-
includeAppInfo:
|
|
13717
|
-
includePlayedFreeGames:
|
|
13718
|
-
includeRecentGames:
|
|
13719
|
-
recentGamesCount:
|
|
13720
|
-
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")
|
|
13721
13453
|
},
|
|
13722
13454
|
annotations: {
|
|
13723
13455
|
readOnlyHint: true,
|
|
@@ -13758,13 +13490,13 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13758
13490
|
title: "Steam \u6210\u5C31\u603B\u89C8",
|
|
13759
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",
|
|
13760
13492
|
inputSchema: {
|
|
13761
|
-
steamid:
|
|
13762
|
-
vanityUrl:
|
|
13763
|
-
appid:
|
|
13764
|
-
key:
|
|
13765
|
-
language:
|
|
13766
|
-
includeStats:
|
|
13767
|
-
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")
|
|
13768
13500
|
},
|
|
13769
13501
|
annotations: {
|
|
13770
13502
|
readOnlyHint: true,
|
|
@@ -13803,12 +13535,12 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13803
13535
|
title: "Steam \u65B0\u95FB\u603B\u89C8",
|
|
13804
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",
|
|
13805
13537
|
inputSchema: {
|
|
13806
|
-
appid:
|
|
13807
|
-
count:
|
|
13808
|
-
maxlength:
|
|
13809
|
-
enddate:
|
|
13810
|
-
feeds:
|
|
13811
|
-
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")
|
|
13812
13544
|
},
|
|
13813
13545
|
annotations: {
|
|
13814
13546
|
readOnlyHint: true,
|
|
@@ -13843,8 +13575,6 @@ function registerOverviewTools(server, runtime2) {
|
|
|
13843
13575
|
|
|
13844
13576
|
// src/server.ts
|
|
13845
13577
|
var spec = applyGeneratedToolTitles(steam_web_api_spec_default);
|
|
13846
|
-
var generatedToolsEnabled = toBoolean(process.env.STEAM_ENABLE_GENERATED_TOOLS) ?? false;
|
|
13847
|
-
var helperToolCount = 4;
|
|
13848
13578
|
var runtime = createSteamBaseRuntime(spec, {
|
|
13849
13579
|
apiKey: process.env.STEAM_WEB_API_KEY,
|
|
13850
13580
|
defaultSteamId: normalizeScalarInput(process.env.STEAM_DEFAULT_STEAMID),
|
|
@@ -13854,34 +13584,22 @@ var runtime = createSteamBaseRuntime(spec, {
|
|
|
13854
13584
|
),
|
|
13855
13585
|
timeoutMs: Number.parseInt(process.env.STEAM_REQUEST_TIMEOUT_MS ?? "30000", 10)
|
|
13856
13586
|
});
|
|
13857
|
-
function createAdvancedToolsStatus() {
|
|
13858
|
-
if (!generatedToolsEnabled) {
|
|
13859
|
-
return "advanced tools: disabled";
|
|
13860
|
-
}
|
|
13861
|
-
return `advanced tools: enabled (${helperToolCount} helper + ${runtime.spec.methodCount} generated)`;
|
|
13862
|
-
}
|
|
13863
13587
|
function createServer() {
|
|
13864
13588
|
const server = new McpServer({
|
|
13865
13589
|
name: "steam-tools-mcp",
|
|
13866
|
-
version: "0.1.
|
|
13590
|
+
version: "0.1.2",
|
|
13867
13591
|
websiteUrl: "https://partner.steamgames.com/doc/webapi"
|
|
13868
13592
|
});
|
|
13869
13593
|
registerOverviewTools(server, runtime);
|
|
13870
13594
|
registerAppTools(server, runtime);
|
|
13871
13595
|
registerMyAccountTools(server, runtime);
|
|
13872
|
-
if (generatedToolsEnabled) {
|
|
13873
|
-
registerHelperTools(server, runtime);
|
|
13874
|
-
registerGeneratedTools(server, runtime);
|
|
13875
|
-
}
|
|
13876
13596
|
return server;
|
|
13877
13597
|
}
|
|
13878
13598
|
async function startStdioServer() {
|
|
13879
13599
|
const server = createServer();
|
|
13880
13600
|
const transport = new StdioServerTransport();
|
|
13881
13601
|
await server.connect(transport);
|
|
13882
|
-
console.error(
|
|
13883
|
-
`steam-tools-mcp running over stdio. ${createAdvancedToolsStatus()}.`
|
|
13884
|
-
);
|
|
13602
|
+
console.error("steam-tools-mcp running over stdio.");
|
|
13885
13603
|
}
|
|
13886
13604
|
async function handleHttpRequest(req, res) {
|
|
13887
13605
|
const server = createServer();
|
|
@@ -13919,9 +13637,7 @@ async function startHttpServer() {
|
|
|
13919
13637
|
ok: true,
|
|
13920
13638
|
generatedAt: runtime.spec.generatedAt,
|
|
13921
13639
|
methodCount: runtime.spec.methodCount,
|
|
13922
|
-
interfaceCount: runtime.spec.interfaceCount
|
|
13923
|
-
generatedToolsEnabled,
|
|
13924
|
-
enabledGeneratedToolCount: generatedToolsEnabled ? runtime.spec.methodCount : 0
|
|
13640
|
+
interfaceCount: runtime.spec.interfaceCount
|
|
13925
13641
|
});
|
|
13926
13642
|
});
|
|
13927
13643
|
app.post("/mcp", async (req, res) => {
|
|
@@ -13953,9 +13669,7 @@ async function startHttpServer() {
|
|
|
13953
13669
|
reject(error);
|
|
13954
13670
|
return;
|
|
13955
13671
|
}
|
|
13956
|
-
console.log(
|
|
13957
|
-
`steam-tools-mcp listening on http://${host}:${port}/mcp. ${createAdvancedToolsStatus()}.`
|
|
13958
|
-
);
|
|
13672
|
+
console.log(`steam-tools-mcp listening on http://${host}:${port}/mcp.`);
|
|
13959
13673
|
resolve();
|
|
13960
13674
|
});
|
|
13961
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",
|