ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
New to LLM tools? Here are some starting resources
This is aimed at adding tools to vscode-copilot-chat, but much of it would apply to tools in other extensions or MCP servers as well.
First, consider whether a new built-in tool is needed. Tools should be built-in if they are related to core VS Code functionality or the core search/edit/terminal agent loop and are needed for common OOB scenarios. Consider whether the tool can be contributed from another extension instead. If the task can be done through normal terminal commands, then it may not need its own tool.
First, add an entry in vscode-copilot's package.json under contributes.languageModelTools:
copilot_- this pattern is protected for our use only~~toolReferenceName might be a good idea.copilot_ tools will be renamed later.toolReferenceName and a localized userDescription.toolReferenceName is the name used in the tool picker, and to reference the tool with #, and to add the tool to a mode or toolset.contributes.languageModelToolSets- new tools should be part of a toolset.modelDescription. This is what the LLM uses to decide whether to use your tool. This should _not_ be localized. Be very detailed:inputSchema. This is a JSON schema which must describe an object with the properties that the tool takes. Describe the properties in detail. File paths should be absolute paths. Think carefully about which properties are required.toolNames.ts, add entries to ToolName, ContributedToolName, contributedToolNameToToolNames. Follow the naming patterns of other tools. ToolName is the real name of your tool that the LLM will see. It should also be clear. A good pattern is to start with a verb, e.g. read_file.Then, implement your tool in src/extension/tools/node:
vscode.LanguageModelTool. More sophisticated tools can implement ICopilotTool, which gives you some extra functionality.ToolRegistry.registerTool(YourTool); and import your tool file in allTools.ts.IPromptPathRepresentationService.If something goes wrong, throw an error with a message that will make sense to the LLM. It will be caught by the agent and shown to the LLM. Should the model call your tool again with different arguments, or do something different? Make sure the model can understand what to do next.
If the tool has a potentially dangerous side-effect (e.g. the terminal tool), it MUST ask for the user's confirmation before running. Do this by returning PreparedToolInvocation.confirmationMessages. Give enough context in the confirmation message for the user to understand what the tool will do, and what the risk is. The message can be a markdown string containing a codeblock.
PreparedToolInvocation.invocationMessage and pastTenseMessage with a helpful message to show in the UI.... to the end of the tool messageExtendedLanguageModelToolResult.toolResultMessage.toolResultDetails will make the tool message an expandable list of URIs to show the tool's result. (e.g. file search, text search)
ExtendedLanguageModelToolResult.toolResultMessage to a MarkdownString, using formatUriForFileWidget. This currently can't be combined with the toolResultDetails option.
Consider writing a unit test for your tool. One example to copy is `readFile.spec.tsx`. This test invokes the tool with some hardcoded arguments and checks the result against a snapshot.
Model-specific tools allow you to provide tool implementations that are only available for certain language models (e.g., Gemini, Claude, GPT-5). This is useful when:
Use model-specific tools when:
Register model-specific tools using ToolRegistry.registerModelSpecificTool:
class MyGeminiTool implements ICopilotModelSpecificTool<IMyToolInput> {
async invoke(
options: vscode.LanguageModelToolInvocationOptions<IMyToolInput>,
token: vscode.CancellationToken
): Promise<vscode.LanguageModelToolResult> {
// Gemini-specific implementation
return { content: [{ type: 'text', value: 'Result' }] };
}
}
// Register with a model selector
const disposable = ToolRegistry.registerModelSpecificTool(
{
name: 'my_gemini_tool',
displayName: 'My Gemini Tool',
description: 'A tool optimized for Gemini models',
inputSchema: {
type: 'object',
properties: {
query: { type: 'string', description: 'The query to process' }
},
required: ['query']
},
// Only available for Gemini 3:
models: [{ family: 'gemini-3-pro' }]
},
MyGeminiTool
);If your model-specific tool should replace an existing tool for certain models, use the overridesTool property:
class MyGeminiSearchTool extends GenericGrepSearchTool {
public readonly overridesTool = ToolName.GrepSearch;
// Gemini-optimized search implementation
}
}
ToolRegistry.registerModelSpecificTool(
{
name: 'gemini_grep_search',
displayName: 'Search (Gemini)',
description: 'Optimized grep search for Gemini',
models: [{ family: 'gemini' }],
inputSchema: { /* ... */ }
},
MyGeminiSearchTool
);When overridesTool is set:
Read the prompt. There is no replacement for just using your tool a lot, and reading the prompt. Read the whole thing top to bottom. What story does it tell? Get familiar with the prompt as a whole, don't get tunnel vision for one message. Does your new tool result make sense to you as a human? Is it formatted in a way that's consistent with other tool results and context in the user message?
 