dart-add-roots
To register project roots for Dart tooling access, add one or more root paths before using other Dart tools on those projects.
When & Why to Use This Skill
The dart-add-roots skill is a foundational utility designed to register project directories for Dart tooling access. It acts as a critical initialization step, enabling the AI agent to recognize and interact with specific Dart project structures, which is required before performing advanced tasks like code analysis, refactoring, or debugging within those directories.
Use Cases
- Project Initialization: Setting up the workspace by registering the root directory of a Dart or Flutter project to enable full language server support for the AI agent.
- Monorepo Management: Adding multiple package paths within a single repository to ensure the Dart server correctly resolves cross-package dependencies and references.
- Security and Scope Control: Defining explicit project boundaries to ensure that Dart-specific automation tools only operate within authorized and registered file system roots.
| name | dart-add-roots |
|---|---|
| description | "To register project roots for Dart tooling access, add one or more root paths before using other Dart tools on those projects." |
Usage
Use the MCP tool dev-swarm.request to send the payload as a JSON string:
{"server_id":"dart","tool_name":"add_roots","arguments":{}}
Tool Description
Adds one or more project roots. Tools are only allowed to run under these roots, so you must call this function before passing any roots to any other tools.
Arguments Schema
The schema below describes the arguments object in the request payload.
{
"type": "object",
"properties": {
"roots": {
"type": "array",
"description": "All the project roots to add to this server.",
"items": {
"type": "object",
"properties": {
"uri": {
"type": "string",
"description": "The URI of the root."
},
"name": {
"type": "string",
"description": "An optional name of the root."
}
},
"required": [
"uri"
]
}
}
}
}
Background Tasks
If the tool returns a task id, poll the task status via the MCP request tool:
{"server_id":"dart","method":"tasks/status","params":{"task_id":"<task_id>"}}