# SquadResource Constructors

- Package: [CommunityToolkit.Aspire.Hosting.Squad](/reference/api/csharp/communitytoolkit.aspire.hosting.squad.md)
- Type: [SquadResource](/reference/api/csharp/communitytoolkit.aspire.hosting.squad/squadresource.md)
- Kind: `Constructors`
- Members: `1`

Represents a Squad AI-agent team as a first-class Aspire resource. Implements `ApplicationModel.IResourceWithConnectionString` so that downstream services can reference the team with `.WithReference(squad)` and receive a custom `squad://` descriptor that encodes the resource name, team root, and agent roster. The resource is a logical Aspire resource; it does not start a listener by itself.

<a id="constructor"></a>
<a id="constructor-string-string"></a>

## SquadResource(string, string)

- Name: `Constructor(string, string)`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.Squad/SquadResource.cs#L50-L56)

Initialises a new [SquadResource](/reference/api/csharp/communitytoolkit.aspire.hosting.squad/squadresource.md), auto-discovering agents from `.squad/team.md`.

```csharp
public sealed class SquadResource
{
    public SquadResource(
        string name,
        string teamRoot)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The Aspire resource name.
- `teamRoot` (`string`)
  Absolute path to the workspace root (the directory that contains the `.squad/` folder).
