Skip to content

API Reference parrot.skills.tools

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.skills.tools

View source

SkillRegistry Tools for AI-Parrot Agents.

Provides tools that agents can use to:

  • Document learned skills/patterns
  • Search for relevant skills
  • Read skill content
  • Update existing skills
  • Save learned skills as .md files for immediate /trigger activation

Tools are grouped into two toolkits, each initialized once with its shared dependency:

  • :class:SkillRegistryToolkit — DB-backed registry (search/read/list/ document/update), sharing a :class:~parrot.skills.store.SkillRegistry.
  • :class:SkillFileToolkit — file-based skills (list_commands/load/read_asset/ save_learned), sharing a :class:~parrot.skills.file_registry.SkillFileRegistry.

Alias AbstractTool

Re-exported from parrot.tools.abstract.AbstractTool.

Alias AbstractToolkit

Re-exported from parrot.tools.toolkit.AbstractToolkit.

Class DocumentSkillArgs

Arguments for documenting a new skill.

Fields:

Field Type Default Description
name str Concise skill name
description str What this skill does (1-2 sentences)
content str Full skill documentation in Markdown
category str 'general' Category: tool_usage, workflow, domain, error_handling, optimization, general
tags List[str] Searchable tags
triggers List[str] Patterns that should trigger using this skill
related_tools List[str] Tools this skill involves

Class LoadSkillArgs

Arguments for loading a skill's full content on demand.

Fields:

Field Type Default Description
name str Skill name as listed in <available_skills>.

Class ReadSkillAssetArgs

Arguments for reading a bundled asset of a composite skill.

Fields:

Field Type Default Description
skill_name str Skill name as listed in <available_skills>.
asset str Asset filename relative to the skill directory, as listed in the 'assets' manifest returned by load_skill (e.g. 'template.md').

Class ReadSkillToolArgs

Arguments for reading a skill.

Fields:

Field Type Default Description
skill_id str Skill ID to read
version Optional[int] None Version number (latest if None)

Class SaveLearnedSkillArgs

Arguments for saving a learned skill as a .md file.

Fields:

Field Type Default Description
name str Skill name (used as filename)
description str Short description of what the skill does
content str Skill instruction body (markdown)
triggers List[str] Trigger commands, e.g. ['/resumen']
category str 'general' Skill category

Alias SearchSkillArgs

Re-exported from parrot.skills.models.SearchSkillArgs.

Alias SkillCategory

Re-exported from parrot.skills.models.SkillCategory.

Alias SkillFileRegistry

Re-exported from parrot.skills.file_registry.SkillFileRegistry.

Class SkillFileToolkit

Unified toolkit for file-based skills, sharing one SkillFileRegistry.

Every public async method becomes a tool whose name equals the method name (no tool_prefix is applied, so load_skill, read_skill_asset and save_learned_skill keep the historical names referenced by the <available_skills> prompt layer). The registry is injected once and shared by every tool, replacing the previous one-class-per-tool wiring.

Tiers:

  • list_skill_commands (Tier 1): live listing of every registered skill with its description and /trigger commands.
  • load_skill (Tier 2): full skill body + asset manifest for composite skills.
  • read_skill_asset (Tier 2): sandboxed reader for a bundled asset.
  • save_learned_skill: persist an LLM-authored skill for immediate use.
Parameter Type Default Description
file_registry SkillFileRegistry Shared :class:~parrot.skills.file_registry.SkillFileRegistry.
learned_dir Optional[Path] None Directory where learned skills are written. When None the save_learned_skill tool is not exposed.
max_asset_bytes int 64 * 1024 Truncation ceiling for read_skill_asset. Defaults to 64 KiB.
view_provider Optional[Callable[[], Any]] None Optional callable returning the view for the current request. A None result uses file_registry.
on_saved Optional[Callable[[], Awaitable[None]]] None Optional coroutine awaited after a learned skill is hot-added, so the owning agent can refresh its views and indexes.
**kwargs {}

Method SkillFileToolkit.list_skill_commands

List all available skills with their descriptions and /trigger commands. Use to tell the user which skills and slash-commands are available. Reads the live registry, so skills learned during the current session are included.

list_skill_commands() -> ToolResult

Returns: ToolResult

Method SkillFileToolkit.load_skill

Load the full content of a skill from the agent's skills directory. Use after spotting a relevant skill in <available_skills>.

Returns status="done" with result=template_body; for composite skills, metadata["assets"] lists the bundled asset filenames and metadata["is_composite"] is True.

load_skill(name: str) -> ToolResult

Parameter Type Default Description
name str

Returns: ToolResult

Method SkillFileToolkit.read_skill_asset

Read the content of an asset bundled with a composite skill (template, script, example). Use after load_skill lists the skill's assets. Pass the skill name and the asset filename.

Access is sandboxed to the skill's assets_dir: paths that escape the directory (traversal) are rejected, and SKILL.md is reserved for load_skill.

read_skill_asset(skill_name: str, asset: str) -> ToolResult

Parameter Type Default Description
skill_name str
asset str

Returns: ToolResult

