Skip to content

Commit 73ce7dd

Browse files
committed
fix(test): update download path integration test to match tool description
- Update downloadRemoteFileToPath tool description to include IDE-specific path variables - Add test assertion for usage examples in tool description - Ensure test expectations match actual tool implementation - Fix failing integration test for downloadRemoteFileToPath
1 parent bfbe03a commit 73ce7dd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mcp/src/tools/download.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export function registerDownloadTools(server: ExtendedMcpServer) {
421421
"downloadRemoteFileToPath",
422422
{
423423
title: "下载远程文件到指定路径",
424-
description: "下载远程文件到项目根目录下的指定相对路径。例如:小程序的 Tabbar 等素材图片,必须使用 **png** 格式,可以从 Unsplash、wikimedia【一般选用 500 大小即可、Pexels、Apple 官方 UI 等资源中选择来下载。",
424+
description: "下载远程文件到项目根目录下的指定相对路径。Claude Code: WORKSPACE_FOLDER_PATHS, Qwen Code: PROJECT_ROOT, CodeBuddy: GITHUB_WORKSPACE。例如:小程序的 Tabbar 等素材图片,必须使用 **png** 格式,可以从 Unsplash、wikimedia【一般选用 500 大小即可、Pexels、Apple 官方 UI 等资源中选择来下载。",
425425
inputSchema: {
426426
url: z.string().describe("远程文件的 URL 地址"),
427427
relativePath: z.string().describe("相对于项目根目录的路径,例如:'assets/images/logo.png' 或 'docs/api.md'。不允许使用 ../ 等路径遍历操作。")

tests/download-path-integration.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ test('downloadRemoteFileToPath tool is available and has correct schema', async
7070
expect(downloadPathTool.description).toContain('Claude Code: WORKSPACE_FOLDER_PATHS');
7171
expect(downloadPathTool.description).toContain('Qwen Code: PROJECT_ROOT');
7272
expect(downloadPathTool.description).toContain('CodeBuddy: GITHUB_WORKSPACE');
73-
console.log('✅ Tool description contains supported editor information');
73+
expect(downloadPathTool.description).toContain('小程序的 Tabbar 等素材图片');
74+
console.log('✅ Tool description contains supported editor information and usage examples');
7475

7576
console.log('✅ downloadRemoteFileToPath tool schema validation passed');
7677

0 commit comments

Comments
 (0)