Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameYesThe name of the memo. Format: memos/{id}

Implementation Reference

  • 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)]
  • 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} """ ), ]
  • 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(), ),
  • 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)
  • Enum value in MemosTools defining the string constant for the 'get_memo' tool name, used throughout for comparisons and registration.
    GET_MEMO = "get_memo"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RyoJerryYu/mcp-server-memos-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server