Skip to content

DTD/VmService - add optional descriptions and schemas to service extensions #60387

Open
@jakemac53

Description

@jakemac53

See the Model Context Protocol and specifically what it looks like to register a "tool" as a server.

These are very similar to DTD service extensions and VM service extensions, and we very likely want to expose those from our own MCP server as "tools". The main difference is that the MCP "tools" require a schema and a description. These are used by the AI to try and figure out when a user is trying to invoke a given tool, as well as how to invoke it properly.

Wait, what is this?

A quick tldr; here is that MCP is an open protocol for AI models to interact with other tools. We want to write an MCP server for Dart programmers, which can connect the AI models to their apps - exposing all the same functionality that devtools etc get today.

Use cases

Some example use cases are taking a screenshot to provide as context to the model, providing runtime and static errors as context, providing info about the selected widget as context, or even calling arbitrary service extensions registered from inside or outside the app.

For known extensions, we can provide our own description and schemas, so we can start there. But eventually it would be useful for the extensions to actually provide descriptions and schemas, so that we can support invoking arbitrary extensions in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.pkg-dtdFor issues related to the Dart Tooling Daemon (package:dtd or pkg/dtd_impl within the Dart SDK)vm-serviceThe VM Service Protocol, both the specification and its implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions