Skip to main content
Glama
feuerdev
by feuerdev

add_label_to_note

Attach a label to a note by specifying both the note ID and the label ID.

Instructions

Add a label to a note.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
note_idYes
label_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler that adds a label to a note. It looks up the note and label by ID, ensures the note is modifiable, then adds the label and syncs.
    @mcp.tool()
    def add_label_to_note(note_id: str, label_id: str) -> str:
        """Add a label to a note."""
        keep, note = _get_note_or_raise(note_id)
        _ensure_modifiable(note)
    
        label = keep.getLabel(label_id)
        if not label:
            raise ValueError(f"Label with ID {label_id} not found")
    
        note.labels.add(label)
        keep.sync()
        return json.dumps(serialize_note(note))
  • The @mcp.tool() decorator registers add_label_to_note as an MCP tool.
    @mcp.tool()
  • Helper function used by add_label_to_note to fetch the note and client, raising if note not found.
    def _get_note_or_raise(note_id: str):
        keep = get_client()
        note = keep.get(note_id)
        if not note:
            raise ValueError(f"Note with ID {note_id} not found")
        return keep, note
  • Helper function used by add_label_to_note to verify the note is modifiable (has keep-mcp label or UNSAFE_MODE is enabled).
    def _ensure_modifiable(note):
        if not can_modify_note(note):
            raise ValueError(
                f"Note with ID {note.id} cannot be modified "
                "(missing keep-mcp label and UNSAFE_MODE is not enabled)"
            )
Behavior2/5

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

No annotations are present, so the description must fully disclose behavior. It only states 'Add a label to a note,' implying a mutation, but provides no details on side effects, idempotency, or error handling.

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

Conciseness2/5

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

While the description is concise, it is under-specified. It fails to provide necessary context, making it insufficient for effective tool selection and use.

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 presence of an output schema, the description does not explain return values or possible errors. It does not differentiate from sibling tools beyond the basic action, leaving the agent underinformed.

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%, yet the description adds no extra meaning to the parameters. The names 'note_id' and 'label_id' are somewhat self-explanatory, but the description does not clarify expected formats or sources.

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 action (Add) and the resource (label to a note), distinguishing it from siblings like remove_label_from_note. However, it could be more specific by indicating that the label must already exist.

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 (e.g., create_label first). There is no indication of prerequisites or potential errors (e.g., label already attached, invalid IDs).

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