Skip to content

feat(fabric): add read-only core_get-workspace tool - #3841

Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
mainfrom
amoshersch-fabric-get-workspace
Closed

Amos Hersch (AmosHersch) wants to merge 1 commit into
mainfrom
amoshersch-fabric-get-workspace

Conversation

@AmosHersch

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

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds exactly one read-only Fabric Core tool, core_get-workspace, implementing the non-LRO Get Workspace REST API.

Depends on #3852 (List Capacities), not directly on main. The ultimate target remains main. This existing draft and branch were preserved during the user-authorized conflict-prevention reorganization. The layer is one commit, 1e263b3bbac16c11f09212a40f62118b100f8310, directly on 3e9acea71343da9f78a789d9aa3c3ca5bd52c9bc (amoshersch-fabric-list-capacities). Its parent already includes #3846, the #3855 shared foundation, and the #3854 validator fix. No native stack metadata was changed.

  • Requires a nonempty workspace UUID, validated before authentication/HTTP and normalized for the request. Optional prefer-workspace-specific-endpoints preserves the service default when omitted and forwards explicit true/false values.
  • Returns source-generated, typed workspace metadata: ID, display name, type, and available description, capacity, domain, workspace identity IDs, endpoints, and applied tags. Missing optional fields remain absent; future type/progress/region values are preserved.
  • Does not list resources, read item data/definitions, modify resources, follow returned endpoints, or poll capacity assignments. HTTP failures retain their status; messages suppress backend details and expose only validated Retry-After guidance. No automatic retries.
  • Preserves the configured credentials and the original buffered HTTP completion behavior. Reuses the inherited SendFabricHttpRequestAsync and FabricCoreHttpHelpers.GetRetryAfter; capacity operations retain their explicit headers-first behavior. Workspace-specific metadata validation and throttling/error messages are unchanged.
  • Reuses the foundation's thread-safe FabricCoreHttpMessageHandler. Renames the generic workspace service suite to WorkspaceGetServiceTests and isolates its registered-handler coverage in WorkspaceGetMcpTests, preserving every meaningful test and avoiding collisions with later layers.
  • Adds Fabric README guidance, three workspace selection prompts, and its own changelog entry. The two capacity tools, their tests/models, shared helpers, registrations, prompts, and changelog entries are retained. Relative to feat(fabric): add read-only core_list-capacities tool #3852: 21 files, 1,184 additions, 4 deletions. No new eng, shared core/authentication, fixture/proxy, dependency, or project-configuration changes.

The combined catalog contains 51 Fabric tools, with exactly these five Core names: core_create-item, core_get-capacity, core_get-workspace, core_list-capacities, and core_search-catalog.

Cumulative validation on the rebased layer

Commands were run from this owning worktree with .NET SDK 10.0.401. Offline HTTP/credential substitutions are not live Fabric or OBO evidence.

Command Result
dotnet build 'tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --no-restore --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' --no-restore --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 --no-restore --verbosity quiet Passed: 483/483, none skipped; all 365 inherited tests plus 118 workspace tests. Includes registered-handler discovery, schemas, default/compact/duplicated output, errors, cancellation, and existing-operation regressions.
dotnet build 'servers\Fabric.Mcp.Server\src\Fabric.Mcp.Server.csproj' --no-restore --nologo --verbosity quiet Passed; 0 warnings/errors.
dotnet build 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-restore --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 --no-restore --verbosity quiet Passed: 3/3 local stdio/unauthenticated HTTP startup tests.
dotnet build 'tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj' --nologo --verbosity quiet Passed; restored existing test dependencies after the initial no-restore attempt reported missing assets. No dependency/configuration changes.
dotnet test --project 'tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj' --no-build --no-restore --filter-class '*ProviderDelegatingCredentialTests' --verbosity quiet Passed: 2/2 credential-bridge tests.
& '.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe' 'tools' 'list' '--name-only' Passed; stdout parses as JSON with 51 tools and the five expected Core names.
& '.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe' 'core' 'get-workspace' '--help' Passed; required workspace UUID and optional Boolean preference are exposed.
.\eng\scripts\Test-ToolSelectionPrompts.ps1 -ServerName 'Fabric.Mcp.Server' Passed using the inherited fix and a fresh self-contained, trimmed Windows x64 publish: 51 tools, all 9 cumulative prompts valid, 1 server tested, 0 skipped, 0 violations.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath 'servers\Fabric.Mcp.Server\README.md' Package annotations passed; the same 14 pre-existing heading-level warnings remain, none on the new workspace section.
.\eng\scripts\Compile-Changelog.ps1 -ChangelogPath 'servers\Fabric.Mcp.Server\CHANGELOG.md' -DryRun Passed; all 14 cumulative Fabric entries validate; no changelog files rewritten.
git -c core.longpaths=true diff --check Passed; worktree clean after the rebase.

Changed-file formatting commands — both passed. For each command, $files was the .cs paths in that owning subtree returned by git -c core.longpaths=true diff --name-only '3e9acea71343da9f78a789d9aa3c3ca5bd52c9bc' 'HEAD', converted to Windows separators:

