Skip to content

Copilot Tools

Peter McDonald edited this page Aug 12, 2026 · 2 revisions

Copilot tools (Language Model Tools)

Dataverse PowerTools contributes tools to VS Code's Language Model Tools surface, so GitHub Copilot Chat can answer questions about your Dataverse workspace — and, if you allow it, run a deploy or generate early-bound classes — using the same code paths the panel buttons use.

Read-only by default. Nothing mutates your environment until you change a setting, and even then each call asks first.

The tools

Tool Reference it as What it reports or does Read / mutating
Dataverse connection status #dvptConnectionStatus The workspace's connection: organization URL, auth type (service principal or interactive/OAuth), and whether a token has been acquired Read
List Dataverse components #dvptListComponents Every component discovered in the workspace — plugins, web resources, PCF controls, Azure Functions, solutions — with type, name and folder Read
Dataverse PowerTools requirements #dvptSystemRequirements Whether dotnet, node and pac are installed Read
Deploy #dvptDeploy Build & deploy the active component to Dataverse Mutating
Generate early-bound #dvptGenerateEarlybound Generate early-bound classes for the active plugin component Mutating

Type # in Copilot Chat to reference one explicitly, or just ask — Copilot picks the tool from your question ("is this workspace connected?", "what components are in here?").

Read-only by default

The mutating tools are disabled until you opt in:

dataverse-powertools.copilot.accessMode Effect
readonly (default) Only the three read tools. Asking for a deploy gets a clear refusal naming the setting
readwrite The mutating tools are available too — each one still asks for confirmation on every call

Two independent gates, deliberately: the setting decides whether a tool exists for Copilot at all, and the confirmation decides whether this particular call happens. Turning on readwrite does not hand over your environment.

No secrets, ever

The read tools return summaries built for this purpose — they name the organization URL and the auth type, and say whether a token was acquired. They never return the client secret, the client id, or the token itself. Secrets live in VS Code secret storage and are not part of any tool's output, so a chat transcript cannot leak them.

Setting it up

  1. Have Copilot Chat installed and signed in (the tools appear on VS Code's Language Model Tools surface, which Copilot Chat consumes).
  2. Open a workspace with a dataverse-powertools.json — the tools describe that workspace.
  3. For the mutating tools, set dataverse-powertools.copilot.accessMode to readwrite in settings.

Nothing else to configure: the tools are registered once when the extension activates, and they follow whichever component is active in the panel.

Worked examples

"Is this workspace connected to Dataverse, and as what?"#dvptConnectionStatus answers with the organization URL and whether the connection is a service principal or interactive, without you opening the panel.

"What's in this repo?"#dvptListComponents lists each component and its folder, which is the quickest way to get your bearings in a multi-component repo.

"Why won't the plugin build?"#dvptSystemRequirements rules the toolchain in or out (dotnet, node, pac) before you go looking at code.

"Deploy the plugin" — refused in the default read-only mode, with the setting named. In readwrite, you get a confirmation prompt naming the operation before anything runs.

Troubleshooting

The tools do not appear in Copilot Chat — check the extension activated (open the Dataverse PowerTools panel) and that your VS Code is recent enough to have the Language Model Tools API. The extension registers the tools only when the API is present, so an older VS Code simply has none.

"The … tool changes your Dataverse environment and is disabled in read-only mode" — expected; set dataverse-powertools.copilot.accessMode to readwrite if you want it.

A tool answers about the wrong component — the mutating tools act on the active component. Select the component you mean in the panel first.

See also

Clone this wiki locally