get_memo
Retrieve specific memos from the MCP Server Memos by providing the memo name, enabling quick access to stored information.
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-135 (handler)The main handler function for the 'get_memo' tool. It validates the input arguments using GetMemoRequest schema, constructs a gRPC request to fetch the memo by name from the memo_service stub, formats the response content, and returns it as MCP 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 BaseModel defining the input schema for the get_memo tool, which requires a single 'name' field (format: memos/{id}). Used for validation in the handler and as inputSchema in tool registration.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 MCP server's list_tools() decorator. Defines the tool name 'get_memo', 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 the MCP server's call_tool() decorator that routes calls to the get_memo handler when the tool name matches.elif name == MemosTools.GET_MEMO: return await tool_adapter.get_memo(args)
- src/mcp_server_memos/server.py:17-17 (helper)Enum value in MemosTools defining the string constant for the 'get_memo' tool name, used throughout for comparisons and registration.GET_MEMO = "get_memo"