dotnet format 'tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --verify-no-changes --no-restore --include $files --verbosity quiet
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 $files --verbosity quiet

Spelling — passed, 21 files checked, 0 issues. $files was the complete 21-file diff against the same immediate parent; the package and npm caches were isolated to this worktree and removed afterward:

.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $files -PackageInstallCache (Join-Path $PWD '.work\workspace-stack-cspell')

The former standalone-head stderr/JSON validator failure is resolved by inherited #3854, and the actual validator now passes. Earlier failure comments refer to the old head and are not a current local failure. Native AOT publish, broad package verification, and full-repository tests were not run.

CI and coverage limits

  • New-head hosted CI is not fully verified. At the post-rebase snapshot, SpellCheck and license/CLA passed; Verify Links and event processing were queued. Azure build 6919621 showed cancelled Initialize/SDL jobs with its aggregate still queued. No all-green CI or merge approval is claimed; actual required checks remain applicable.
  • 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 authorization, service-principal/managed-identity access, and recorded playback were not exercised. The user accepted offline coverage for this scoped Fabric work. No shared Azure live/recorded infrastructure is added or awaited. Mocked credentials and local transport checks do not establish real authorization or playback.
  • The draft remains unmerged with no auto-merge or merge-queue request. The pushed layer is frozen for the coordinator to place List Workspaces above it.

Recovery: the create-only local ref refs/backup/fabric-stack-3841-20261005 retains original head b2259418147d72e3030b2a61f37af59a1894bc5c. Only the owning branch was pushed, with an explicit lease against that original SHA.

GitHub issue number?

No tracking issue was supplied or created. The contribution guide requests a linked issue; maintainer/coordinator guidance is still needed. No issue requirement exception is assumed.

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
    • 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 uses a null consolidated-tool provider; Azure mappings do not include this 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: this layer is Fabric-only.

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

Copy link
Copy Markdown
Contributor Author

Hosted CI update: Azure Pipelines build 6917992 failed in Analyze / Run source analysis at eng/scripts/Test-ToolSelectionPrompts.ps1:277. The task log confirms the same existing stdout/stderr JSON-parsing issue disclosed in the PR body: Fabric startup information is merged into the tool catalog before ConvertFrom-Json.

The preceding Azure, Fabric, and Template publish steps succeeded. Hosted SpellCheck, Verify Links, SDL analysis, npm-wrapper tests, and both musl builds have passed; other builds were still running at this snapshot. Local Core tests (141), local Fabric startup tests (3), and the independent stdout-only check of all three prompts against the 49-tool Fabric catalog passed.

The shared validator fix requires separate engineering ownership because this approved one-tool scope excludes eng, host, and shared fixture/proxy changes. The draft remains blocked by required CI; this is not a passing CI result or merge approval. Evaluator results remain explicitly pending as requested. No live Fabric, real OBO, or recorded-playback coverage is claimed.

@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-get-workspace branch from b225941 to 1e263b3 Compare October 5, 2026 21:57
@AmosHersch
Amos Hersch (AmosHersch) changed the base branch from main to amoshersch-fabric-list-capacities October 5, 2026 21:58
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-get-workspace branch 2 times, most recently from d2e7ea2 to 34d28e0 Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-get-workspace branch 2 times, most recently from b912e32 to 5d00a98 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

🟡 Changes recommended

The response model incorrectly requires an optional API field, causing valid responses to fail with a 502.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds the read-only Fabric core_get-workspace tool for retrieving workspace metadata by UUID.

Changes:

  • Adds command, service, models, registration, and serialization.
  • Adds comprehensive offline tests and MCP handler coverage.
  • Updates Fabric documentation, prompts, and changelog.
File Description
WorkspaceGetMcpTests.cs Tests registered MCP behavior.
WorkspaceTestData.cs Provides workspace test fixtures.
WorkspaceGetServiceTests.cs Tests HTTP and response handling.
tests/​.../​README.md Documents test coverage.
FabricCoreSetupTests.cs Verifies command registration.
WorkspaceGetCommandTests.cs Tests command validation and errors.
IFabricCoreService.cs Adds workspace service contract.
FabricWorkspaceThrottledException.cs Adds sanitized throttling guidance.
FabricCoreService.cs Implements Get Workspace HTTP call.
WorkspaceGetOptions.cs Defines tool inputs.
WorkspaceGetCommandResult.cs Defines command output wrapper.
FabricWorkspaceOneLakeEndpoints.cs Models OneLake endpoints.
FabricWorkspaceMetadata.cs Models workspace metadata.
FabricWorkspaceIdentity.cs Models workspace identity IDs.
FabricWorkspaceAppliedTag.cs Models applied tags.
CoreJsonContext.cs Registers source-generated JSON types.
FabricCoreSetup.cs Registers the new command.
WorkspaceGetCommand.cs Implements tool execution and errors.
servers/​Fabric.Mcp.Server/​README.md Documents tool usage and permissions.
e2eTestPrompts.md Adds tool-selection prompts.
amoshersch-fabric-core-get-workspace.yaml Adds the feature changelog entry.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Base automatically changed from amoshersch-fabric-list-capacities to main October 8, 2026 08:29
@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