search_notes
Find specific notes in Joplin by entering search queries with optional result limits to quickly locate relevant information.
Instructions
Search for notes in Joplin.
Args:
args: Search parameters
query: Search query string
limit: Maximum number of results (default: 100)
Returns:
Dictionary containing search results
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes |
Implementation Reference
- src/mcp/joplin_mcp.py:62-97 (handler)The MCP tool handler for 'search_notes', registered via @mcp.tool() decorator. Calls JoplinAPI.search_notes and formats results.@mcp.tool() async def search_notes(args: SearchNotesInput) -> Dict[str, Any]: """Search for notes in Joplin. Args: args: Search parameters query: Search query string limit: Maximum number of results (default: 100) Returns: Dictionary containing search results """ if not api: return {"error": "Joplin API client not initialized"} try: results = api.search_notes(query=args.query, limit=args.limit) return { "status": "success", "total": len(results.items), "has_more": results.has_more, "notes": [ { "id": note.id, "title": note.title, "body": note.body, "created_time": note.created_time.isoformat() if note.created_time else None, "updated_time": note.updated_time.isoformat() if note.updated_time else None, "is_todo": note.is_todo } for note in results.items ] } except Exception as e: logger.error(f"Error searching notes: {e}") return {"error": str(e)}
- src/mcp/joplin_mcp.py:37-41 (schema)Pydantic input schema/model for the search_notes tool parameters.class SearchNotesInput(BaseModel): """Input parameters for searching notes.""" query: str limit: Optional[int] = 100
- src/joplin/joplin_api.py:375-397 (helper)Core implementation of note search in JoplinAPI class, querying the Joplin REST API /search endpoint.def search_notes( self, query: str, limit: int = 100 ) -> PaginatedResponse[JoplinNote]: """Search for notes. Args: query: Search query string limit: Maximum number of results Returns: PaginatedResponse containing matching JoplinNote objects """ params = { "query": query, "limit": limit } response = self._make_request("GET", "search", params=params) return PaginatedResponse( items=[JoplinNote.from_api_response(item) for item in response["items"]], has_more=response["has_more"] )