Skip to content

feat(fabric): add core_update-item tool - #3849

Closed
Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-update-workspacefrom
amoshersch-fabric-update-item
Closed

Amos Hersch (AmosHersch) wants to merge 1 commit into
amoshersch-fabric-update-workspacefrom
amoshersch-fabric-update-item

Conversation

@AmosHersch

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

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds exactly one Fabric Core tool, core_update-item (fabmcp core update-item), implementing the synchronous Update Item REST API.

Depends directly on #3851, Update Workspace; the ultimate target remains main. The immediate base is amoshersch-fabric-update-workspace. This PR is ready for review and belongs to native stack 3860. GitHub's current head/base refs identify the revision under review. The validation and recovery details below document historical snapshots from the original stack adaptation, not the current commit IDs or readiness state.

  • Requires nonempty workspace/item UUIDs and at least one optional display-name or description. Validation runs before credentials or HTTP. IDs are normalized before URL construction.
  • Sends only supplied displayName/description properties. Omission/null preserves existing values; an explicitly empty description clears it. Descriptions are limited to 256 characters. Display names must not be empty/whitespace; item-type naming rules remain service-defined, without an invented universal length limit.
  • Makes one application-level PATCH, accepting the documented synchronous 200 response. No tool-implemented retries, prefetch, name resolution, follow-up requests, enrichment, definition payload, or LRO polling. Existing HTTP-client redirect behavior is unchanged: this is not a one-wire-hop guarantee.
  • Returns source-generated, typed { item: ... } metadata: ID, display name, type, workspace ID, and optional description. Both returned IDs must match the request. Definitions, data, permissions, tags, identity, and workload-specific properties are excluded. Invalid/incomplete responses fail explicitly rather than returning an empty success.
  • Uses mutating/destructive/idempotent annotations, existing consent/read-only enforcement, cancellation propagation, disposal, sanitized status-preserving errors, and validated nonnegative integer Retry-After seconds. The original uncertain-update warnings and error messages are preserved.
  • Requires item read/write permission. Delegated callers need Item.ReadWrite.All or the corresponding item-specific scope; service-principal/managed-identity support depends on item type. The host provider -> DataFactory per-request delegating credential -> Core typed-client DI bridge is unchanged.

Adaptation to the shared foundation

Uses #3855's private SendFabricHttpRequestAsync, explicitly retaining ResponseHeadersRead and named cancellationToken:. The single shared send and legacy create/search wrapper remain intact; no duplicate authentication/send helper is added. GetUpdateRetryAfterSeconds projects only Delta values in 0..int.MaxValue from FabricCoreHttpHelpers.GetRetryAfter: dates remain ignored and header support/error wording are not widened. Nine added boundary cases cover normalization, signs, overflow, empty values, and past dates.

Tests reuse thread-safe FabricCoreHttpMessageHandler.CallCount instead of a copied handler, while retaining ItemUpdateCancellationStream and every operation-specific case. The original command, options, validator, request/result/metadata models, exception, and specialized cancellation stream are byte-for-byte unchanged. Update Item output stays deliberately separate from List Items' richer whitelist.

All lower-layer operations, tests, docs, prompts, and changelog entries are retained. Cumulative setup/discovery assertions are extended, not relaxed. Read-only discovery excludes every mutating Core tool. The named WorkspaceGetMcpTests, WorkspaceGetServiceTests, ItemListMcpTests, and ItemListServiceTests files are unchanged; all five inherited host cases remain.

The lower chain includes #3854's stdout/stderr validator fix. This layer adds no engineering, shared framework, production host/proxy, authentication, project, dependency, or live/recording infrastructure changes. Only host discovery-test assertions are extended for the new tool.

GitHub issue number?

N/A — this tool and in-place reorganization were requested directly. No tracking issue was supplied or 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

Azure-only checklist items and consolidated mappings are not applicable: Fabric registers NullConsolidatedToolDefinitionProvider. No tool was renamed. Fabric-specific prompts are included instead; no live-test pipeline was invoked.

Historical validation after stack adaptation

Recorded for head a92fad0120739d227ab2aa867ec4c6d5fb4a9390 on base 946865bd09d184929650ed3c8ee6eb54b6144cf9, before subsequent stack rebases. These are the original commands and results, not a fresh run on the current PR revision.

.NET SDK 10.0.401. 1,206 focused offline tests passed, zero failed/skipped: 1,199 Core, five host, and two credential-bridge cases. All 1,049 parent Core cases remain, with 150 Update Item cases including nine new Retry-After boundary cases. Discovery contains 10 Core tools / 56 total Fabric tools. All 28 prompt rows match the catalog, including the 25 inherited rows retained unchanged.

Command Result
dotnet build 'tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --no-restore --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' --no-restore --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 --no-restore --no-progress Passed: 1,199 tests, none skipped.
dotnet build 'servers\Fabric.Mcp.Server\src\Fabric.Mcp.Server.csproj' --no-restore --nologo --verbosity quiet Passed; zero warnings/errors.
dotnet build 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --nologo --verbosity quiet Passed; zero warnings/errors. Restored existing dependencies after the initial no-restore attempt reported missing assets.
dotnet test --project 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-build --no-restore --no-progress Passed: all five inherited stdio/loopback HTTP startup/discovery cases. No Fabric API operations.
dotnet build 'tools\Fabric.Mcp.Tools.DataFactory\tests\Fabric.Mcp.Tools.DataFactory.Tests\Fabric.Mcp.Tools.DataFactory.Tests.csproj' --nologo --verbosity quiet Passed; zero warnings/errors. Restored missing test assets after the initial no-restore invocation could not resolve the MTP runner. No project or runner configuration changed.
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' --no-progress Passed: two existing offline credential-delegation cases.
dotnet format 'tools\Fabric.Mcp.Tools.Core\src\Fabric.Mcp.Tools.Core.csproj' --verify-no-changes --no-restore --include $source --verbosity quiet Passed for all 11 layer 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 all nine layer Core test C# files.
dotnet format 'servers\Fabric.Mcp.Server\tests\Fabric.Mcp.Server.Tests\Fabric.Mcp.Server.Tests.csproj' --no-restore --verify-no-changes --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 25 layer files, zero spelling issues; isolated cache removed.
.\eng\scripts\Process-PackageReadMe.ps1 -Command 'validate' -InputReadMePath 'servers\Fabric.Mcp.Server\README.md' Exited zero with the same 14 existing heading-level warnings; heading structure is unchanged from the frozen parent.
.\eng\scripts\Compile-Changelog.ps1 -ChangelogPath 'servers\Fabric.Mcp.Server\CHANGELOG.md' -DryRun Passed: all 19 cumulative entries validated; compiled logs were not rewritten.
& '.\servers\Fabric.Mcp.Server\src\bin\Debug\fabmcp.exe' 'tools' 'list' '--name-only' Passed with stdout/stderr separated: 10 exact Core names, 56 total tools, and all 28 prompt rows matched. All 25 inherited rows are unchanged.
& '.\eng\scripts\Test-ToolSelectionPrompts.ps1' -ServerName 'Fabric.Mcp.Server' -OutputPath $output Passed on a fresh current-commit self-contained, trimmed Debug win-x64 publication: 56 tools loaded, one server tested, zero skipped, zero violations.
git --no-pager diff --check '946865bd09d184929650ed3c8ee6eb54b6144cf9..HEAD' -- Passed.

$source, $tests, and $paths were explicit layer-relative file arrays; formatting included all corresponding C# files. $cache was an isolated session-local spelling directory, cleaned by the script. $output was Join-Path $PWD '.work\stack-3849-prompt-build', verified absent before the fresh validator build. Git long-path support was process-local, not a repository/global configuration change.

Coverage retains omitted/null/empty/whitespace descriptions, exact request keys, 256/257-character boundaries, unsupported arguments, validation before I/O, permission/status errors, invalid/missing/mismatched response metadata, cancellation during credentials/HTTP/deserialization, disposal, concurrent request isolation, existing create/search regressions, registered schemas, legacy/compact/duplicated output, and read-only exclusion/rejection. The read-only checks exclude create-item, create-workspace, update-workspace, and update-item without changing any existing assertion.

The former stderr/JSON prompt-validator failure is resolved by inherited #3854; the actual script now passes here. This is catalog-name validation, not a ToolDescriptionEvaluator score. No engineering workaround or additional script change is included in this layer.

Historical recovery and publication

The create-only local recovery ref refs/backup/fabric-stack-3849-20261005 retains original head 469f14c23e244b04d42cb28f6328c7b308068327. Only its verified single tool commit after historical fork d4df988aae3ba1de008efe10f664f12817bdcc24 was rebased onto the exact frozen Update Workspace tip. Publication used only the explicit lease --force-with-lease=refs/heads/amoshersch-fabric-update-item:469f14c23e244b04d42cb28f6328c7b308068327 and the owning branch refspec.

Own/lower PR states, refs, locks, auto-merge/merge-queue absence, and empty filtered native-stack membership were revalidated before publication/retargeting and verified afterward. The same PR number/branch remain. No lower refs were mutated. GitHub refreshed the old main-based PR metadata to 0fa879ecf7c51946fa17e73304e468558c351b6c; that was recorded as observation only, not imported or used as the rebase target.

Explicit validation boundaries

  • 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 operations, real item mutations, real OBO/service-principal/managed-identity authorization, and recorded playback: not exercised. All update API requests use substituted HTTP and credentials. No live/recording infrastructure was added or awaited. Handler/startup tests do not establish real-service permission enforcement or playback.
  • Full-repository suites, package/NPX verification, and native publishing were not run. The fresh prompt-validator publication is trimmed/self-contained, not native AOT. No PowerShell, project, or dependency files change relative to the immediate parent.
  • Historical hosted-CI snapshot from the original adaptation (not current status): The recorded snapshot showed successful policy automation, SpellCheck, Verify Links, CLA, and SDL agentless-tag checks. Azure build 6920249 has cancelled Initialize and SDL Sources Analysis stages while the aggregate mcp - pullrequest check remained queued. No CI retry or live pipeline was requested. Actual required CI and human review remain applicable.
  • Current review state: Ready for review in native stack 3860. No auto-merge or merge queue is enabled; marking ready did not merge or close this PR.

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-update-item branch from 469f14c to a92fad0 Compare October 5, 2026 23:49
@AmosHersch
Amos Hersch (AmosHersch) changed the base branch from main to amoshersch-fabric-update-workspace October 5, 2026 23:49
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-update-item branch 2 times, most recently from e30a385 to 873b645 Compare October 6, 2026 12:28
@AmosHersch
Amos Hersch (AmosHersch) force-pushed the amoshersch-fabric-update-item branch 2 times, most recently from 68e8c27 to 6101a0c 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 PR description’s head/base SHAs and draft status no longer match the current GitHub state.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds the Fabric Core core_update-item tool for synchronous item metadata updates.

Changes:

  • Adds validated PATCH handling, typed output, and sanitized errors.
  • Registers and documents the new tool.
  • Adds comprehensive offline tests.
File Description
WorkspaceUpdateToolRegistrationTests.cs Extends read-only assertions.
WorkspaceCreateToolRegistrationTests.cs Updates expected catalog.
TestSupport/​ItemUpdateTestData.cs Adds shared fixtures.
TestSupport/​ItemUpdateCancellationStream.cs Adds cancellation fixture.
Services/​FabricCoreServiceItemUpdateTests.cs Tests service behavior.
tests/​README.md Documents test coverage.
Models/​ItemUpdateSerializationTests.cs Tests serialization.
ItemUpdateToolRegistrationTests.cs Tests MCP registration.
FabricCoreSetupTests.cs Verifies setup registration.
Commands/​ItemUpdateCommandTests.cs Tests command behavior.
Validation/​ItemUpdateInputValidator.cs Validates update inputs.
Services/​ItemUpdateRequestException.cs Represents HTTP failures.
Services/​IFabricCoreService.cs Adds update contract.
Services/​FabricCoreService.cs Implements PATCH operation.
Options/​ItemUpdateOptions.cs Defines tool options.
Models/​UpdateItemRequest.cs Defines request payload.
Models/​ItemUpdateMetadata.cs Defines response metadata.
Models/​ItemUpdateCommandResult.cs Defines tool result.
Models/​CoreJsonContext.cs Registers serialization types.
FabricCoreSetup.cs Registers the command.
Commands/​ItemUpdateCommand.cs Implements tool behavior.
ServerStartupTests.cs Updates discovery assertions.
Fabric.Mcp.Server/​README.md Documents the tool.
docs/​e2eTestPrompts.md Adds selection prompts.
changelog-entries/​amoshersch-fabric-core-update-item.yaml Records the feature.

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

Add validated metadata-only item updates with omitted and empty description semantics, source-generated output, and offline command/service/MCP coverage.

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