Skip to content

feat(fabric): add read-only core_list-capacities tool - #3852

Merged
Amos Hersch (AmosHersch) merged 1 commit into
mainfrom
amoshersch-fabric-list-capacities
Oct 8, 2026
Merged

Amos Hersch (AmosHersch) merged 1 commit into
mainfrom
amoshersch-fabric-list-capacities

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_list-capacities (fabmcp core list-capacities), as the next layer above Get Capacity #3846. The immediate base is amoshersch-fabric-get-capacity at 3fe213e152d26da952e28160f7bbfdfbd0390dd7; the ultimate base is main. The existing PR number and branch are preserved.

This layer is one commit, 3e9acea71343da9f78a789d9aa3c3ca5bd52c9bc, with 20 changed files relative to Get Capacity. The shared foundation from #3855, its inherited catalog-stream fix from #3854, and Get Capacity implementation/tests are retained unchanged.

  • Implements the List Capacities REST API. Accepts only an optional continuation token and returns exactly one page of typed capacities plus continuationToken and continuationUri when supplied. Capacity entries expose ID, display name, SKU, region, and state; future string values remain supported.
  • Reuses the foundation's SendFabricHttpRequestAsync with explicit ResponseHeadersRead and named cancellation, FabricCoreHttpHelpers.EncodeContinuationToken, FabricCoreHttpHelpers.GetRetryAfter, shared FabricCapacityMetadata.IsValid, and FabricCoreHttpMessageHandler. There is no duplicate encoder, capacity DTO/context entry, authenticated-send implementation, or list-specific counting-handler copy.
  • Preserves the documented pagination query meaning without double-encoding %3D. Raw delimiters, invalid percent sequences, and literal + are safely encoded. Normal URI canonicalization stays enabled (%41%7e%2D%5f%2E becomes A~-_. on the wire); returned continuation strings remain unchanged. No Base64 decoding or returned-URI following.
  • Keeps the original public list options, source-generated output, permissions, metadata, error messages/statuses, operation-specific CapacityListThrottledException, cancellation, and disposal behavior. Exact file comparisons against the original recovery snapshot confirm the command/options/result/page/exception contract is unchanged.
  • Preserves the host credential path through IAzureTokenCredentialProvider, DataFactory's ProviderDelegatingCredential, and injected TokenCredential. Existing create/search behavior and inherited Get Capacity/foundation tests remain intact.
  • Composes command registration, service interface, JSON context, README guidance, prompts, and setup counters cumulatively. Adds only List Capacities above the parent; cumulative Core tools are exactly core_create-item, core_get-capacity, core_list-capacities, and core_search-catalog.

No ARM subscription parameters, invented page size, fetch-all, automatic retries, mutations, LROs, authentication redesign, project/dependency changes, or new engineering changes. No lower refs or native stack metadata were changed.

Cumulative local validation

Re-run on the combined branch at 3e9acea71343da9f78a789d9aa3c3ca5bd52c9bc using the repository's .NET SDK 10.0.401 configuration. 370 focused tests passed, zero failed/skipped: 365 Core tests, 3 existing Fabric startup/discovery tests, and 2 existing credential-delegation tests.

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 --no-progress Passed: 365 tests, including all inherited Get Capacity, foundation, and create/search coverage.
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. Also builds the Fabric host.
dotnet test --project servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --no-build --no-restore --filter-class '*ServerStartupTests' --no-progress Passed: 3 local stdio/HTTP startup and discovery tests.
dotnet test --project tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj --no-restore --filter-class '*ProviderDelegatingCredentialTests' --no-progress Passed: 2 existing offline credential-bridge tests.
.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe tools list --name-only Passed: 50 tools, with the exact four-tool Core catalog asserted. Startup stderr remained separate from JSON.
.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe core list-capacities --help Passed; optional continuation-token contract preserved.
.\eng\scripts\New-BuildInfo.ps1 -ServerName Fabric.Mcp.Server -PublishTarget none -BuildId 12345 Passed; generated Fabric-only local build metadata.
dotnet build servers\Fabric.Mcp.Server\src\Fabric.Mcp.Server.csproj --no-restore --nologo --verbosity quiet --output .work\capacity-stack-catalog\Fabric.Mcp.Server\windows-x64 Passed; 0 warnings/errors. Built this branch's Debug artifacts in the validator's expected layout, without package/native publication.
.\eng\scripts\Test-ToolSelectionPrompts.ps1 -ServerName Fabric.Mcp.Server -SkipServerBuild -OutputPath .work\capacity-stack-catalog Passed: 50 tools loaded, 1 server tested, 0 skipped, 0 violations. The inherited stream fix correctly kept real DataFactory stderr diagnostics out of catalog JSON.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath servers\Fabric.Mcp.Server\README.md Exited 0 with the same 14 pre-existing heading-level warnings.
.\eng\scripts\Compile-Changelog.ps1 -ChangelogPath servers\Fabric.Mcp.Server\CHANGELOG.md -DryRun Passed schema validation for all 13 cumulative Fabric entries; no compiled changelog rewritten.
git diff --check 3fe213e152d26da952e28160f7bbfdfbd0390dd7 HEAD Passed.

Formatting passed for all 16 layer C# files (9 source, 7 test):

