Support readiness_score in MCP work item read and mutation tools

Summary

Update the GitLab MCP (Model Context Protocol) tools so that the work plan readiness score is both readable and writable. MCP consumers (Duo Chat, Duo Agent Platform, external MCP clients) can currently neither read nor set it.

Problem

Agents and MCP clients that fetch a work item have no way to know whether its agent plan is ready for execution. Without readiness_score in the MCP payload, an agent cannot apply the advisory soft-gate behaviour described in the parent epic and may start execution on an under-specified plan, wasting tokens.

Conversely, the scoring flow (#613998) needs a way to persist a computed score through MCP, so the mutation tool must accept it too.

Current state (as of planning)

The GraphQL contract already exists from #611320 (closed)readinessScore is exposed on WorkItemWidgetAgentPlan and accepted as readiness_score on WorkItemAgentPlanInput, with 0–100 model validation and workplan_score gating on both paths. The remaining work is confined to the MCP tool layer:

  • get_work_item does not request the agent plan widget at all (EE query document).
  • save_work_item exposes agent_plan but not the score, and its widget builder short-circuits on the content key, so a score-only update is silently dropped.

Proposal

Read tools

  • Add readiness_score to the work item payload returned by the MCP work item read tools (for example get_work_item), sourced from the GraphQL field.
  • Include it wherever the agent plan / work plan widget data is returned, so the score travels with the plan it describes.

Mutation tool

  • Accept readiness_score as an optional input on the work item mutation tool (save_work_item / create and update paths) and pass it through to the underlying GraphQL mutation.
  • Validate the value against the supported range (0–100) and return a clear error for out-of-range or non-numeric input.
  • Do not overwrite an existing score when the argument is omitted.

Both

  • Respect the workplan_score feature flag (#607899): omit the field on read and reject or ignore it on write when the flag is disabled.
  • Keep the field additive and optional so existing MCP clients are unaffected.

Acceptance criteria

  • readiness_score is returned by the relevant MCP work item read tool(s) when available.
  • The MCP work item mutation tool accepts and persists readiness_score on create and update.
  • The field is omitted (not zero or null-noise) when the feature flag is off or no score exists.
  • Out-of-range or invalid values on the mutation tool return a descriptive error.
  • Tool schemas and descriptions document the field, its range, and its optionality.
  • Specs cover: score present, score absent, setting a score, invalid value, feature flag disabled.
  • Documentation for the MCP tools is updated.
Edited by Naman Jagdish Gala