get_memo
Retrieve a specific memo by its name to view its content.
Instructions
Get a memo
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the memo. Format: memos/{id} |
Implementation Reference
- src/mcp_server_memos/server.py:125-134 (handler)The handler method `get_memo` on MemoServiceToolAdapter that validates input via GetMemoRequest, calls the gRPC MemoService.get_memo, and returns the memo content.
async def get_memo(self, args: dict) -> list[types.TextContent]: try: params = GetMemoRequest.model_validate(args) except Exception as e: raise McpError(types.INVALID_PARAMS, str(e)) req = memos_api_v1.GetMemoRequest(name=params.name) res = await self.memo_service.get_memo(get_memo_request=req) content = f"Memo:\n{res.content}" return [types.TextContent(type="text", text=content)] - src/mcp_server_memos/server.py:55-65 (schema)Pydantic schema for GetMemoRequest with a required 'name' field (format: memos/{id}).
class GetMemoRequest(BaseModel): """Request to get memo""" name: Annotated[ str, Field( description="""The name of the memo. Format: memos/{id} """ ), ] - src/mcp_server_memos/server.py:170-174 (registration)Registration of the get_memo tool in the list_tools() with its name, description, and input schema.
types.Tool( name=MemosTools.GET_MEMO, description="Get a memo", inputSchema=GetMemoRequest.model_json_schema(), ), - src/mcp_server_memos/server.py:189-190 (registration)Dispatch in call_tool() that routes the 'get_memo' tool name to the handler method.
elif name == MemosTools.GET_MEMO: return await tool_adapter.get_memo(args) - src/mcp_server_memos/server.py:17-17 (helper)Enum constant MemosTools.GET_MEMO defining the string 'get_memo' used for registration and dispatch.
GET_MEMO = "get_memo"