Skip to content

feat(fabric): add read-only core_list-workspaces tool - #3842

Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-get-workspacefrom
amoshersch-fabric-list-workspaces
Closed

Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-get-workspacefrom
amoshersch-fabric-list-workspaces

Conversation

@AmosHersch

@AmosHersch Amos Hersch (AmosHersch) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds core_list-workspaces (fabmcp core list-workspaces) for the Fabric Core List Workspaces REST API.

  • Returns one page of accessible workspace management metadata and both continuation fields. Supports role filtering, an opaque continuation token, and optional workspace-specific endpoint metadata. Preserves documented percent-escaped cursors without double-encoding them, while retaining normal .NET URI canonicalization.
  • Uses source-generated typed output, read-only annotations, cancellation propagation, per-request authentication, strict response validation, and sanitized status-preserving errors with Retry-After guidance. No automatic page traversal, retries, LRO handling, mutations, or returned-URL following.
  • Reuses the inherited Core HTTP sender, validated retry-header/cursor helpers, and shared offline HTTP test handler. The list-specific workspace/tag DTOs, roles normalization, nullable endpoint preference, local throttling exception, and command contract remain unchanged. Existing create/search, Get Capacity, List Capacities, and Get Workspace behavior/tests are retained.
  • Adds focused offline coverage, cumulative local transport discovery assertions, Fabric README guidance, four additional e2e prompts, and a Fabric changelog entry. No shared authentication, host/proxy, recording infrastructure, project-file, or engineering-script changes are introduced by this layer.

Dependency: this existing draft now targets amoshersch-fabric-get-workspace, the branch for #3841, at frozen parent 1e263b3bbac16c11f09212a40f62118b100f8310. The ultimate target is main. This is the next sequential conflict-prevention layer; review its one commit / 24 changed files relative to #3841, not the cumulative lower-layer implementation. The PR number and owning branch are preserved, and no native stack metadata or automatic merge is configured.

GitHub issue number?

N/A — scoped tool addition requested directly; no issue was created.

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README — exits 0 with 14 pre-existing TOC warnings, verified identical to the frozen parent.
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts - Not run; score/ranking requirement waived for this PR by the Fabric MCP maintainer.
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json — N/A: Fabric registers NullConsolidatedToolDefinitionProvider; this is not an Azure-server tool.
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label — N/A: no tool rename.
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes: — N/A: Fabric-only PR.
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md — N/A.
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI) — N/A.
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md — N/A; Fabric-specific prompts were added instead.
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.) — N/A to this Azure-only subsection.
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline — not invoked.

Validation

Re-run against the combined layer with .NET SDK 10.0.401. The Fabric host is built through its test project's project reference and through the fresh Fabric-only publish used by the prompt validator.

Command Result
dotnet build .\tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj --nologo --verbosity quiet Passed; 0 warnings/errors.
dotnet build .\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --nologo --verbosity quiet Passed; 0 warnings/errors.
dotnet test --project .\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --no-build Passed: 619 cumulative Core tests, 0 skipped, including all inherited capacity/workspace/foundation suites.
dotnet build .\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --nologo --verbosity quiet Passed; 0 warnings/errors.
dotnet test --project .\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --no-build --filter-class '*ServerStartupTests' Passed: 5 tests, including default and all-tools discovery over local stdio/HTTP. All-tools assertions cover all six Core commands.
dotnet test --project .\tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj --filter-class '*ProviderDelegatingCredentialTests' Passed: 2 existing credential-bridge tests.
dotnet format .\tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj --verify-no-changes --no-restore --include $source --verbosity quiet Passed for the 12 layer-relative changed Core source C# files.
dotnet format .\tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --verify-no-changes --no-restore --include $tests --verbosity quiet Passed for the 7 layer-relative changed Core test C# files.
dotnet format .\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --verify-no-changes --no-restore --include .\servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Infrastructure\ServerStartupTests.cs --verbosity quiet Passed.
.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $paths -PackageInstallCache $cache Passed: all 24 layer-relative files, 0 spelling issues; the isolated session-local tooling cache was cleaned up.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath .\servers\Fabric.Mcp.Server\README.md Exited 0; 14 inherited TOC warnings, unchanged from parent 1e263b3b.
.\eng\scripts\Test-ToolSelectionPrompts.ps1 -ServerName Fabric.Mcp.Server -OutputPath .\.work\stack-3842-prompts Passed against a fresh Fabric-only Windows x64 publish: 52 tools, 1 server tested, 0 skipped, 0 violations. The inherited validator fix keeps stderr separate from JSON stdout.
.\.work\stack-3842-prompts\Fabric.Mcp.Server\windows-x64\fabmcp.exe tools list --name-only Passed; independently confirmed 52 total tools, all 6 Core names, and all 13 current prompt rows (3 Get Capacity, 3 Get Workspace, 3 List Capacities, 4 List Workspaces).
git diff --cached --check Passed before completing the rebase.

$source, $tests, and $paths were explicit changed-file arrays relative to the frozen parent, including added files; $cache denotes an isolated temporary tooling directory. The changelog entry retains its previously validated schema.

The six cumulative Core commands are core_create-item, core_search-catalog, core_get-capacity, core_list-capacities, core_get-workspace, and core_list-workspaces.

