Skip to main content
Glama
feuerdev
by feuerdev

find

Search Google Keep notes by text, label IDs, color, or status. Filter by pinned, archived, or trashed notes.

Instructions

Find notes using text and optional filters. labels should be label IDs. colors should be ColorValue strings (e.g. DEFAULT, RED, CERULEAN).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
labelsNo
colorsNo
pinnedNo
archivedNo
trashedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool 'find' handler function that searches notes via text and optional filters (labels, colors, pinned, archived, trashed), serializes results to JSON.
    @mcp.tool()
    def find(
        query: str = "",
        labels: list[str] | None = None,
        colors: list[str] | None = None,
        pinned: bool | None = None,
        archived: bool | None = False,
        trashed: bool = False,
    ) -> str:
        """Find notes using text and optional filters. labels should be label IDs. colors should be ColorValue strings (e.g. DEFAULT, RED, CERULEAN)."""
        keep = get_client()
        normalized_colors = _normalize_colors(colors)
        notes = keep.find(
            query=query,
            labels=labels,
            colors=normalized_colors,
            pinned=pinned,
            archived=archived,
            trashed=trashed,
        )
    
        notes_data = [serialize_note(note) for note in notes]
        return json.dumps(notes_data)
  • The input parameters/type hints and return type for the 'find' tool: query (str), labels (list[str]|None), colors (list[str]|None), pinned/bool|None, archived/bool|None (default False), trashed/bool (default False). Returns JSON string.
    def find(
        query: str = "",
        labels: list[str] | None = None,
        colors: list[str] | None = None,
        pinned: bool | None = None,
        archived: bool | None = False,
        trashed: bool = False,
    ) -> str:
        """Find notes using text and optional filters. labels should be label IDs. colors should be ColorValue strings (e.g. DEFAULT, RED, CERULEAN)."""
        keep = get_client()
        normalized_colors = _normalize_colors(colors)
        notes = keep.find(
            query=query,
            labels=labels,
            colors=normalized_colors,
            pinned=pinned,
            archived=archived,
            trashed=trashed,
        )
    
        notes_data = [serialize_note(note) for note in notes]
        return json.dumps(notes_data)
  • The tool is registered as an MCP tool via the @mcp.tool() decorator.
    @mcp.tool()
  • Helper function _normalize_colors converts string color names to gkeepapi ColorValue enum values, raising on invalid colors.
    def _normalize_colors(colors: list[str] | None):
        if colors is None:
            return None
    
        normalized_colors = []
        for color in colors:
            try:
                normalized_colors.append(gkeepapi.node.ColorValue(color))
            except ValueError as exc:
                raise ValueError(f"Invalid color '{color}'") from exc
    
        return normalized_colors
  • Helper function get_client() initializes/reuses the gkeepapi Keep client used by find().
    def get_client():
        """
        Get or initialize the Google Keep client.
        This ensures we only authenticate once and reuse the client.
        
        Returns:
            gkeepapi.Keep: Authenticated Keep client
        """
        global _keep_client
        
        if _keep_client is not None:
            return _keep_client
        
        # Load environment variables
        load_dotenv()
        
        # Get credentials from environment variables
        email = os.getenv('GOOGLE_EMAIL')
        master_token = os.getenv('GOOGLE_MASTER_TOKEN')
        
        if not email or not master_token:
            raise ValueError("Missing Google Keep credentials. Please set GOOGLE_EMAIL and GOOGLE_MASTER_TOKEN environment variables.")
        
        # Initialize the Keep API
        keep = gkeepapi.Keep()
        
        # Authenticate
        try:
            keep.authenticate(email, master_token)
        except requests.exceptions.JSONDecodeError as exc:
            raise RuntimeError(
                "Google Keep API returned a non-JSON response during authentication. "
                "This usually means the unofficial Keep API (notes/v1) is inaccessible "
                "from this environment (HTTP 403/4xx). "
                "Check that your GOOGLE_MASTER_TOKEN is valid and that the Keep API "
                "is reachable from this network."
            ) from exc
        except gkeepapi.exception.LoginException as exc:
            raise RuntimeError(
                f"Google Keep login failed: {exc}. "
                "Verify that GOOGLE_EMAIL and GOOGLE_MASTER_TOKEN are correct."
            ) from exc
        
        # Store the client for reuse
        _keep_client = keep
        
        return keep
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations present, the description must fully disclose behavioral traits. It identifies the tool as a 'find' operation (likely read-only) but does not elaborate on side effects, required permissions, rate limits, or behavior when no matches are found. The output schema exists but is not described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no redundancy. The first sentence states the purpose, the second adds critical format details for two parameters. It is efficiently front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite an output schema existing, the description lacks essential behavioral context such as how the query parameter works (full-text search?), how filtering logic combines parameters, and whether results are paginated. The tool has 6 parameters and no annotations, so the description should provide more comprehensive guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 6 parameters with 0% description coverage. The description adds format guidance for 'labels' and 'colors' (e.g., label IDs, ColorValue strings) but leaves 'query', 'pinned', 'archived', 'trashed' unexplained. This provides minor additional value but is insufficient given the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Find notes using text and optional filters', specifying the action (find) and resource (notes). It distinguishes the tool from siblings like get_note (single note retrieval) and list_labels, making its purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides hints on parameter formats (e.g., 'labels should be label IDs'), but does not explicitly state when to use this tool over alternatives or when not to use it. Usage context is implied but not clearly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/feuerdev/keep-mcp'

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