Skip to main content
Glama
feuerdev
by feuerdev

delete_label

Remove a label from Google Keep by providing its unique ID.

Instructions

Delete a label by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
label_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual handler function for the 'delete_label' MCP tool. It fetches the label, validates safe-mode constraints (cannot delete keep-mcp label or labels on unmanaged notes in safe mode), then calls keep.deleteLabel() and syncs.
    @mcp.tool()
    def delete_label(label_id: str) -> str:
        """Delete a label by ID."""
        keep = get_client()
        label = keep.getLabel(label_id)
        if not label:
            raise ValueError(f"Label with ID {label_id} not found")
        if not is_unsafe_mode():
            if label.name == KEEP_MCP_LABEL:
                raise ValueError(
                    f"Cannot delete the '{KEEP_MCP_LABEL}' label in safe mode: all notes managed "
                    "by this server would become permanently unmodifiable. Set UNSAFE_MODE=true to override."
                )
            unmanaged = [
                n for n in keep.all()
                if any(lb.id == label_id for lb in n.labels.all()) and not has_keep_mcp_label(n)
            ]
            if unmanaged:
                raise ValueError(
                    f"Cannot delete label '{label.name}' in safe mode: it is attached to "
                    f"{len(unmanaged)} unmanaged note(s). Deleting it would silently modify "
                    "those notes. Set UNSAFE_MODE=true to override."
                )
        keep.deleteLabel(label_id)
        keep.sync()
        return json.dumps({"message": f"Label {label_id} marked for deletion"})
  • The 'delete_label' function is registered as an MCP tool via the @mcp.tool() decorator on line 276.
    @mcp.tool()
  • The type signature (label_id: str) -> str defines the input/output schema: accepts a single string label_id, returns a JSON string.
    @mcp.tool()
  • Helper functions used by delete_label: is_unsafe_mode() checks env var, has_keep_mcp_label() checks if a note has the keep-mcp label, KEEP_MCP_LABEL constant.
    def is_unsafe_mode() -> bool:
        return os.getenv('UNSAFE_MODE', '').lower() == 'true'
    
    
    def can_modify_note(note):
        """
        Check if a note can be modified based on label and environment settings.
    
        Args:
            note: A Google Keep note object
    
        Returns:
            bool: True if the note can be modified, False otherwise
        """
        return is_unsafe_mode() or has_keep_mcp_label(note)
    
    
    def has_keep_mcp_label(note):
        """
        Check if a note has the keep-mcp label.
    
        Args:
            note: A Google Keep note object
    
        Returns:
            bool: True if the note has the keep-mcp label, False otherwise
        """
        return any(label.name == KEEP_MCP_LABEL for label in note.labels.all())
Behavior2/5

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

With no annotations, the description must convey behavioral traits. It only states 'delete', which is already implied by the name. It does not disclose whether the deletion is permanent, what happens to associated notes, or any permissions needed. This is minimal transparency.

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 a single, concise sentence with no superfluous words. It is front-loaded with the action and resource, achieving maximum efficiency.

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

Completeness3/5

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

For a simple delete-by-ID tool, the description captures the core action. However, it lacks details about return values (despite an output schema existing), side effects, and error conditions. With no annotations, more completeness would be expected for a top-tier score.

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 parameter 'label_id' is documented in the schema but the description adds only the phrase 'by ID', which weakly connects to the parameter. With 0% schema description coverage, the description does not elaborate on the parameter's format, source, or constraints, providing marginal value.

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 the action 'delete', the resource 'label', and the method 'by ID'. It distinguishes itself from sibling tools like 'remove_label_from_note' which remove associations rather than the label itself.

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 versus alternatives such as 'remove_label_from_note' or 'update_label'. No preconditions or postconditions are mentioned, leaving the agent without usage 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