skills_search
Search a global registry of community-contributed capabilities to extend AI agent functionality for specialized tasks and workflows.
Instructions
Search the extended Agent Skills Registry. Use this tool WHENEVER the user asks to 'find skills', 'search skills', or needs capabilities that you do not natively possess (e.g. specialized file handling, complex workflows). This registry contains community-contributed skills that extend your native capabilities.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keywords | |
| page | No | Page number | |
| limit | No | Items per page |
Implementation Reference
- src/skills_mcp/server.py:11-35 (handler)The main handler function for the 'skills_search' tool. It defines the input parameters with descriptions, calls the API client to search, formats the results for the LLM, and handles exceptions.def skills_search( query: str = Field(description="Search keywords"), page: int = Field(default=1, description="Page number"), limit: int = Field(default=10, description="Items per page") ) -> str: """ Search the extended Agent Skills Registry. Use this tool WHENEVER the user asks to 'find skills', 'search skills', or needs capabilities that you do not natively possess (e.g. specialized file handling, complex workflows). This registry contains community-contributed skills that extend your native capabilities. """ client = api.RegistryClient() try: results = client.search(query, page, limit) # Format for LLM # 优先取 "skills",为了兼容性也 fallback 到 "items" items = results.get("skills", results.get("items", [])) if not items: return "No skills found matching your query." output = [f"Found {len(items)} skills (Page {page}):"] for item in items: output.append(f"- {item['name']} (v{item.get('version', '?')}): {item['description']}") return "\n".join(output) except Exception as e: return f"Error searching skills: {str(e)}"
- src/skills_mcp/server.py:10-10 (registration)The @mcp.tool() decorator registers the skills_search function as an MCP tool on the FastMCP server instance.@mcp.tool()
- src/skills_mcp/server.py:12-14 (schema)Pydantic Field definitions providing input schema, defaults, and descriptions for the tool parameters.query: str = Field(description="Search keywords"), page: int = Field(default=1, description="Page number"), limit: int = Field(default=10, description="Items per page")
- src/skills_mcp/api.py:14-27 (helper)Supporting method in RegistryClient that performs the HTTP GET request to the skills registry API to fetch search results.def search(self, query: str = "", page: int = 1, limit: int = 20) -> Dict[str, Any]: """Search skills from the registry.""" params = {"q": query, "page": page, "limit": limit} try: resp = httpx.get(f"{self.base_url}/skills", params=params, headers=self.headers, timeout=10.0) resp.raise_for_status() return resp.json() except httpx.HTTPStatusError as e: if e.response.status_code == 401: raise PermissionError("Registry authentication failed. Check SKILLS_API_KEY.") raise RuntimeError(f"Registry error: {e.response.text}") except httpx.RequestError as e: raise RuntimeError(f"Network error connecting to registry: {str(e)}")