Skip to main content
Glama
netologist
by netologist

find_kubernetes_examples

Search Bear notes for Kubernetes manifest examples by resource type, such as deployment, service, or configmap, to quickly retrieve relevant configurations.

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
NameRequiredDescriptionDefault
resource_typeNodeployment

Implementation Reference

  • main.py:205-245 (handler)
    The handler function for the 'find_kubernetes_examples' tool. Decorated with @mcp.tool() for registration. Searches Bear notes for Kubernetes resource examples using multiple search terms, deduplicates results, extracts code blocks, and returns up to 20 matching notes with additional metadata.
    @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)}"}]
  • Helper function used by find_kubernetes_examples to extract code blocks (including YAML fenced blocks) from note content for analysis.
    def extract_code_blocks(content: str) -> List[Dict[str, str]]: """Extract code blocks from note content""" import re # Find code blocks with language specification code_blocks = [] pattern = r'```(\w+)?\n(.*?)```' matches = re.findall(pattern, content, re.DOTALL) for language, code in matches: code_blocks.append({ "language": language or "text", "code": code.strip() }) return code_blocks

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/netologist/mcp-bear-notes'

If you have feedback or need assistance with the MCP directory API, please join our Discord server