Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/mcp/src/automationTools/profiler.ts
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
7
import { ApplicationService } from '../application';
8
9
/**
10
* Profiler Tools
11
* Note: Due to MCP limitations, these tools provide information about profiler methods
12
* but cannot execute them directly as they require function parameters
13
*/
14
export function applyProfilerTools(server: McpServer, appService: ApplicationService): RegisteredTool[] {
15
const tools: RegisteredTool[] = [];
16
17
// Seems too niche
18
// server.tool(
19
// 'vscode_automation_profiler_info',
20
// 'Get information about available profiler methods',
21
// {},
22
// async () => {
23
// return {
24
// content: [{
25
// type: 'text' as const,
26
// text: `Profiler methods available:
27
// - checkObjectLeaks(classNames, fn): Check for object leaks during function execution
28
// - checkHeapLeaks(classNames, fn): Check for heap leaks during function execution
29
30
// Note: These methods require function parameters and cannot be executed directly via MCP.
31
// They are primarily used within VS Code's automation test framework.`
32
// }]
33
// };
34
// }
35
// );
36
37
return tools;
38
}
39
40