flutter_pub_add
Add one or more packages to a Flutter project's dependencies. Specify the project directory and package list to update pubspec.yaml, with an option to add as dev dependencies.
Instructions
Add one or more packages to the project's dependencies.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_dir": "<project_dir>",
"packages": "<packages>"
},
"name": "flutter_pub_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dev | No | Add as dev dependency | |
| packages | Yes | Package names to add (e.g. ['http', 'provider']) | |
| project_dir | Yes | Path to the Flutter project directory |