Skip to content

fix: propagate tags from skill frontmatter to SkillResource#3404

Open
clawtom wants to merge 1 commit intoPrefectHQ:mainfrom
clawtom:fix/skills-provider-tags
Open

fix: propagate tags from skill frontmatter to SkillResource#3404
clawtom wants to merge 1 commit intoPrefectHQ:mainfrom
clawtom:fix/skills-provider-tags

Conversation

@clawtom
Copy link

@clawtom clawtom commented Mar 6, 2026

Summary

Fixes #3402.

SkillsProvider (and SkillProvider) were constructing SkillResource objects without populating the tags field, even when tags were declared in the skill's YAML frontmatter. This prevented tag-based filtering from working for skill resources.

Root cause

In skill_provider.py, both the list_resources() and get_resource() paths constructed SkillResource with an empty/default tags set:

SkillResource(
    uri=AnyUrl(f"skill://{skill.name}/{self._main_file_name}"),
    name=f"{skill.name}/{self._main_file_name}",
    description=skill.description,
    mime_type="text/markdown",
    # tags were never passed — defaults to set()
    skill_info=skill,
    is_manifest=False,
)

The tags data is available in skill.frontmatter (parsed from YAML frontmatter), but was never forwarded to SkillResource.

Fix

Pass tags=set(skill.frontmatter.get("tags", [])) in both construction sites (list and get paths). The manifest resources are intentionally left without tags, as they represent directory listings rather than the skill content itself.

Testing

To reproduce before fix:

---
description: My skill
tags: [python, testing]
---
resources = await provider.list_resources()
# resources[0].tags == set()  # wrong — should be {"python", "testing"}

After fix, resources[0].tags == {"python", "testing"}.

Fixes PrefectHQ#3402: SkillsProvider was constructing SkillResource without
populating the `tags` field, even when tags were present in the
skill's YAML frontmatter. This prevented tag-based filtering
from working for skills resources.

Apply the fix in both list_resources() and get_resource() paths.
@marvin-context-protocol marvin-context-protocol bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. contrib Related to community contributions in src/contrib/ directory. labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. contrib Related to community contributions in src/contrib/ directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SkillsProvider does not add tags to SkillResource

1 participant