Commit 79619d0
Toolbox sample (#179)
* Add foundry-toolbox hosted agent sample
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add foundry-toolbox-server-side hosted agent sample
Demonstrates loading a Foundry Toolbox and passing its tools to the agent
as server-side tools via GetToolboxToolsAsync(). Contrasts with the existing
foundry-toolbox sample, which resolves tools client-side via AddFoundryToolboxes().
Also lists both toolbox samples in the parent README sample index.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add code_interpreter to foundry-toolbox-server-side toolbox
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Specify code_interpreter container for server-side Responses API
The Responses API rejects a code_interpreter tool without a container:
HTTP 400 invalid_payload, param /tools/0/container. Adding container.type=auto
satisfies the requirement.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump Agent Framework packages to latest in .NET MAF samples
- Microsoft.Agents.AI.Foundry.Hosting 1.2.0-preview.260421.1 -> 1.3.0-preview.260423.1
- Microsoft.Agents.AI.Workflows 0.0.1-preview.260417.2 -> 1.3.0 (workflows sample)
- ModelContextProtocol 1.1.0 -> 1.2.0 (mcp-tools sample)
Azure.AI.Projects is already at latest (2.1.0-beta.1);
Azure.AI.AgentServer.Invocations is already at latest (1.0.0-beta.3).
All 9 samples build clean with 0 warnings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bridge platform-injected toolbox endpoint env var in C# foundry-toolbox sample
The Foundry hosted-agent runtime injects TOOLBOX_<NAME>_MCP_ENDPOINT (full URL
with pinned toolbox version), but Microsoft.Agents.AI.Foundry.Hosting 1.3
expects a base URL in FOUNDRY_AGENT_TOOLSET_ENDPOINT. Without the bridge, the
FoundryToolboxService logs 'toolbox support is disabled' and the agent falls
back to model-only behavior (hallucinating tools). Derive the base URL and
api-version from the injected variable before calling AddFoundryToolboxes().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Connect C# foundry-toolbox sample directly to MCP proxy
AddFoundryToolboxes() from Microsoft.Agents.AI.Foundry.Hosting 1.3 cannot be
used end-to-end on the current hosted-agent platform: it expects a base URL
in FOUNDRY_AGENT_TOOLSET_ENDPOINT (not injected by the runtime) and uses the
wrong token audience (cognitiveservices.azure.com/.default) for the Foundry
Toolbox MCP proxy, which requires https://ai.azure.com/.default. Replace the
helper with a direct ModelContextProtocol McpClient call that:
- reads the per-toolbox endpoint from TOOLBOX_<NAME>_MCP_ENDPOINT
- attaches a bearer token with the ai.azure.com audience
- discovers tools and passes them to AsAIAgent(..., tools: [..tools])
A future SDK release is expected to handle both natively; this sample can
then revert to AddFoundryToolboxes().
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove C# foundry-toolbox (client-side) sample
Remove the client-side AddFoundryToolboxes() sample until the SDK natively
handles the hosted-agent platform's TOOLBOX_<NAME>_MCP_ENDPOINT injection and
uses the correct (ai.azure.com) token audience for the toolbox MCP proxy. The
server-side foundry-toolbox-server-side sample covers toolbox integration in
the meantime.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove dangling references to deleted foundry-toolbox sample
Cleans up the comment block in Program.cs and the comparison table in README.md
that referenced the now-removed client-side foundry-toolbox sample.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add env vars to dotnet agent.yaml files for VS Code dev path
The agent.yaml files are consumed by the local VS Code development path and
need to declare the same env vars as agent.manifest.yaml. Adds
AZURE_AI_MODEL_DEPLOYMENT_NAME to the six samples that use it; mirrors the
pattern already in foundry-toolbox-server-side/agent.yaml. invocations-echo-agent
declares no env vars and is unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: alliscode <bentho@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 585458f commit 79619d0
22 files changed
Lines changed: 231 additions & 9 deletions
File tree
- samples/csharp/hosted-agents/agent-framework
- foundry-toolbox-server-side
- hello-world
- invocations-echo-agent
- local-tools
- mcp-tools
- simple-agent
- text-search-rag
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments