Skip to main content
Glama

brain_create_note

Create new notes with markdown content and frontmatter in an Obsidian vault, organizing them in designated folders for knowledge management.

Instructions

Create a new note in the vault.

By default notes are created in Notes/ per the vault workflow standard. Agent-created notes should always go to Notes/ first; promotion happens during manual vault review.

Args: params: Title, content (full markdown with frontmatter), and target folder.

Returns: Confirmation with the path of the created note, or an error if the note already exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async handler function that implements the brain_create_note tool. It creates a new note file in the vault with the provided title, content, and folder, validates the path doesn't escape vault root, and returns JSON confirmation or error message.
    async def brain_create_note(params: CreateNoteInput) -> str:
        """Create a new note in the vault.
    
        By default notes are created in Notes/ per the vault workflow standard.
        Agent-created notes should always go to Notes/ first; promotion happens
        during manual vault review.
    
        Args:
            params: Title, content (full markdown with frontmatter), and target folder.
    
        Returns:
            Confirmation with the path of the created note, or an error if the
            note already exists.
        """
        try:
            folder = _resolve_path(params.folder)
            folder.mkdir(parents=True, exist_ok=True)
    
            filename = params.title if params.title.endswith(".md") else f"{params.title}.md"
            target = folder / filename
    
            if target.exists():
                return f"Error: Note already exists at {_vault_relative(target)}. Use brain_update_note to modify it."
    
            target.write_text(params.content, encoding="utf-8")
            logger.info("Created note: %s", _vault_relative(target))
    
            return json.dumps({
                "status": "created",
                "path": _vault_relative(target),
                "title": target.stem,
            }, indent=2)
        except ValueError as e:
            return f"Error: {e}"
        except OSError as e:
            return f"Error creating note: {e}"
  • Pydantic BaseModel defining the input schema for brain_create_note. Includes title (1-200 chars), content (full markdown with frontmatter), and folder (defaults to 'Notes'). Uses ConfigDict for string stripping.
    class CreateNoteInput(BaseModel):
        """Input for creating a new note. Notes are created in Notes/ by default."""
        model_config = ConfigDict(str_strip_whitespace=True)
    
        title: str = Field(
            ...,
            description="Note title (becomes the filename, e.g., '2026-03-12 - My Topic')",
            min_length=1,
            max_length=200,
        )
        content: str = Field(
            ...,
            description="Full markdown content including frontmatter (use --- delimiters)",
        )
        folder: str = Field(
            default="Notes",
            description="Vault-relative folder. Defaults to Notes/ per vault workflow.",
        )
  • brain_mcp.py:473-482 (registration)
    Registration of the brain_create_note tool with the MCP server using the @mcp.tool decorator. Includes metadata annotations for title and behavior hints (not read-only, not destructive, not idempotent, closed world).
    @mcp.tool(
        name="brain_create_note",
        annotations={
            "title": "Create a New Note",
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False,
            "openWorldHint": False,
        },
    )
  • Helper utilities used by brain_create_note: _resolve_path validates and resolves vault-relative paths while preventing directory traversal attacks, and _vault_relative converts absolute paths back to vault-relative strings.
    def _resolve_path(relative: str) -> Path:
        """Resolve a vault-relative path, preventing directory traversal."""
        cleaned = relative.lstrip("/").lstrip("\\")
        full = (VAULT_ROOT / cleaned).resolve()
        if not str(full).startswith(str(VAULT_ROOT.resolve())):
            raise ValueError(f"Path escapes vault root: {relative}")
        return full
    
    
    def _vault_relative(absolute: Path) -> str:
        """Return vault-relative path string."""
        try:
            return str(absolute.resolve().relative_to(VAULT_ROOT.resolve()))
        except ValueError:
            return str(absolute)
Behavior4/5

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

Annotations indicate this is a non-readOnly, non-destructive operation, which the description aligns with by stating it 'creates' a note. The description adds valuable context beyond annotations: it specifies the default folder location ('Notes/'), notes that promotion is manual, and mentions error behavior ('error if the note already exists'), enhancing transparency about workflow and constraints.

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 front-loaded with the core purpose, followed by usage guidelines, parameter summary, and return behavior in a structured format. Every sentence adds value—no wasted words—and it's appropriately sized for the tool's complexity, making it easy to scan and understand.

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

Completeness5/5

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

Given the tool's moderate complexity (creation with parameters), annotations cover safety aspects, and an output schema exists (so return values don't need explanation), the description is complete. It covers purpose, usage, parameters, and error handling, providing all necessary context for an agent to invoke the tool correctly without redundancy.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries full burden. It adds meaningful semantics: it explains that params include 'Title, content (full markdown with frontmatter), and target folder,' clarifies the title becomes the filename with an example, and notes the default folder. This compensates well for the lack of schema descriptions, though it doesn't detail all parameter nuances like maxLength for title.

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 specific action ('Create a new note') and resource ('in the vault'), distinguishing it from siblings like brain_update_note (update), brain_read_note (read), or brain_move_note (move). It explicitly defines the creation operation, making the purpose unambiguous and distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'Agent-created notes should always go to Notes/ first' and mentions 'promotion happens during manual vault review.' It also distinguishes from alternatives by specifying the default folder behavior, helping the agent choose this over other note-related tools.

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/delian-research/brain-mcp'

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