Skip to main content
Glama

get_download_directory

Retrieve the configured download directory used by the Markdown Downloader for saving webpages as markdown files, ensuring organized storage of downloaded content.

Instructions

Get the current download directory

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Handler for the 'get_download_directory' tool. Retrieves the current download directory from the configuration and returns it as text content.
    if (request.params.name === 'get_download_directory') { const config = getConfig(); return { content: [ { type: 'text', text: config.downloadDirectory } ] }; }
  • src/index.ts:159-166 (registration)
    Registration of the 'get_download_directory' tool in the listTools response, including name, description, and input schema (no required parameters).
    { name: 'get_download_directory', description: 'Get the current download directory', inputSchema: { type: 'object', properties: {} } },
  • Input schema for the 'get_download_directory' tool: an empty object (no parameters).
    inputSchema: { type: 'object', properties: {} }
  • getConfig() helper function that loads or initializes the configuration containing the downloadDirectory, with fallback to platform-specific default.
    function getConfig(): MarkdownDownloaderConfig { try { fs.ensureDirSync(CONFIG_DIR); if (!fs.existsSync(CONFIG_FILE)) { // Default to platform-specific directory if no config exists const defaultDownloadDir = getDefaultDownloadDir(); const defaultConfig: MarkdownDownloaderConfig = { downloadDirectory: defaultDownloadDir }; fs.writeJsonSync(CONFIG_FILE, defaultConfig); fs.ensureDirSync(defaultConfig.downloadDirectory); return defaultConfig; } return fs.readJsonSync(CONFIG_FILE); } catch (error) { console.error('Error reading config:', error); // Fallback to default const defaultDownloadDir = getDefaultDownloadDir(); return { downloadDirectory: defaultDownloadDir }; } }
  • getDefaultDownloadDir() helper that provides the platform-specific default download directory path.
    const getDefaultDownloadDir = () => { return process.platform === 'win32' ? path.join(homedir, 'Documents', 'markdown-downloads') : path.join(homedir, '.markdown-downloads'); };

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/dazeb/markdown-downloader'

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