$files = @(git -c core.longpaths=true diff --name-only '3fe213e152d26da952e28160f7bbfdfbd0390dd7' 'HEAD' -- '*.cs' | ForEach-Object { $_.Replace('/', '\') })
$source = @($files | Where-Object { $_.StartsWith('tools\Fabric.Mcp.Tools.Core\src\') })
$tests = @($files | Where-Object { $_.StartsWith('tools\Fabric.Mcp.Tools.Core\tests\') })
dotnet format tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj --no-restore --verify-no-changes --include $source --verbosity quiet
dotnet format tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --no-restore --verify-no-changes --include $tests --verbosity quiet

Spelling passed for all 20 layer files, with 0 issues:

$paths = @(git -c core.longpaths=true diff --name-only '3fe213e152d26da952e28160f7bbfdfbd0390dd7' 'HEAD' | ForEach-Object { $_.Replace('/', '\') })
.\eng\common\spelling\Invoke-Cspell.ps1 -FileList $paths -PackageInstallCache $cache

$cache was an isolated session-local tooling directory, removed by the spelling script. Temporary validator artifacts and the generated build metadata were also removed after validation. Exact comparisons confirmed that inherited engineering files, shared capacity/HTTP foundations, and Get Capacity implementation/tests were not changed by this layer.

List coverage retains documented token/URI pairs, first/continuation/final/empty pages, independent continuation fields, reserved/raw/invalid percent sequences, normal unreserved normalization, literal plus, Unicode, injection attempts, one HTTP send per valid invocation, forward-compatible metadata, malformed payload rejection, safe status/Retry-After behavior, cancellation/disposal, concurrent credential isolation, and legacy/compact/duplicated MCP output.

Explicit coverage limits

  • 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, real OBO token exchange/authorization, service-principal/managed-identity access, and recorded playback: unexercised. The user excluded adding or awaiting Fabric live/recorded infrastructure and real-service validation for this scoped work. Offline doubles, registered handlers, and local discovery do not establish those guarantees.
  • The inherited shared prompt validator now passes locally on this combined branch. Its engineering implementation is unchanged in this layer. This is not a ToolDescriptionEvaluator score or a claim that other lower-layer checks were rerun.
  • Full repository suites, package/NPX verification, and native publication were not run. Actual required hosted CI and human review still apply. This remains a draft, with no auto-merge or merge request.

GitHub issue number?

No tracking issue was supplied or created for this directly requested tool and its authorized conflict-prevention reorganization.

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
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • 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:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 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.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Azure-only command/consolidation steps and the rename checklist are not applicable: this adds one Fabric tool above its declared parent, no existing tool is renamed, and Fabric uses NullConsolidatedToolDefinitionProvider. Fabric-specific prompts are composed with the parent's prompts. No live-test pipeline was invoked.

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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
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-capacities branch from dcc06ab to 3e9acea Compare October 5, 2026 21:33
@AmosHersch
Amos Hersch (AmosHersch) changed the base branch from main to amoshersch-fabric-get-capacity October 5, 2026 21:40
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-capacities branch 2 times, most recently from bdbb08d to 589127e Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-capacities branch from 589127e to 2d4c46b Compare October 7, 2026 08:04
Base automatically changed from amoshersch-fabric-get-capacity to main October 7, 2026 11:49
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-capacities branch from 2d4c46b to 470a840 Compare October 7, 2026 11:49
@AmosHersch
Amos Hersch (AmosHersch) marked this pull request as ready for review October 7, 2026 12:48
@AmosHersch
Amos Hersch (AmosHersch) requested a review from a team as a code owner October 7, 2026 12:48
Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:48

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 new Interaction values are parsed into evaluation prompts, altering the requests being tested.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds read-only core_list-capacities above the existing Get Capacity tool, reusing shared Fabric HTTP and capacity infrastructure.

Changes:

  • Returns one typed page with optional continuation information.
  • Adds command registration, serialization, and sanitized error handling.
  • Adds offline tests, documentation, selection prompts, and a changelog entry.
File Description
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​CapacityListTestData.cs Shared test fixtures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​CapacityListCancellationStream.cs Cancellation test stream.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​FabricCoreServiceCapacityListTests.cs HTTP and pagination coverage.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​README.md Coverage and execution guidance.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Models/​CapacityListSerializationTests.cs Typed output serialization tests.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​FabricCoreSetupTests.cs Registration assertions.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Commands/​CapacityListCommandTests.cs Command contract tests.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​CapacityListToolRegistrationTests.cs MCP schema and output tests.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​IFabricCoreService.cs Listing service contract.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​FabricCoreService.cs Single-page HTTP implementation.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​CapacityListThrottledException.cs Validated retry guidance.
tools/​Fabric.Mcp.Tools.Core/​src/​Options/​CapacityListOptions.cs Optional continuation token.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​CoreJsonContext.cs Source-generated serialization registrations.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​CapacityListResponse.cs API page model.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​CapacityListCommandResult.cs Tool output model.
tools/​Fabric.Mcp.Tools.Core/​src/​FabricCoreSetup.cs Tool registration and discovery.
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​CapacityListCommand.cs Read-only command implementation.
servers/​Fabric.Mcp.Server/​README.md Usage and permissions guidance.
servers/​Fabric.Mcp.Server/​docs/​e2eTestPrompts.md Tool-selection prompts.
servers/​Fabric.Mcp.Server/​changelog-entries/​amoshersch-fabric-core-list-capacities.yaml Feature release entry.

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

@AmosHersch
Amos Hersch (AmosHersch) merged commit 6ee48e6 into main Oct 8, 2026
23 checks passed
@AmosHersch
Amos Hersch (AmosHersch) deleted the amoshersch-fabric-list-capacities branch October 8, 2026 08:29
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