Skip to content

feat: null features in tag schema + add name filter to listRepositoryTags - #89

Open
dankolafa wants to merge 2 commits into
docker:mainfrom
dankolafa:fix/nullable-tag-features
Open

feat: null features in tag schema + add name filter to listRepositoryTags#89
dankolafa wants to merge 2 commits into
docker:mainfrom
dankolafa:fix/nullable-tag-features

Conversation

@dankolafa

@dankolafa dankolafa commented Aug 27, 2026

Copy link
Copy Markdown

This PR makes the repository tag tools usable against real Docker Hub data. Two related changes:

1. Fix: accept features: null in the tag image schema

listRepositoryTags and getRepositoryTag fail with an MCP output-schema validation error (-32602) for any repository whose tag images have features: null — a value Docker Hub commonly returns (for example, private organization images). Because validation runs against the whole response, the tools return no data at all.

The cause: RepositoryTag.images[].features was declared as a required, non-nullable z.string(), while every sibling field that can be empty (os, os_features, os_version, variant, digest) is already .nullable(). When Docker Hub returns null, the SDK throws:

Expected string, received null   (path: images[i].features)

This makes features .nullable() to match the Docker Hub API and the surrounding fields.

2. Feature: add an optional name substring filter to listRepositoryTags

Docker Hub's tags API supports server-side substring filtering via ?name=, but the tool never forwarded it — so there was no way to resolve a partial tag (such as a short git SHA) to its full tag. This threads an optional name parameter through, mirroring the existing architecture / os filters.

listRepositoryTags(namespace=…, repository=…, name="8f5ce31")
  → returns the full tag  8f5ce311d8d1ec01f6505801255c3810a239248a

tools.json is regenerated for both changes.

Note: the null-features fix is distinct from #71 (which was about pagination parameters). That one returned wrong/partial data; this one returned nothing at all for affected repositories.


Tested on a local build against a live organization and its repositories.

Signed-off-by: Dan Kolafa <dankolafa@users.noreply.github.com>
… lookup

Signed-off-by: Dan Kolafa <dankolafa@users.noreply.github.com>
@dankolafa dankolafa changed the title fix: allow null features in repository tag image schema fix: null features in tag schema + add name filter to listRepositoryTags Aug 27, 2026
@dankolafa
dankolafa marked this pull request as ready for review August 27, 2026 22:45
@dankolafa
dankolafa requested a review from a team as a code owner August 27, 2026 22:45
@dankolafa dankolafa changed the title fix: null features in tag schema + add name filter to listRepositoryTags feat: null features in tag schema + add name filter to listRepositoryTags Aug 27, 2026
@dankolafa

Copy link
Copy Markdown
Author

@lucadruda @vdamery can anyone please take a look? Tagged you as two of the people who seem to review PRs around here 🙏

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