Skip to main content
Glama
JDJR2024

Markdownify MCP Server - UTF-8 Enhanced

by JDJR2024

get-markdown-file

Retrieve Markdown content from an absolute file path using the get-markdown-file tool. Ideal for extracting and converting documents into Markdown format with enhanced UTF-8 support.

Instructions

Get a markdown file by absolute file path

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathYesAbsolute path to file of markdown'd text

Implementation Reference

  • Handler logic in the tool call switch statement that validates input and calls Markdownify.get() to retrieve the markdown file content.
    case tools.GetMarkdownFileTool.name:
      if (!validatedArgs.filepath) {
        throw new Error("File path is required for this tool");
      }
      result = await Markdownify.get({
        filePath: validatedArgs.filepath,
      });
      break;
  • Input schema definition for the get-markdown-file tool, specifying the filepath parameter.
    export const GetMarkdownFileTool = ToolSchema.parse({
      name: "get-markdown-file",
      description: "Get a markdown file by absolute file path",
      inputSchema: {
        type: "object",
        properties: {
          filepath: {
            type: "string",
            description: "Absolute path to file of markdown'd text",
          },
        },
        required: ["filepath"],
      },
    });
  • Core implementation of reading a markdown file by path and returning its path and text content.
    static async get({
      filePath,
    }: {
      filePath: string;
    }): Promise<MarkdownResult> {
      if (!fs.existsSync(filePath)) {
        throw new Error("File does not exist");
      }
    
      const text = await fs.promises.readFile(filePath, "utf-8");
    
      return {
        path: filePath,
        text: text,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool retrieves a file but doesn't disclose behavioral traits such as error handling (e.g., if file doesn't exist), permissions needed, rate limits, or output format. This leaves significant gaps for a tool that likely involves file system access.

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, clear sentence with zero waste. It's front-loaded with the core action and resource, making it efficient and easy to understand without unnecessary details.

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

Completeness2/5

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

Given no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't cover key aspects like what happens on failure, the return format (e.g., raw markdown text or structured data), or how it differs from sibling tools, which are crucial for effective use.

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?

Schema description coverage is 100%, with the parameter 'filepath' fully documented in the schema as 'Absolute path to file of markdown'd text'. The description adds no additional meaning beyond this, such as examples or constraints, so it meets 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 verb ('Get') and resource ('a markdown file'), specifying it retrieves content by absolute file path. However, it doesn't distinguish from sibling tools like 'audio-to-markdown' or 'webpage-to-markdown', which are conversion tools rather than retrieval tools, so it's not fully differentiated.

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?

No guidance is provided on when to use this tool versus alternatives. The description implies usage for retrieving existing markdown files, but it doesn't mention prerequisites (e.g., file must exist), exclusions (e.g., not for creating or converting files), or compare to siblings like 'docx-to-markdown' for conversion tasks.

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/JDJR2024/markdownify-mcp-utf8'

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