Skip to main content
Glama

get_note_by_id

Retrieve a specific note from Bear Notes using its unique identifier to access individual content directly through the MCP Bear server.

Instructions

Get a specific note by its unique identifier

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
note_idYesThe unique identifier of the note (ZUNIQUEIDENTIFIER)

Implementation Reference

  • The implementation of the get_note_by_id logic, which queries the SQLite database for a note matching the given ID.
    def get_note_by_id(note_id: str) -> dict[str, Any] | None:
        """
        Get a specific note by its unique identifier.
    
        Args:
            note_id: The unique identifier of the note (ZUNIQUEIDENTIFIER)
    
        Returns:
            Note dictionary or None if not found
        """
        db_path = get_bear_db_path()
        conn = sqlite3.connect(db_path)
        conn.row_factory = sqlite3.Row
        cursor = conn.cursor()
    
        try:
            cursor.execute(
                "SELECT * FROM ZSFNOTE WHERE ZUNIQUEIDENTIFIER=?;",
                (note_id,)
            )
            row = cursor.fetchone()
    
            if row:
                return {
                    "ZCREATIONDATE": row["ZCREATIONDATE"],
                    "ZMODIFICATIONDATE": row["ZMODIFICATIONDATE"],
                    "ZARCHIVED": row["ZARCHIVED"],
                    "ZSUBTITLE": row["ZSUBTITLE"],
                    "ZTEXT": row["ZTEXT"],
                    "ZTITLE": row["ZTITLE"],
                    "ZUNIQUEIDENTIFIER": row["ZUNIQUEIDENTIFIER"],
                }
            return None
        finally:
            conn.close()
  • Registration of the get_note_by_id tool in the MCP server's list_tools definition.
        name="get_note_by_id",
        description="Get a specific note by its unique identifier",
        inputSchema={
            "type": "object",
            "properties": {
                "note_id": {
                    "type": "string",
                    "description": "The unique identifier of the note (ZUNIQUEIDENTIFIER)",
                },
            },
            "required": ["note_id"],
        },
    ),
  • The handler in the MCP server's call_tool function that processes the get_note_by_id tool invocation and calls the database function.
    elif name == "get_note_by_id":
        if not isinstance(arguments, dict) or "note_id" not in arguments:
            raise ValueError("Missing required argument: note_id")
    
        note = get_note_by_id(note_id=arguments["note_id"])
        if note:
            return [TextContent(type="text", text=str({"note": note}))]
        else:
            return [TextContent(type="text", text=str({"error": "Note not found"}))]
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves a note but doesn't disclose behavioral traits such as error handling (e.g., if the ID is invalid), authentication needs, rate limits, or response format. For a read operation without annotations, this leaves significant gaps in understanding how it behaves beyond basic purpose.

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, clear sentence with zero waste—it directly states the tool's purpose without redundancy. It's appropriately sized for a simple retrieval tool and front-loaded with essential information, making it highly efficient and easy to parse.

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's simplicity (one parameter, read operation) but lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., note content, metadata) or potential errors, leaving the agent without enough context to use it effectively beyond basic invocation.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'note_id' fully documented in the schema as 'The unique identifier of the note (ZUNIQUEIDENTIFIER)'. The description adds no additional meaning beyond implying retrieval by ID, so it meets the baseline of 3 where the schema handles parameter documentation adequately.

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 ('Get') and resource ('a specific note'), specifying retrieval by unique identifier. It distinguishes from siblings like 'get_notes' (plural retrieval) and 'get_notes_by_tag' (filtered retrieval), though not explicitly named. However, it lacks explicit sibling differentiation, preventing a perfect score.

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. It doesn't mention prerequisites (e.g., needing a valid note_id), exclusions, or comparisons to siblings like 'get_notes' (for multiple notes) or 'open_note' (which might have different behavior). The description implies usage for single-note retrieval but offers no contextual advice.

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/maxim-ist/mcp-bear'

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