Skip to main content
Glama

notes_file

Create, read, update, delete, and list notes stored in a local JSON file using action commands.

Instructions

CRUD on local notes.json.

Actions:

  1. create - add a new note: action='create', key='foo', content='...'

  2. read - fetch one note: action='read', key='foo'

  3. update - replace existing: action='update', key='foo', content='...'

  4. delete - remove a note: action='delete', key='foo'

  5. list - list all keys: action='list'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
keyNo
contentNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'notes_file' tool. Decorated with @mcp.tool, it implements CRUD operations (create, read, update, delete, list) on a local notes.json file. It uses helper functions _load_notes and _save_notes to persist data.
    @mcp.tool
    def notes_file(
        action: Literal["create", "read", "update", "delete", "list"],
        key: str = "",
        content: str = "",
    ) -> str:
        """CRUD on local notes.json.
    
        Actions:
          1. create - add a new note:    action='create', key='foo', content='...'
          2. read   - fetch one note:    action='read',   key='foo'
          3. update - replace existing:  action='update', key='foo', content='...'
          4. delete - remove a note:     action='delete', key='foo'
          5. list   - list all keys:     action='list'
        """
        notes = _load_notes()
    
        if action == "list":
            return ", ".join(sorted(notes.keys())) if notes else "(no notes yet)"
    
        if not key:
            return f"error: action {action!r} requires a key"
    
        if action == "create":
            if key in notes:
                return f"error: {key!r} already exists; use action='update' to replace"
            if not content:
                return "error: 'create' requires content"
            notes[key] = content
            _save_notes(notes)
            return f"saved {key}"
    
        if action == "read":
            if key not in notes:
                return f"error: {key!r} not found"
            return notes[key]
    
        if action == "update":
            if key not in notes:
                return f"error: {key!r} not found; use action='create' to add"
            if not content:
                return "error: 'update' requires content"
            notes[key] = content
            _save_notes(notes)
            return f"updated {key}"
    
        if action == "delete":
            if key not in notes:
                return f"error: {key!r} not found"
            del notes[key]
            _save_notes(notes)
            return f"deleted {key}"
    
        return f"error: unknown action {action!r}"
  • server.py:70-70 (registration)
    The tool is registered via the @mcp.tool decorator on the notes_file function (line 70).
    @mcp.tool
  • The input schema/type definition for notes_file: action (Literal['create','read','update','delete','list']), key (str), content (str). The docstring describes allowed actions.
    def notes_file(
        action: Literal["create", "read", "update", "delete", "list"],
        key: str = "",
        content: str = "",
    ) -> str:
  • Helper function _load_notes that reads notes from notes.json file and returns a dict.
    def _load_notes() -> dict[str, str]:
        if not NOTES.exists():
            return {}
        raw = NOTES.read_text().strip()
        return json.loads(raw) if raw else {}
  • Helper function _save_notes that writes the notes dict to notes.json file.
    def _save_notes(data: dict[str, str]) -> None:
        NOTES.write_text(json.dumps(data, indent=2))
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It lists actions but does not mention potential destructive effects (update/delete), error handling, atomicity, or file locking. The transparency is minimal beyond basic CRUD semantics.

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 concise, with a single introductory line followed by a list of actions and examples. Every sentence serves a purpose, and the structure is front-loaded with the core purpose.

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

Completeness4/5

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

Given the tool's simplicity (3 parameters, output schema present), the description covers the action parameter well. However, it does not clarify behavior for empty 'key' or 'content' defaults, nor potential side effects. Still, it is largely complete for a basic CRUD tool.

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?

The schema has 0% description coverage, but the description adds meaningful context by providing examples for each action, clarifying how 'key' and 'content' are used per action. This adds value beyond the schema definition.

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 'CRUD on local notes.json' and enumerates each action with examples, making the tool's purpose unmistakable. It is distinct from siblings 'show_dashboard' and 'web_search'.

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

Usage Guidelines3/5

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

The description implicitly conveys when to use the tool (to manage notes), but does not provide explicit guidance on when not to use it or discuss alternatives. Given the unrelated siblings, no confusion arises, but explicit exclusions are absent.

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/SkinnyMonk/mcp-server'

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