Method SkillFileToolkit.save_learned_skill

Save a new learned skill as a .md file for immediate use via /trigger. The skill will be available in the current session immediately.

save_learned_skill(name: str, description: str, content: str, triggers: Optional[List[str]] = None, category: str = 'general') -> ToolResult

Parameter Type Default Description
name str
description str
content str
triggers Optional[List[str]] None
category str 'general'

Returns: ToolResult

Alias SkillRegistry

Re-exported from parrot.skills.store.SkillRegistry.

Class SkillRegistryToolkit

Unified toolkit for the DB-backed skill registry, sharing one store.

Every public async method becomes a tool whose name equals the method name (no tool_prefix is applied, so search_skills, read_skill, list_skills, document_skill and update_skill keep their historical names). The :class:~parrot.skills.store.SkillRegistry and the agent_id are injected once and shared by every tool, replacing the previous one-class-per-tool wiring.

Write tools (document_skill, update_skill) are exposed only when include_write_tools is True.

Parameter Type Default Description
registry SkillRegistry Configured DB-backed :class:~parrot.skills.store.SkillRegistry.
agent_id str Agent identifier, recorded as the author of documented/updated skills.
include_write_tools bool True When False, document_skill and update_skill are not exposed.
registry_provider Optional[Callable[[], Optional[SkillRegistry]]] None Optional callable returning the registry for the current request. A None result uses registry.
**kwargs {}

Method SkillRegistryToolkit.search_skills

Search for relevant skills and patterns. Use before tackling unfamiliar tasks to leverage existing knowledge.

search_skills(query: str, category: Optional[str] = None, tags: Optional[List[str]] = None, include_deprecated: bool = False, max_results: int = 5) -> ToolResult

Parameter Type Default Description
query str
category Optional[str] None
tags Optional[List[str]] None
include_deprecated bool False
max_results int 5

Returns: ToolResult

Method SkillRegistryToolkit.read_skill

Read the full content of a skill by ID.

read_skill(skill_id: str, version: Optional[int] = None) -> ToolResult

Parameter Type Default Description
skill_id str
version Optional[int] None

Returns: ToolResult

Method SkillRegistryToolkit.list_skills

List all available skills with summary info.

list_skills() -> ToolResult

Returns: ToolResult

Method SkillRegistryToolkit.document_skill

Document a learned skill or pattern for future reference. Use when you discover an effective approach worth remembering.

document_skill(name: str, description: str, content: str, category: str = 'general', tags: Optional[List[str]] = None, triggers: Optional[List[str]] = None, related_tools: Optional[List[str]] = None) -> ToolResult

Parameter Type Default Description
name str
description str
content str
category str 'general'
tags Optional[List[str]] None
triggers Optional[List[str]] None
related_tools Optional[List[str]] None

Returns: ToolResult

Method SkillRegistryToolkit.update_skill

Update an existing skill with improved content. Creates a new version while preserving history.

update_skill(skill_id: str, content: str, commit_message: str = '', name: Optional[str] = None, description: Optional[str] = None) -> ToolResult

Parameter Type Default Description
skill_id str
content str
commit_message str ''
name Optional[str] None
description Optional[str] None

Returns: ToolResult

Alias ToolResult

Re-exported from parrot.tools.abstract.ToolResult.

Class UpdateSkillArgs

Arguments for updating an existing skill.

Fields:

Field Type Default Description
skill_id str ID of skill to update
content str Updated skill content in Markdown
commit_message str '' What changed and why
name Optional[str] None New name (optional)
description Optional[str] None New description (optional)

Function create_skill_tools

Create skill registry tools for an agent.

Thin factory that instantiates the two skill toolkits and concatenates their generated tools.

create_skill_tools(registry: SkillRegistry, agent_id: str, include_write_tools: bool = True, file_registry: Optional[SkillFileRegistry] = None, learned_dir: Optional[Path] = None, *, view_provider: Optional[Callable[[], Any]] = None, registry_provider: Optional[Callable[[], Optional[SkillRegistry]]] = None) -> List[AbstractTool]

Parameter Type Default Description
registry SkillRegistry Configured SkillRegistry (DB-backed).
agent_id str Agent identifier string.
include_write_tools bool True If True, include the document_skill / update_skill write tools from :class:SkillRegistryToolkit.
file_registry Optional[SkillFileRegistry] None Optional :class:~parrot.skills.file_registry.SkillFileRegistry for file-based tools. When provided, the file-based tools from :class:SkillFileToolkit (load_skill, read_skill_asset and, when learned_dir is set, save_learned_skill) are included.
learned_dir Optional[Path] None Path to the learned skills directory, required to expose the save_learned_skill tool.
view_provider Optional[Callable[[], Any]] None Optional callable returning the file-skill view for the current request.
registry_provider Optional[Callable[[], Optional[SkillRegistry]]] None Optional callable returning the DB registry for the current request.

Returns: List[AbstractTool] — List of :class:~parrot.tools.abstract.AbstractTool instances.

Alias tool_schema

Re-exported from parrot.tools.decorators.tool_schema.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally