Skip to content

feat(repos): complete typed repository tool outputs - #3392

Draft
SamMorrowDrums wants to merge 2 commits into
sammorrowdrums-type-core-issue-toolsfrom
sammorrowdrums-typed-repository-tools
Draft

SamMorrowDrums wants to merge 2 commits into
sammorrowdrums-type-core-issue-toolsfrom
sammorrowdrums-typed-repository-tools

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Summary

Complete the remaining 17 typed MCP tools in pkg/github/repositories.go, using the existing protocol-gated NewTool[In, Out] foundation. Modern clients receive concrete output schemas and structured content; legacy/unknown clients retain their original content without output schemas or structured content.

Why

Continue the file-focused typed-tool migration, stacked on #3391. No issue is closed by this slice.
Fixes # N/A

Exact parent/base: 7b0c05e0eae079b0a973d44ea73f6244a491b2a0 (sammorrowdrums-type-core-issue-tools), based on repository layer 4b6686b5fc361a702e50d7e37a55870e49da6900. The original parent 01770e05065e86a964af3bc7834ebded7f03ed1e and original repository ancestor 79f584df3f05c756e97904016e70985731fb6f77 were verified before edits; the refreshed parent was synchronized safely before final validation.
Exact slice head: 7e864d1e6c4eaadc2050c9d7d973d123471e4ea8.

What changed

  • Concrete inputs/outputs for create_or_update_file, create_repository, delete_repository, get_file_contents, fork_repository, delete_file, create_branch, push_files, get_tag, list_releases, get_latest_release, get_release_by_tag, list_starred_repositories, star_repository, unstar_repository, get_file_blame, and list_repository_collaborators.
  • Preserve the existing get_commit, list_commits, list_branches, and list_tags migrations. Retain scopes, workflow challenges, feature gates, IFC labeling, sanitization, field filtering, deletion confirmation, and mutation behavior.
  • Infer honest SDK schemas from real concrete API DTOs; timestamp and recursive Git/user/team types use precise inferred definitions and references, not opaque maps. Strict unions cover tag references/annotated tags, fork references/in-progress messages, and directory/content responses. Null union states support SDK error serialization; tool errors do not expose structured output.
  • Preserve file status text and multiple MCP content blocks. File/resource/blob/link and metadata-only responses are represented by a typed content array; directory projections remain structured arrays. Text-only mutations use a structured message matching the actual status response.
  • Add modern/legacy/unknown wire tests, all 17 negotiated schemas, strict union rejection, realistic release/commit objects, byte-exact content-block comparisons, empty file/directory/range outputs, pagination coercion/defaults, projections, API/domain errors, mutation request assertions, and deletion confirmation coverage.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Output schemas and typed structuredContent are exposed only for protocol 2026-07-28 and newer. Existing content remains unchanged; legacy/unknown protocol clients receive neither output schemas nor structured content.

Prompts tested (tool changes only)

  • Automated wire equivalents: "Create a private repository; create a file and branch; push an empty file; delete a file; star/unstar a repository."
  • Automated wire equivalents: "Read text, binary, empty, large, symlink, submodule, and directory paths; project directory fields; resolve a missing path."
  • Automated wire equivalents: "Get lightweight/annotated tags; list releases with numeric-string and zero/default pagination; project release fields; get a release by tag."
  • Automated wire equivalents: "Page file blame and collaborators; confirm repository deletion." No live GitHub mutations were performed.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Existing scopes, workflow-scope challenges, IFC labels, sanitization, field projections, 1 MiB resource-link behavior, blame limits, and repository deletion confirmation remain in place. Structured file output mirrors the already-returned content; it does not fetch additional data or bypass permissions.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint

  • Tested locally with ./script/test

  • UPDATE_TOOLSNAPS=true go test ./... — passed; all intended raw/negotiated output schemas snapshotted.

  • script/lint — passed.

  • script/test — passed (go test -race ./...).

  • script/generate-docs — passed.

  • git diff --check — passed.

The required lint → race tests → documentation ordering was run on the refreshed exact parent. E2E tests requiring a live GitHub PAT were not run. CI will be inspected after PR creation. License-bot manifests were preserved without changes.

Docs

  • Not needed
  • Updated (README / docs / examples)

README explains protocol gating and the typed representations of content-only repository responses. Tool schemas include updated snapshots.

SamMorrowDrums and others added 2 commits October 2, 2026 14:44
Migrate the remaining 17 repository tools to concrete inputs and outputs. Preserve existing content, mutations, scopes, filtering, and protocol gating; add wire and schema conformance coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums
SamMorrowDrums added this pull request to stack #3385 October 2, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant