list_memo_tags
List memo tags by specifying the parent memo (or 'memos/-' for all) and visibility level. Filter tags to find those owned by a specific memo or with public, protected, or private visibility.
Instructions
List all existing memo tags
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent | No | The parent, who owns the tags. Format: memos/{id}. Use "memos/-" to list all tags. | memos/- |
| visibility | No | The visibility of the tags. | PRIVATE |
Implementation Reference
- src/mcp_server_memos/server.py:137-150 (handler)The async handler function that executes the 'list_memo_tags' tool logic. Validates input using ListMemoTagsRequest, constructs a gRPC request, calls memo_service.list_memo_tags(), and returns tag names as text content.
async def list_memo_tags(self, args: dict) -> list[types.TextContent]: try: params = ListMemoTagsRequest.model_validate(args) except Exception as e: raise McpError(types.INVALID_PARAMS, str(e)) req = memos_api_v1.ListMemoTagsRequest( parent=params.parent, filter=f"visibilities == ['{params.visibility.value}']", ) res = await self.memo_service.list_memo_tags(list_memo_tags_request=req) content = ", ".join(res.tag_amounts.keys()) content = f"Tags:\n{content}" return [types.TextContent(type="text", text=content)] - src/mcp_server_memos/server.py:68-83 (schema)Pydantic model for the tool input schema (parent and visibility fields). Used for validation and as the JSON schema for the tool registration.
class ListMemoTagsRequest(BaseModel): """Request to list memo tags""" parent: Annotated[ str, Field( default="memos/-", description="""The parent, who owns the tags. Format: memos/{id}. Use "memos/-" to list all tags. """, ), ] visibility: Annotated[ Visibility, Field(default=Visibility.PRIVATE, description="""The visibility of the tags."""), ] - src/mcp_server_memos/server.py:13-14 (registration)Enum definition registering 'list_memo_tags' as a tool name in MemosTools.
class MemosTools(str, Enum): LIST_MEMO_TAGS = "list_memo_tags" - src/mcp_server_memos/server.py:175-179 (registration)Tool registration in list_tools() function, providing description and inputSchema for the tool.
types.Tool( name=MemosTools.LIST_MEMO_TAGS, description="List all existing memo tags", inputSchema=ListMemoTagsRequest.model_json_schema(), ), - Call routing in call_tool() that dispatches to the list_memo_tags handler when the tool name matches.
elif name == MemosTools.LIST_MEMO_TAGS: return await tool_adapter.list_memo_tags(args)