Coverage includes all role values/normalization/invalid combinations; nullable endpoint preference; escaped and hostile cursor inputs; normal unreserved-character URI canonicalization; first/final/empty/continuation pages; nullable and future metadata; malformed payloads; HTTP status and validated single/multiple Retry-After values; cancellation during credentials, HTTP, and deserialization; concurrent request isolation; response disposal; existing POST regressions; and typed MCP legacy/compact/duplicated output. Workspace-specific and continuation URLs remain output metadata, never request targets.

Pending and not performed

  • ToolDescriptionEvaluator: not run; maintainer exemption. The Fabric MCP maintainer has waived the score/ranking requirement for this PR. Configuration is unavailable; no score or top-three ranking is claimed. The checkbox remains unchecked because the evaluator was not run. Normal code review and required CI still apply.
  • Live Fabric calls, real OBO token exchange/authorization, and recorded playback: not performed. Fabric currently has no live/recorded infrastructure; adding or awaiting it is outside this scoped PR by explicit user direction. Mock credentials, registered-handler tests, and local discovery do not prove real-service/OBO behavior.
  • Full repository suites, package/NPX verification, and native publish were not run. A fresh Fabric-only publish was run for prompt validation; existing AOT/analyzer-enabled projects build without warnings. No package/project/PowerShell files are changed relative to the direct parent.
  • Actual required CI and human review remain applicable. No live-test pipeline was invoked; the PR remains draft, with no auto-merge, queue entry, native stack registration, or automatic merge requested.

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

@azure-pipelines

azure-pipelines Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the server-Fabric.Mcp Microsoft Fabric MCP Server label Oct 5, 2026
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-workspaces branch from dd91695 to f3bde1c Compare October 5, 2026 22:11
@AmosHersch
Amos Hersch (AmosHersch) changed the base branch from main to amoshersch-fabric-get-workspace October 5, 2026 22:11
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-workspaces branch 2 times, most recently from e8433eb to 38440e0 Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-workspaces branch 2 times, most recently from 10f0ef5 to 94207d7 Compare October 7, 2026 11:49
@AmosHersch
Amos Hersch (AmosHersch) marked this pull request as ready for review October 7, 2026 12:53
@AmosHersch
Amos Hersch (AmosHersch) requested a review from a team as a code owner October 7, 2026 12:53
Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Required CI and real-service authorization remain unverified, leaving final validation to human review.

Review effort: Balanced
Findings: None

What changed in this PR

Adds read-only core_list-workspaces to Fabric Core, building on #3841 and reusing its HTTP infrastructure.

Changes:

  • Adds single-page workspace discovery with role filtering, continuation tokens, and optional endpoint metadata.
  • Provides typed output, input validation, cancellation, and sanitized errors.
  • Adds offline tests, transport discovery checks, documentation, prompts, and a changelog entry.
File Description
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​WorkspaceListToolRegistrationTests.cs Tests discovery, schemas, output modes, and failures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​WorkspaceListTestData.cs Supplies workspace fixtures and mock credentials.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​WorkspaceListCancellationStream.cs Supports deserialization cancellation tests.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceWorkspaceListTests.cs Tests requests, pagination, validation, and isolation.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​README.md Documents tests and validation boundaries.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Models/​WorkspaceListSerializationTests.cs Tests metadata and continuation serialization.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​FabricCoreSetupTests.cs Verifies command registration.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​WorkspaceListCommandTests.cs Tests options, results, and sanitized errors.
tools/​Fabric.Mcp.Tools.Core/​src/​Validation/​WorkspaceListInputValidator.cs Normalizes roles and validates cursors.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​WorkspaceListThrottledException.cs Formats validated throttling guidance.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​IFabricCoreService.cs Adds the listing service contract.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​FabricCoreService.cs Implements single-page requests and response validation.
tools/​Fabric.Mcp.Tools.Core/​src/​Options/​WorkspaceListOptions.cs Defines optional listing inputs.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​WorkspaceListResponse.cs Models the API response page.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​WorkspaceListCommandResult.cs Defines typed command output.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​FabricWorkspaceListTag.cs Models workspace tags.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​FabricWorkspaceListEntry.cs Models workspace management metadata.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​CoreJsonContext.cs Registers source-generated serialization types.
tools/​Fabric.Mcp.Tools.Core/​src/​FabricCoreSetup.cs Registers and describes the new command.
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​WorkspaceListCommand.cs Implements the read-only tool and error mapping.
servers/​Fabric.Mcp.Server/​tests/​Fabric.Mcp.Server.Tests/​Infrastructure/​ServerStartupTests.cs Checks Core discovery over HTTP and stdio.
servers/​Fabric.Mcp.Server/​README.md Documents usage, pagination, and permissions.
servers/​Fabric.Mcp.Server/​docs/​e2eTestPrompts.md Adds four tool-selection prompts.
servers/​Fabric.Mcp.Server/​changelog-entries/​amoshersch-fabric-core-list-workspaces.yaml Records the new feature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AmosHersch

Copy link
Copy Markdown
Contributor Author

Superseded by #3887, which has merged into main with this layer's changes and the associated fixes. Closing this PR to avoid merging the same work again; its original review history is preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server-Fabric.Mcp Microsoft Fabric MCP Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants