Skip to content

feat(fabric): add read-only core_list-items tool - #3843

Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-list-workspacesfrom
amoshersch-fabric-list-items
Closed

Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-list-workspacesfrom
amoshersch-fabric-list-items

Conversation

@AmosHersch

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

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds one read-only Fabric Core tool, core_list-items, for the List Items REST API.

Depends on #3842 (List Workspaces). This existing draft now targets amoshersch-fabric-list-workspaces at frozen parent f3bde1c0278f94841aa8b7aee3bccc2eeeb739bb; the stack's ultimate target is main. The layer is one commit, 38e5a09ecf14ba1129e666a7a5d9df3c377eadc4, across 24 files relative to that parent. Earlier layers supply the other workspace/capacity tools, shared Core foundations, and prompt-validator fix; this PR's delta adds only List Items.

  • Requires a workspace UUID; supports optional item type, root folder UUID, recursive listing (default true), and continuation token.
  • Returns exactly one page of typed inventory metadata plus both continuation fields. Metadata retains available tags, sensitivity-label ID, logical ID, and folder ID. Item types remain strings for future service compatibility.
  • Preserves the documented %3D token representation rather than double-escaping it to %253D, safely encodes raw delimiters, and retains ordinary .NET URI normalization of unreserved characters (%41 to A, %7e to ~). Output tokens remain unchanged. Never decodes Base64 or follows returned URIs.
  • Intentionally excludes DefaultIdentity: the expansion is neither requested nor serialized. Also excludes item data, definitions, workload-specific properties, writes, automatic pagination/retries, and LRO polling.
  • Validates UUIDs before authentication/HTTP, preserves HTTP failure status, and returns sanitized errors with validated Retry-After guidance.
  • Uses source-generated JSON and typed MCP output, preserving the existing identity path and prior tools' behavior.

The rebased implementation reuses FabricCoreService.SendFabricHttpRequestAsync with its existing buffered ResponseContentRead default and named cancellation argument, plus FabricCoreHttpHelpers.GetRetryAfter / EncodeContinuationToken. It keeps the List Items-specific throttled exception and status/message contract. No duplicated send helper or legacy create/search changes.

Offline tests reuse FabricCoreHttpMessageHandler; item-specific service and registered-handler tests now live in ItemListServiceTests and ItemListMcpTests. Every original item test case/assertion is retained, with one added unreserved-URI-normalization case. Cumulative registration assertions, lower-layer documentation/prompts, and the five default/all-mode host tests are preserved. No production host/authentication, shared framework, engineering-script, dependency, or project-configuration changes are introduced by this layer.

Verification rerun on the combined branch

Commands ran from the repository root against the rebased head. 756 tests passed, zero failed/skipped: 749 Core, five Fabric host, two credential-delegation tests.

Command Result
dotnet build tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj --nologo --verbosity quiet Passed; zero 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; zero warnings/errors.
dotnet build servers\Fabric.Mcp.Server\src\Fabric.Mcp.Server.csproj --nologo --verbosity quiet Passed; zero warnings/errors.
dotnet test --project tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --no-build --filter-not-trait "TestType=Live" --no-progress Passed; 749 tests.
dotnet test --project servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --filter-not-trait "TestType=Live" --no-progress Passed; five tests, retaining default/all-mode stdio/loopback HTTP discovery and legacy initialization.
dotnet test --project tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj --filter-class "Fabric.Mcp.Tools.DataFactory.Tests.ProviderDelegatingCredentialTests" --no-progress Passed; two offline delegation tests.
dotnet format tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj --verify-no-changes --no-restore --verbosity quiet Passed.
dotnet format tools\Fabric.Mcp.Tools.Core\tests\Fabric.Mcp.Tools.Core.Tests\Fabric.Mcp.Tools.Core.Tests.csproj --verify-no-changes --no-restore --verbosity quiet Passed.
dotnet format servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj --verify-no-changes --no-restore --verbosity quiet Passed; complete project, not only changed files.
git --no-pager diff --name-only f3bde1c0278f94841aa8b7aee3bccc2eeeb739bb...HEAD -- | ForEach-Object { $_.Replace('/', '\') } | .\eng\common\spelling\Invoke-Cspell.ps1 -PackageInstallCache .work\fabric-stack-3843-cspell Passed; 24 layer files, zero issues. Task-specific cache removed.
.\eng\scripts\Process-PackageReadMe.ps1 -Command validate -InputReadMePath servers\Fabric.Mcp.Server\README.md Completed with the same 14 heading-level warnings as the separately validated frozen-parent README; no new warnings.
.\eng\scripts\Test-ToolSelectionPrompts.ps1 -ServerName Fabric.Mcp.Server -OutputPath .work\fabric-stack-3843-validation Passed with freshly built artifacts: scoped trimmed publish succeeded, 53 tools loaded, one server tested, zero skipped, zero violations.
.\.work\fabric-stack-3843-validation\Fabric.Mcp.Server\windows-x64\fabmcp.exe tools list --name-only Passed; exact comparison confirmed 53 total Fabric tools, seven Core tools, and all 17 cumulative prompt rows reference registered tools.
Fresh trimmed fabmcp.exe server start --mode all --namespace core --structured-output-mode compact --disable-proxy-tools, with local tools/list and malformed-UUID tools/call requests Passed; seven Core tools, List Items input/output schema and annotations, no DefaultIdentity/definition in schema, and local status-400 validation before any Fabric call.

The exact Core set is core_create-item, core_search-catalog, core_get-capacity, core_list-capacities, core_get-workspace, core_list-workspaces, and core_list-items.

The earlier prompt-validator stderr/JSON failure is no longer current: the fix inherited through #3854 passes on this combined branch. No additional engineering-script fix was made here.

Explicit validation boundaries and current CI

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 requests, real OBO token exchange/authorization, and recorded playback were not exercised. Offline substitutions do not establish real service behavior, tenant isolation, or RBAC enforcement. The user scoped Fabric live/recorded infrastructure and real-service/OBO evidence out of this tool PR's gates; no such infrastructure, deployments, credentials, or shared Azure host/proxy changes are added or awaited.

Broad NPX packaging and native AOT publication were not rerun for this rebase, as requested. Their earlier results apply only to original head 4dd8b885de889e4ecb8204df29e793767eb0f620, not this combined branch. The current checks include the fresh trimmed publish invoked by the prompt validator. The historical Build-Local.ps1 -VerifyNpx cache-clear failure is not relabeled as a pass.

At the post-retarget CI snapshot for 38e5a09ecf14ba1129e666a7a5d9df3c377eadc4, SpellCheck, license/CLA, and the agentless tag check passed; ADO initialization/source-analysis checks were cancelled, while the overall ADO check and remaining GitHub checks were queued. Required hosted CI is not complete or claimed green. Maintainer review and actual required CI still apply.

Rebase safety

The original single-tool slice was rebased onto the exact frozen parent, without importing later main changes. Local create-only recovery ref refs/backup/fabric-stack-3843-20261005 retains original head 4dd8b885de889e4ecb8204df29e793767eb0f620. Publication used an explicit lease against that original remote head, followed by verification of the same PR/branch, exact new head/base, draft status, no auto-merge/queue, and empty native stack membership. No PR replacement, merge, closure, or native stack registration was performed.

GitHub issue number?

No linked tracking issue was provided for this approved single-tool change. No issue was created implicitly.

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

The consolidated mapping, rename checklist, and Azure MCP-specific items above are not applicable: this layer adds one Fabric tool, renames none, and the Fabric host uses NullConsolidatedToolDefinitionProvider. Four List Items prompts are appended to the inherited Fabric prompts rather than replacing them.

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) changed the base branch from main to amoshersch-fabric-list-workspaces October 5, 2026 22:26
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-items branch 2 times, most recently from 9c44ba1 to 94040f4 Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-list-items branch 2 times, most recently from 9f2a58b to 7b763d7 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

The supplied validation evidence leaves required hosted CI and final maintainer review of the stacked change outstanding.

Review effort: Balanced
Findings: None

What changed in this PR

Adds read-only core_list-items to Fabric Core, building on the List Workspaces dependency to support workspace and folder inventory.

Changes:

  • Adds single-page listing with optional filters, typed metadata, and continuation information.
  • Preserves shared authentication and HTTP handling, with input validation and sanitized errors.
  • Adds offline tests, discovery assertions, documentation, prompts, and a changelog entry.
File Description
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​WorkspaceListToolRegistrationTests.cs Updates cumulative discovery expectations.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​ItemListTestData.cs Adds shared item-list fixtures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​TestSupport/​CancellationHttpContent.cs Supports cancellation testing.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​Services/​ItemListServiceTests.cs Tests requests, pagination, validation, and failures.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​README.md Documents coverage and validation boundaries.
tools/​Fabric.Mcp.Tools.Core/​tests/​Fabric.Mcp.Tools.Core.Tests/​ItemListMcpTests.cs Tests registered tool schemas and calls.
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/​ItemListCommandTests.cs Tests options, results, and error mapping.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​IFabricCoreService.cs Defines the listing service contract.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​FabricItemListThrottledException.cs Provides validated throttling guidance.
tools/​Fabric.Mcp.Tools.Core/​src/​Services/​FabricCoreService.cs Implements single-page item retrieval.
tools/​Fabric.Mcp.Tools.Core/​src/​Options/​ItemListOptions.cs Defines workspace and filter inputs.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​ItemListResponse.cs Models the REST response page.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​ItemListCommandResult.cs Models typed tool output.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​FabricItemTag.cs Models item tags.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​FabricItemSummary.cs Defines permitted inventory metadata.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​FabricItemSensitivityLabel.cs Models sensitivity-label metadata.
tools/​Fabric.Mcp.Tools.Core/​src/​Models/​CoreJsonContext.cs Registers source-generated serialization.
tools/​Fabric.Mcp.Tools.Core/​src/​FabricCoreSetup.cs Registers and advertises the tool.
tools/​Fabric.Mcp.Tools.Core/​src/​Commands/​ItemListCommand.cs Implements validation and command handling.
servers/​Fabric.Mcp.Server/​tests/​Fabric.Mcp.Server.Tests/​Infrastructure/​ServerStartupTests.cs Checks discovery and parses event-stream responses.
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-items.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.

Add paginated workspace and folder inventory with typed metadata, safe continuation encoding, and sanitized failures. Cover the command, service, MCP pipeline, and local discovery without live Fabric requests.

Co-authored-by: Copilot App <[email protected]>
@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