create_memo
Generate and store new memos with customizable content and visibility settings, enabling organized and secure note management through the MCP Server Memos interface.
Instructions
Create a new memo
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The content of the memo. | |
| visibility | No | The visibility of the memo. | PRIVATE |
Input Schema (JSON Schema)
{
"$defs": {
"Visibility": {
"enum": [
"PUBLIC",
"PROTECTED",
"PRIVATE"
],
"title": "Visibility",
"type": "string"
}
},
"description": "Request to create memo",
"properties": {
"content": {
"description": "The content of the memo.",
"title": "Content",
"type": "string"
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "PRIVATE",
"description": "The visibility of the memo."
}
},
"required": [
"content"
],
"title": "CreateMemoRequest",
"type": "object"
}
Implementation Reference
- src/mcp_server_memos/server.py:110-122 (handler)Handler function in MemoServiceToolAdapter that implements the create_memo tool logic: validates args, creates protobuf request, calls memo_service.create_memo, and returns confirmation text.async def create_memo(self, args: dict) -> list[types.TextContent]: try: params = CreateMemoRequest.model_validate(args) except Exception as e: raise McpError(types.INVALID_PARAMS, str(e)) req = memos_api_v1.CreateMemoRequest( content=params.content, visibility=params.visibility.to_proto(), ) res = await self.memo_service.create_memo(create_memo_request=req) content = f"Memo created: {res.name}" return [types.TextContent(type="text", text=content)]
- src/mcp_server_memos/server.py:40-53 (schema)Pydantic BaseModel defining the input schema for the create_memo tool, including 'content' (str) and 'visibility' (Visibility enum, default PRIVATE).class CreateMemoRequest(BaseModel): """Request to create memo""" content: Annotated[ str, Field( description="""The content of the memo.""", ), ] visibility: Annotated[ Visibility, Field(default=Visibility.PRIVATE, description="""The visibility of the memo."""), ]
- src/mcp_server_memos/server.py:165-169 (registration)Tool registration in the MCP server's list_tools() method, specifying name 'create_memo', description, and input schema from CreateMemoRequest.types.Tool( name=MemosTools.CREATE_MEMO, description="Create a new memo", inputSchema=CreateMemoRequest.model_json_schema(), ),
- src/mcp_server_memos/server.py:187-188 (registration)Dispatch logic in the MCP server's call_tool() method that routes 'create_memo' calls to the tool adapter's create_memo handler.elif name == MemosTools.CREATE_MEMO: return await tool_adapter.create_memo(args)
- src/mcp_server_memos/server.py:13-18 (helper)Enum defining tool names, including CREATE_MEMO = 'create_memo' used for registration and dispatching.class MemosTools(str, Enum): LIST_MEMO_TAGS = "list_memo_tags" SEARCH_MEMO = "search_memo" CREATE_MEMO = "create_memo" GET_MEMO = "get_memo"