save_note
Store notes with names and content in the MCP Server Example's storage system for organization and retrieval.
Instructions
Save a note with a given name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| content | Yes |
Implementation Reference
- server.py:32-36 (handler)The save_note tool handler function that saves a note to an in-memory dictionary. Takes a name and content as parameters, stores the note, and returns a confirmation message.
@mcp.tool() def save_note(name: str, content: str) -> str: """Save a note with a given name.""" notes[name] = content return f"Note '{name}' saved." - server.py:32-36 (registration)The save_note tool is registered with the MCP server using the @mcp.tool() decorator, making it available as an MCP tool that Claude can invoke.
@mcp.tool() def save_note(name: str, content: str) -> str: """Save a note with a given name.""" notes[name] = content return f"Note '{name}' saved." - server.py:33-34 (schema)The save_note tool schema is defined via Python type hints (name: str, content: str) -> str and a docstring that describes the tool's purpose.
def save_note(name: str, content: str) -> str: """Save a note with a given name."""