| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Introduces a new declarative workflow sample that demonstrates invoking Foundry Toolbox MCP tools, including a reserved tools/list discovery operation. Also extends DefaultMcpToolHandler to support embedded resource content blocks and the new reserved tool name.
Changes:
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Workflows.Declarative.Mcp/DefaultMcpToolHandler.cs | Adds reserved tools/list operation and embedded resource block conversion. |
| dotnet/tests/.../DefaultMcpToolHandlerTests.cs | Tests for reserved name handling, list-tools serialization, and embedded resources. |
| dotnet/tests/.../InvokeMcpToolExecutorTest.cs | Adds executor-level test for reserved tools/list tool name. |
| dotnet/samples/03-workflows/Declarative/InvokeFoundryToolboxMcp/Program.cs | New sample wiring a Foundry toolbox, MCP handler, and declarative workflow. |
| dotnet/samples/.../InvokeFoundryToolboxMcp.yaml | Declarative workflow YAML invoking toolbox tools and summarizing results. |
| dotnet/samples/.../InvokeFoundryToolboxMcp.csproj | Project file for the new sample. |
| dotnet/eng/verify-samples/WorkflowSamples.cs | Registers the new sample for sample verification runs. |
| dotnet/agent-framework-dotnet.slnx | Adds the new sample project to the solution. |
Sorry, something went wrong.
There was a problem hiding this comment.
Reviewers: 4 | Confidence: 86%
The PR adds a Foundry Toolbox MCP sample and extends DefaultMcpToolHandler with tools/list discovery and EmbeddedResourceBlock support. The production code is correct: the tools/list branch validates arguments, reuses the MCP client correctly, and serializes tool metadata properly. The EmbeddedResourceBlock handling follows the same patterns as existing Image/Audio content block conversions. The sample code properly uses ConcurrentBag for thread safety and in-memory configuration. No correctness issues found.
This PR adds a Foundry Toolbox MCP sample and extends DefaultMcpToolHandler with tools/list support and EmbeddedResourceBlock handling. The library changes are well-structured: the reserved tool name check uses strict ordinal comparison, argument validation throws early, the ConvertEmbeddedResource switch handles fallback gracefully, and SerializeToolsList uses Utf8JsonWriter which properly escapes JSON output. The sample code uses ConcurrentBag for thread-safe HttpClient tracking and properly disposes resources in finally blocks. Previously resolved review comments (Description null handling, ConcurrentBag, consolidated branching) have been addressed. No injection risks, resource leaks, or unhandled failure modes were found in the library code.
Test coverage for the new features is generally solid. The tools/list reserved-tool-name flow, argument rejection, embedded-resource conversion, and executor pass-through are all tested. Two minor gaps stand out: (1) the SerializeToolsList branch that writes a non-null OutputSchema is completely unexercised—only the null/else path runs; (2) the CreateListToolsResultContent test doesn't assert the outputSchema property in the serialized JSON at all, even for the null case it exercises.
I found one design issue in the new workflow sample: it performs tool discovery via tools/list but then ignores the discovered names and hard-codes a derived toolbox tool name instead. The repo already has a better pattern for Foundry toolbox usage that relies on the names returned by ListToolsAsync(), so this sample is coupling itself to a naming convention that the rest of the codebase does not rely on.
Automated review by peibekwe's agents
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation and Context
Introduce a new declarative workflow sample to demonstrate how to embed and invoke Foundry Toolbox in declarative workflows and how to wire that up to an agent conversation. Also updated DefaultMcpToolHandler to deal with embedded resource content blocks.
Fixes #5828
Contribution Checklist