Skip to main content
Glama
feuerdev
by feuerdev

create_label

Create labels in Google Keep to categorize and organize your notes.

Instructions

Create a label.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'create_label'. It gets the Keep client, creates a label via keep.createLabel(name), syncs, and returns the serialized label as JSON.
    @mcp.tool()
    def create_label(name: str) -> str:
        """Create a label."""
        keep = get_client()
        label = keep.createLabel(name)
        keep.sync()
        return json.dumps(serialize_label(label))
  • The @mcp.tool() decorator registers create_label as an MCP tool on the FastMCP instance named 'mcp'.
    @mcp.tool()
  • The serialize_label helper, which converts a label object to a dict with 'id' and 'name' fields for JSON output.
    def serialize_label(label):
        return {'id': label.id, 'name': label.name}
  • The get_client() helper, which initializes and returns the Google Keep API client used by create_label.
    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 FastMCP instance 'mcp' on which tools like create_label are registered.
    mcp = FastMCP("keep")
Behavior2/5

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

No annotations are present, so the description must carry the transparency burden. It only states the action 'Create' which implies a write operation, but offers no details on side effects, idempotency, or authorization needs. The output schema exists but is not referenced.

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

Conciseness4/5

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

The description is extremely concise (three words), front-loading the core action. However, it sacrifices necessary detail for brevity.

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?

Given the tool has one parameter with no schema comments, an output schema, and sibling tools that suggest labels are used with notes, the description is insufficient. It doesn't explain the label concept, return value, or integration points.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not explain the sole parameter 'name'. Without any parameter documentation, the agent lacks context on what value to provide, e.g., format, uniqueness, or constraints.

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 'Create a label.' clearly states the action and resource, but lacks specificity to differentiate from sibling tools like 'add_label_to_note'. It is clear enough to indicate a new label is being created.

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 is provided on when to use this tool vs alternatives such as 'add_label_to_note' or 'list_labels'. The description does not mention prerequisites or typical workflow 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