Skip to main content
Glama
feuerdev
by feuerdev

create_note

Add a new note to Google Keep by specifying an optional title and text content.

Instructions

Create a new note with title and text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNo
textNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'create_note' MCP tool handler function. It creates a new Google Keep note via the gkeepapi, ensures a 'keep-mcp' label exists (creating it if needed), applies it to the note, syncs, and returns the serialized note as JSON.
    @mcp.tool()
    def create_note(title: str | None = None, text: str | None = None) -> str:
        """Create a new note with title and text."""
        keep = get_client()
        note = keep.createNote(title=title, text=text)
    
        label = keep.findLabel("keep-mcp")
        if not label:
            label = keep.createLabel("keep-mcp")
    
        note.labels.add(label)
        keep.sync()
    
        return json.dumps(serialize_note(note))
  • The @mcp.tool() decorator on line 79 registers 'create_note' as an MCP tool with the FastMCP server.
    @mcp.tool()
  • The get_client() helper function used inside create_note to obtain the authenticated gkeepapi.Keep client instance.
    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
  • The serialize_note() helper used to convert the created note object into a JSON-serializable dict.
    def serialize_note(note):
        """
        Serialize a Google Keep note into a dictionary.
        
        Args:
            note: A Google Keep note object
            
        Returns:
            dict: A dictionary containing the note's id, title, text, pinned status, color and labels
        """
        payload = {
            'id': note.id,
            'title': note.title,
            'text': note.text,
            'type': note.type.value,
            'pinned': note.pinned,
            'archived': note.archived,
            'trashed': note.trashed,
            'color': note.color.value if note.color else None,
            'labels': [serialize_label(label) for label in note.labels.all()],
            'collaborators': list(note.collaborators.all()),
        }
    
        if hasattr(note, 'items'):
            payload['items'] = [serialize_list_item(item) for item in note.items]
    
        payload['media'] = [
            {
                'blob_id': blob.id,
                'type': blob.blob.type.value if blob.blob and blob.blob.type else None,
            }
            for blob in note.blobs
        ]
    
        return payload
Behavior2/5

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

With no annotations, the description should disclose behavioral traits, but it only states the basic action. It doesn't mention side effects, authentication needs, rate limits, or what happens with null parameters.

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

Conciseness3/5

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

The description is one short sentence, which is concise but under-specified. It could be improved by adding necessary details without becoming verbose.

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?

The tool has an output schema but the description omits any mention of what is returned. Given the simplicity and lack of annotations, the description should at least note the return value.

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?

Schema description coverage is 0%, and the description only names the parameters 'title' and 'text' without explaining their purpose, constraints, or behavior when null.

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

Purpose4/5

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

The description clearly states the tool creates a new note with title and text, distinguishing it from update, delete, or list operations. However, it doesn't mention that both parameters are optional.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like update_note or archive_note, nor any prerequisites or context.

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