Skip to main content
Glama
dazeb

Markdown Downloader

set_download_directory

Define the primary local directory where markdown files are saved when downloading webpages via the Markdown Downloader MCP server.

Instructions

Set the main local download folder for markdown files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryYesFull path to the download directory

Implementation Reference

  • Handler for the 'set_download_directory' tool. Validates the directory path, ensures it is writable, updates the configuration with the new download directory, saves the config, and returns a success or error message.
    if (request.params.name === 'set_download_directory') {
      const directory = request.params.arguments?.directory;
    
      if (!directory || typeof directory !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'A valid directory path must be provided'
        );
      }
    
      try {
        // Validate directory exists and is writable
        await fs.access(directory, fs.constants.W_OK);
    
        // Update and save config
        const config = getConfig();
        config.downloadDirectory = directory;
        saveConfig(config);
    
        return {
          content: [
            {
              type: 'text',
              text: `Download directory set to: ${directory}`
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        return {
          content: [
            {
              type: 'text',
              text: `Failed to set download directory: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
  • Schema definition for the 'set_download_directory' tool, including input schema requiring a 'directory' string parameter.
      name: 'set_download_directory',
      description: 'Set the main local download folder for markdown files',
      inputSchema: {
        type: 'object',
        properties: {
          directory: {
            type: 'string',
            description: 'Full path to the download directory'
          }
        },
        required: ['directory']
      }
    },
  • src/index.ts:112-182 (registration)
    Registration of all tools including 'set_download_directory' in the ListToolsRequestSchema handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'download_markdown',
          description: 'Download a webpage as markdown using r.jina.ai',
          inputSchema: {
            type: 'object',
            properties: {
              url: {
                type: 'string',
                description: 'URL of the webpage to download'
              },
              subdirectory: {
                type: 'string',
                description: 'Optional subdirectory to save the file in'
              }
            },
            required: ['url']
          }
        },
        {
          name: 'list_downloaded_files',
          description: 'List all downloaded markdown files',
          inputSchema: {
            type: 'object',
            properties: {
              subdirectory: {
                type: 'string',
                description: 'Optional subdirectory to list files from'
              }
            }
          }
        },
        {
          name: 'set_download_directory',
          description: 'Set the main local download folder for markdown files',
          inputSchema: {
            type: 'object',
            properties: {
              directory: {
                type: 'string',
                description: 'Full path to the download directory'
              }
            },
            required: ['directory']
          }
        },
        {
          name: 'get_download_directory',
          description: 'Get the current download directory',
          inputSchema: {
            type: 'object',
            properties: {}
          }
        },
        {
          name: 'create_subdirectory',
          description: 'Create a new subdirectory in the root download folder',
          inputSchema: {
            type: 'object',
            properties: {
              name: {
                type: 'string',
                description: 'Name of the subdirectory to create'
              }
            },
            required: ['name']
          }
        }
      ]
    }));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool sets a directory but does not explain whether this requires specific permissions, if changes are permanent or reversible, what happens to existing files, or any error conditions. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate but lacks depth. It covers the basic action but misses behavioral details like side effects or usage context, which are important for a mutation tool without annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'directory' parameter as a full path. The description adds no additional meaning beyond the schema, such as format examples or constraints, but the schema's completeness justifies the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set') and the target ('main local download folder for markdown files'), providing a specific verb+resource combination. However, it does not explicitly differentiate from sibling tools like 'get_download_directory' or 'create_subdirectory', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as 'create_subdirectory' for creating subfolders or 'get_download_directory' for retrieving the current setting. It lacks explicit context, prerequisites, or exclusions, offering only a basic functional statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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