create_memo
Create a memo by providing content and optionally setting its visibility. This tool adds new memos to your Memos server.
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 |
Implementation Reference
- src/mcp_server_memos/server.py:110-122 (handler)The create_memo async method on MemoServiceToolAdapter that handles the tool execution logic. It validates input args using CreateMemoRequest schema, constructs a proto CreateMemoRequest, calls the gRPC memo_service.create_memo, and returns a text response.
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-52 (schema)CreateMemoRequest Pydantic model defining the tool's input schema: content (required string) and visibility (optional, defaults to 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)Registration of create_memo tool in list_tools: name=MemosTools.CREATE_MEMO ('create_memo'), description 'Create a new memo', inputSchema 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)Routing of 'create_memo' tool call in call_tool handler to tool_adapter.create_memo(args).
elif name == MemosTools.CREATE_MEMO: return await tool_adapter.create_memo(args) - src/mcp_server_memos/server.py:13-17 (helper)MemosTools enum defining CREATE_MEMO = 'create_memo' constant used for tool name registration and routing.
class MemosTools(str, Enum): LIST_MEMO_TAGS = "list_memo_tags" SEARCH_MEMO = "search_memo" CREATE_MEMO = "create_memo" GET_MEMO = "get_memo"