Skip to content

samples: add McpDocsResearch declarative workflow showcasing agent-level MCP pattern#6054

Open
jluocsa wants to merge 3 commits into
microsoft:mainfrom
jluocsa:add-mcp-docs-research-workflow-sample
Open

samples: add McpDocsResearch declarative workflow showcasing agent-level MCP pattern#6054
jluocsa wants to merge 3 commits into
microsoft:mainfrom
jluocsa:add-mcp-docs-research-workflow-sample

Conversation

@jluocsa
Copy link
Copy Markdown
Member

@jluocsa jluocsa commented May 23, 2026

Summary

Adds a new declarative workflow sample, declarative-agents/workflow-samples/McpDocsResearch.yaml, that showcases the agent-level MCP pattern — where an MCP-backed agent reasons over MCP tools as part of its own turn, instead of the workflow invoking MCP directly.

The workflow is a three-agent sequential pipeline:

  1. QueryPlannerAgent rewrites the user's question as a focused Microsoft Learn search query.
  2. MicrosoftLearnAgent is the MCP-backed agent (the existing agent-samples/foundry/MicrosoftLearnAgent.yaml definition). It searches Microsoft Learn via https://learn.microsoft.com/api/mcp and drafts an evidence-rich answer.
  3. CitationReviewerAgent verifies the answer includes Microsoft Learn URL citations and produces the final response (autoSend: true).

Motivation

declarative-agents/workflow-samples/ ships four samples today — CustomerSupport, DeepResearch, Marketing, and MathChat. None of them showcase MCP. The runtime samples folder does have dotnet/samples/03-workflows/Declarative/InvokeMcpTool/InvokeMcpTool.yaml, but that demonstrates the action-level pattern (workflow calls InvokeMcpTool directly). The agent-level pattern — where an MCP server is wired as a tool on the agent and the agent decides when to call it — is a meaningfully different design choice and currently has no end-to-end multi-agent example in the showcase folder.

The new sample explicitly contrasts the two patterns in the header comments so readers can pick the right one for their scenario.

Why this shape

  • Three sequential agents, matching the simplicity of Marketing.yaml so the focus stays on the MCP wiring, not on workflow orchestration.
  • Reuses the existing MicrosoftLearnAgent.yaml in the middle position so no new agent definitions are needed; readers can run this workflow against the agent yaml already in the repo.
  • No new actions or schema features. Uses only InvokeAzureAgent plus the Local.* / System.LastMessage.Text / UserMessage() / MessageText() patterns already established by the existing samples.

Files changed

  • declarative-agents/workflow-samples/McpDocsResearch.yaml — new, 67 lines.

How to test

Register agents named QueryPlannerAgent, MicrosoftLearnAgent (configured with the MCP tool from agent-samples/foundry/MicrosoftLearnAgent.yaml), and CitationReviewerAgent with the runtime, then execute the workflow with DeclarativeWorkflowBuilder.Build("McpDocsResearch.yaml", options).

Example input from the file header:

How do I configure managed identity for an Azure Function app calling a Cosmos DB account?

Out of scope (happy to add as follow-ups if reviewers want)

  • A runtime sample under dotnet/samples/03-workflows/Declarative/McpDocsResearch/ that registers the three agents and runs the workflow.
  • A matching Python runtime sample.

…vel MCP pattern

Adds a three-agent sequential workflow to declarative-agents/workflow-samples/ that demonstrates the agent-level MCP pattern: QueryPlannerAgent -> MicrosoftLearnAgent (MCP-backed) -> CitationReviewerAgent. Complements the existing action-level pattern in dotnet/samples/03-workflows/Declarative/InvokeMcpTool/ and pairs with the existing agent-samples/foundry/MicrosoftLearnAgent.yaml definition.
Copilot AI review requested due to automatic review settings May 23, 2026 17:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new declarative workflow sample demonstrating the agent-level MCP (Model Context Protocol) pattern for Microsoft Learn research and citation review.

Changes:

  • Introduces McpDocsResearch.yaml workflow chaining three agents (planner → MCP-backed search → citation reviewer).
  • Documents when to prefer agent-level MCP vs workflow-level MCP invocation.

Comment thread declarative-agents/workflow-samples/McpDocsResearch.yaml
Comment thread declarative-agents/workflow-samples/McpDocsResearch.yaml
Comment thread declarative-agents/workflow-samples/McpDocsResearch.yaml Outdated
jluocsa and others added 2 commits May 23, 2026 11:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants