swift_package_run
Run executable targets from Swift packages using swift run. Specify package path, executable name, arguments, and build configuration to execute Swift code.
Instructions
Runs an executable target from a Swift Package with swift run
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": {
"packagePath": "<packagePath>"
},
"name": "swift_package_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packagePath | Yes | Path to the Swift package root (Required) | |
| executableName | No | Name of executable to run (defaults to package name) | |
| arguments | No | Arguments to pass to the executable | |
| configuration | No | Build configuration: 'debug' (default) or 'release' | |
| timeout | No | Timeout in seconds (default: 30, max: 300) | |
| background | No | Run in background and return immediately (default: false) | |
| parseAsLibrary | No | Add -parse-as-library flag for @main support (default: false) |