Text of code.visualstudio.com › docs › agents › run › tools as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Use tools with agents

AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. Join VS Code at Microsoft Ignite or catch the sessions online. A year of VS Code, wrapped. Explore the highlights. Use tools with agents View as Markdown Ask in VS Code Ask in VS Code Insiders Tools let an agent inspect your project and check results instead of only suggesting code or commands for you to apply.

For example, it can read the implementation behind a failing test, make a change, and run the test to check whether the change works. Start with the tools already available in your session. Visual Studio Code supports built-in tools, Model Context Protocol (MCP) tools, and extension tools. When the task needs a capability these tools don't provide, connect a supported service to the Copilot harness with Copilot connectors Copilot connectors is in preview and might change before it becomes generally available. , add an MCP server , install an agent plugin that bundles MCP servers, or install an extension that contributes tools.

For background on tool types and how tools work in the agent loop, see Tools concepts . This article shows how to complete a request with tools, direct the agent to specific tools, control which tools are available, and review tool calls. Use tools in a request By default, the agent chooses from the enabled tools based on your request and the current context. You don't need to name or select each tool before you start.

To complete a request with tools: In the chat input, select Agent from the agent picker. Enter a prompt that describes your goal and how the agent should verify its work. For example: Find the cause of the failing tests in this project, fix it, and run the relevant tests to verify the change. Review each tool call as the agent works. If an approval prompt appears, expand the tool details to review its inputs, and then select the one-time approval option, such as Allow Once , to run it.

Expand a tool summary in the conversation to inspect the call and its output. When the task is complete, review the agent's response, code changes, and validation results. To control which calls require approval and how much autonomy the agent has, see Manage approvals and permissions . Change how tool calls are grouped in chat By default, tool call details are collapsed in the chat conversation. Use chat.agent.thinking.collapsedTools Open in VS Code Open in VS Code Insiders (experimental) to change the grouping behavior.

Use off to keep tool calls separate, withThinking to group tools with thinking when available, or always to always group tools. When chat.agent.thinkingStyle Open in VS Code Open in VS Code Insiders is set to collapsed , reasoning and grouped tool calls can appear in separate collapsible sections. Reference a tool explicitly Type # in the chat input to reference an available tool. Use an explicit reference when you want to direct the agent to a particular capability instead of letting it choose.

Tool names depend on the harness. For example, use the #web/fetch tool to retrieve a specific web page: Summarize the latest release notes at code.visualstudio.com/updates with #web/fetch. The # menu also contains context items, such as files, folders, and editor selections. Context items provide information for the request, while tools give the agent capabilities to gather information or take actions. Learn more about adding context to chat prompts .

Note User-defined tool sets are deprecated and are not supported in the Copilot harness. For a reusable tool selection, configure a custom agent. See Replace tool sets . Manage available tools For Copilot harness sessions, manage client-tool availability from the Agent Customizations editor. Your selection persists for the selected harness across windows and user profiles , rather than applying to only one request. For remote sessions, selections are stored separately for each remote host and harness.

To change the selection: Select the intended session and confirm its workspace and execution environment. In the chat input, select the Copilot harness. Open the Agent Customizations editor: In the Chat view, select Open Customizations in the title bar, or run Chat: Open Customizations from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ). In the Agents window, select Customizations in the sidebar. Select the Tools tab.

Select or deselect tools to control which ones are available to the agent. The selected session supplies the editor's context, but changing a client-tool selection can affect other sessions using that harness and host. It isn't a session-only override. See what customization changes affect . Limit the selection to tools that are relevant to your request. Add MCP tools by connecting supported services with Copilot connectors Copilot connectors is in preview and might change before it becomes generally available. , adding MCP servers , or installing agent plugins that bundle MCP servers.

Extensions can also contribute tools. To define a reusable tool selection for a workflow, specify tools in a custom agent . For other harnesses, check their setup requirements and configuration options . Manage tool availability for the Copilot harness All client-side tools are available to the Copilot harness by default. In the Tools tab, tools are organized into collapsible groups. You can: Enter text in the search box to filter tool groups and individual tools.

Select a tool group checkbox to enable or disable every tool in the group. Expand a group and select individual tools. The group checkbox shows a mixed state when only some tools are enabled. Review the enabled and total tool counts shown for each group. The count beside Tools in the customization navigation includes enabled client-side tools and excludes the read-only tools built into the Copilot harness. The Copilot group lists the harness's built-in tools.

These tools run in the Copilot runtime and are read-only in the Tools tab. Other tools run in the VS Code client and are available to the agent only while the client is connected. Tool availability is separate from tool approval. Enabling a tool makes it available to the agent, but doesn't bypass the configured approval and permission controls . Add extension tools for the Copilot harness In the main VS Code window, you can find extensions that contribute language model tools: Open the Tools tab and select Browse Marketplace .

Search for an extension and select it to view its details and contributed tools. Install the extension. Its tools then appear in the tool list, where you can manage their availability. The Agents window shows the tool availability list but doesn't include Marketplace browsing. To remove an extension from the tool list, right-click its tool group and select Uninstall Extension . Caution Uninstalling a tool extension removes the entire extension, including contributions that aren't tools.

Select tools for a Local harness request For Local harness sessions The Local harness is deprecated and will be removed in February 2027. Move your workflows to the Copilot harness before then. Learn more about Local harness deprecation . , select tools for an individual request from the Chat view: In the chat input, select the Local harness The Local harness is deprecated and will be removed in February 2027. Move your workflows to the Copilot harness before then.

Learn more about Local harness deprecation . and then select Agent from the agent picker. Select Configure Tools . Select or deselect tools to control which ones are available for the current request. Use the search box to filter the list. You can also specify tools in a prompt file or custom agent . Learn more about the tool list priority order . Edit tool parameters For a tool call that requires approval, expand the confirmation dialog to review its input parameters.

Generic and terminal tool confirmations are read-only.

The rest of this page is on the live site.