Skip to content

MCP: upgrade the 17 bare-object outputSchemas to typed (lib-type derives + typed cores + bespoke output structs) #2203

Closed

Description

@jamie8johnson

From the #2125 lane. tools/list now publishes an outputSchema for all 34 tools, but 17 are honest-but-loose bare-object schemas because their outputs aren't derivable types today:

  • DEEP-blocked (a): impact/review/ci/plan need schemars::JsonSchema on lib types (src/impact/types.rs, src/review.rs, src/ci.rs, src/plan.rs, src/scout.rs); ImpactCoreOutput has a hand-written to_value() a derive wouldn't reproduce → needs a manual JsonSchema impl.
  • Untyped cores (b): scout/onboard/task/context/blame/read/impact-diff/health return serde_json::Value (or lib types like HealthReport) — cores need typed outputs first.
  • Bespoke shapes (c): search ({results,query,total}) + the 3 notes mutators (NoteMutationOutput + injected reindex_deferred) want small dedicated output structs.

Each row-flip is then localized (object → typed(T) in command_output_map!). Related sub-item: the typed schemas with Vec<serde_json::Value> fields (gather.chunks, similar.results, trace.candidates, KindFallbackOutput.definitions) are loose "any" arrays until the chunk/SearchResult shape is typed — same follow-up.

Activity

  1. jamie8johnson commented on Jul 3, 2026

    @jamie8johnson
    OwnerAuthor

    Part 1 landed (PR #2209): 13 of 17 typed. Outcome table:

    Command Result Notes
    search, impact, blame, ci, review, plan, read, impact-diff, health, notes-add/update/remove, index typed impact = hand-written JsonSchema matching to_value's real wire shape (oneOf function/fallback, injected kind), shape-truth-pinned
    scout, task, onboard, context object (remaining) injection-composite: shared helpers layer content/injection_flags/token_count onto serialized results — a manual schema would duplicate that contract and drift

    Remaining tail (this issue stays open for):

    1. The injection-composite four — either manual JsonSchema impls describing base-struct + injected fields (into nested chunk entries), or refactor the injection helpers to emit typed output; context additionally needs an untagged 3-shape (compact/summary/full).
    2. The loose inner Vec<Value> "any" arrays (search.results, gather.chunks, similar.results, trace.candidates, KindFallbackOutput.definitions, scout/onboard nested chunks) — needs schema-only descriptor types for the per-result/chunk projections.

    No wire shape changed in part 1 (byte-identity held by the noise guard + envelope pins + parity suites).

  2. added a commit that references this issue on Jul 3, 2026
    c2ebef8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions