Skip to main content
Glama
dweigend

Joplin MCP Server

by dweigend

import_markdown

Import markdown files into Joplin as notes by specifying the file path, enabling easy integration and management of markdown content within the Joplin MCP Server.

Instructions

Import a markdown file as a new note.

Args: args: Import parameters file_path: Path to the markdown file Returns: Dictionary containing the created note data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYes

Implementation Reference

  • The main asynchronous handler function for the 'import_markdown' tool. It is decorated with @mcp.tool() for registration. Reads the markdown file using MarkdownContent.from_file, extracts title and content, creates a new note via JoplinAPI, and returns the note details.
    async def import_markdown(args: ImportMarkdownInput) -> Dict[str, Any]: """Import a markdown file as a new note. Args: args: Import parameters file_path: Path to the markdown file Returns: Dictionary containing the created note data """ if not api: return {"error": "Joplin API client not initialized"} try: file_path = Path(args.file_path) md_content = MarkdownContent.from_file(file_path) note = api.create_note( title=md_content.title, body=md_content.content ) return { "status": "success", "note": { "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 }, "imported_from": str(file_path) } except Exception as e: logger.error(f"Error importing markdown: {e}") return {"error": str(e)}
  • Pydantic BaseModel defining the input schema for the import_markdown tool, requiring a 'file_path' parameter.
    class ImportMarkdownInput(BaseModel): """Input parameters for importing markdown files.""" file_path: str

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/dweigend/joplin-mcp-server'

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