get_memo
Retrieve specific memos from the MCP Server Memos by providing the memo name. Enables quick access to stored information for efficient management and interaction.
Instructions
Get a memo
Input Schema
TableJSON 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 main handler function for the 'get_memo' tool. It validates the input arguments using GetMemoRequest schema, calls the underlying memo_service via gRPC to fetch the memo, formats the content, and returns it as TextContent.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-66 (schema)Pydantic schema for input validation of the get_memo tool, defining the 'name' field with description.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)Tool registration in the list_tools() handler, defining the tool 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 logic in call_tool() that routes 'get_memo' calls to the tool adapter's handler.elif name == MemosTools.GET_MEMO: return await tool_adapter.get_memo(args)
- src/mcp_server_memos/server.py:17-17 (helper)Enum constant defining the tool name 'get_memo'.GET_MEMO = "get_memo"