Skip to main content
Glama

search_memo

Search for specific memos in the MCP Server Memos database using keywords to locate relevant content efficiently.

Instructions

Search for memos

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
key_wordYesThe key words to search for in the memo content.

Implementation Reference

  • The core handler function for the 'search_memo' tool. It validates the input arguments using SearchMemoRequest, constructs a ListMemosRequest to query the memo service with the keyword filter, joins the memo contents, formats the result, and returns it as TextContent.
    async def search_memo(self, args: dict) -> list[types.TextContent]: try: params = SearchMemoRequest.model_validate(args) except Exception as e: raise McpError(types.INVALID_PARAMS, str(e)) req = memos_api_v1.ListMemosRequest( filter=f"row_status == 'NORMAL' && content_search == ['{params.key_word}']" ) res = await self.memo_service.list_memos(list_memos_request=req) content = ", ".join([memo.content for memo in res.memos]) content = f"Search result:\n{content}" return [types.TextContent(type="text", text=content)]
  • Pydantic BaseModel defining the input schema for the search_memo tool, specifying the required 'key_word' parameter.
    class SearchMemoRequest(BaseModel): """Request to search memo""" key_word: Annotated[ str, Field( description="""The key words to search for in the memo content.""", ), ]
  • Registration of the 'search_memo' tool in the list_tools() function, providing name, description, and input schema.
    types.Tool( name=MemosTools.SEARCH_MEMO, description="Search for memos", inputSchema=SearchMemoRequest.model_json_schema(), ),
  • Dispatch logic in the call_tool() handler that routes calls to 'search_memo' to the tool adapter's search_memo method.
    if name == MemosTools.SEARCH_MEMO: return await tool_adapter.search_memo(args)
  • Enum defining the tool names, including SEARCH_MEMO = 'search_memo', used for registration and dispatching.
    class MemosTools(str, Enum): LIST_MEMO_TAGS = "list_memo_tags" SEARCH_MEMO = "search_memo" CREATE_MEMO = "create_memo" GET_MEMO = "get_memo"

Other Tools

Related Tools

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