Skip to main content
Glama

view_note

Display a formatted note from your knowledge base for improved readability. Retrieve stored information using an identifier and optional project parameters.

Instructions

View a note as a formatted artifact for better readability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYes
projectNo
pageNo
page_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The complete implementation of the 'view_note' MCP tool. This includes the handler function logic, input schema defined by parameters and docstring, and automatic registration via the @mcp.tool decorator. The function fetches note content using read_note and formats it as a markdown artifact for display.
    @mcp.tool(
        description="View a note as a formatted artifact for better readability.",
    )
    async def view_note(
        identifier: str,
        project: Optional[str] = None,
        page: int = 1,
        page_size: int = 10,
        context: Context | None = None,
    ) -> str:
        """View a markdown note as a formatted artifact.
    
        This tool reads a note using the same logic as read_note but instructs Claude
        to display the content as a markdown artifact in the Claude Desktop app.
        Project parameter optional with server resolution.
    
        Args:
            identifier: The title or permalink of the note to view
            project: Project name to read from. Optional - server will resolve using hierarchy.
                    If unknown, use list_memory_projects() to discover available projects.
            page: Page number for paginated results (default: 1)
            page_size: Number of items per page (default: 10)
            context: Optional FastMCP context for performance caching.
    
        Returns:
            Instructions for Claude to create a markdown artifact with the note content.
    
        Examples:
            # View a note by title
            view_note("Meeting Notes")
    
            # View a note by permalink
            view_note("meetings/weekly-standup")
    
            # View with pagination
            view_note("large-document", page=2, page_size=5)
    
            # Explicit project specification
            view_note("Meeting Notes", project="my-project")
    
        Raises:
            HTTPError: If project doesn't exist or is inaccessible
            SecurityError: If identifier attempts path traversal
        """
        track_mcp_tool("view_note")
        logger.info(f"Viewing note: {identifier} in project: {project}")
    
        # Call the existing read_note logic
        content = await read_note.fn(identifier, project, page, page_size, context)
    
        # Check if this is an error message (note not found)
        if "# Note Not Found" in content:
            return content  # Return error message directly
    
        # Return instructions for Claude to create an artifact
        return dedent(f"""
            Note retrieved: "{identifier}"
            
            Display this note as a markdown artifact for the user.
        
            Content:
            ---
            {content}
            ---
            """).strip()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions viewing as a 'formatted artifact', which implies a read-only operation with enhanced presentation, but doesn't cover critical aspects like authentication needs, rate limits, error handling, or what 'formatted' entails. This leaves significant gaps in understanding the tool's behavior.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, making it easy to parse quickly, though it could benefit from more detail given the complexity of the tool.

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?

Given the tool has 4 parameters with 0% schema coverage and no annotations, but an output schema exists, the description is incomplete. It doesn't explain parameter meanings or behavioral traits, though the output schema might cover return values. For a tool with multiple parameters and no annotation support, more context is needed to be fully helpful.

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%, so the schema provides no parameter details. The description adds no information about parameters like 'identifier', 'project', 'page', or 'page_size', failing to compensate for the lack of schema documentation. This leaves all four parameters semantically undefined, hindering proper tool invocation.

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

Purpose3/5

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

The description states the tool 'View a note as a formatted artifact for better readability', which specifies the verb 'view' and resource 'note'. However, it doesn't clearly distinguish this from sibling tools like 'read_note' or 'read_content', leaving the exact differentiation vague. The mention of 'formatted artifact' adds some specificity but isn't fully clarifying.

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?

The description provides no guidance on when to use this tool versus alternatives such as 'read_note' or 'search_notes'. There's no mention of prerequisites, exclusions, or specific contexts where this tool is preferred, leaving the agent with no usage direction beyond the basic purpose.

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/basicmachines-co/basic-memory'

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