find_kubernetes_examples
Search Bear notes for Kubernetes manifest examples by resource type to implement configurations in your projects.
Instructions
Find Kubernetes manifest examples in Bear notes
Args: resource_type: Kubernetes resource type to search for (deployment, service, configmap, etc.)
Returns: Notes containing Kubernetes examples
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource_type | No | deployment |
Implementation Reference
- main.py:205-245 (handler)The @mcp.tool() decorated function that implements and registers the 'find_kubernetes_examples' MCP tool. It searches Bear notes for Kubernetes-related terms based on the resource_type parameter, deduplicates results, extracts code blocks (checking for YAML), and returns up to 20 matching notes.@mcp.tool() def find_kubernetes_examples(resource_type: str = "deployment") -> List[Dict[str, Any]]: """ Find Kubernetes manifest examples in Bear notes Args: resource_type: Kubernetes resource type to search for (deployment, service, configmap, etc.) Returns: Notes containing Kubernetes examples """ try: # Search for Kubernetes-related terms k8s_terms = [ f"kind: {resource_type.title()}", f"apiVersion:", f"kubernetes {resource_type}", f"k8s {resource_type}", f"kubectl", "yaml", "manifest" ] results = [] seen_ids = set() for term in k8s_terms: notes = search_notes(term, limit=10) for note in notes: if note["id"] not in seen_ids: # Extract code blocks if present code_blocks = extract_code_blocks(note["content"]) note["code_blocks"] = code_blocks note["has_yaml"] = any("yaml" in block["language"].lower() for block in code_blocks) results.append(note) seen_ids.add(note["id"]) return results[:20] # Limit to 20 results except Exception as e: return [{"error": f"Error searching Kubernetes examples: {str(e)}"}]