Skip to main content
Glama

extract_markdown_from_url

Extract markdown text from a publicly accessible PDF or image URL, and optionally save the output and images to disk.

Instructions

Extract markdown text from a publicly accessible URL.

Processes a PDF or image directly from a URL without uploading a local file first. When output_dir is provided, saves the extracted markdown to content.md inside a named subdirectory. When include_images is also True, saves embedded images alongside the markdown file.

Args: file_url: Publicly accessible URL to a PDF or image output_dir: Absolute path to an existing output directory (must be within allowed dir). When set, saves markdown to disk at <output_dir>/<url_stem>/content.md. include_images: When True (requires output_dir), save images to disk and rewrite markdown with relative image links.

Returns: When output_dir is not set: result: Extracted markdown content When output_dir is set (with or without images): output_directory: Absolute path to the output subdirectory markdown_file: Absolute path to the content.md file images: List of saved image filenames (empty if include_images is False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_urlYes
output_dirNo
include_imagesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
imagesYes
resultYes
markdown_fileYes
output_directoryYes
Behavior5/5

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

With no annotations, the description carries full burden and it succeeds: it discloses file-saving side effects (output_dir creates a subdirectory with content.md), conditional image handling, the requirement that output_dir exist and be within an allowed directory, and the return value shapes for each mode. This goes well beyond the minimal schema.

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 front-loaded with a clear one-sentence summary, followed by structured Args and Returns sections. Every sentence conveys necessary information, and the formatting makes conditional behavior easy to parse. It is appropriately sized for a tool with three parameters and two operating modes.

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

Completeness5/5

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

The tool has moderate complexity with conditional behavior depending on output_dir and include_images. The description fully covers all modes, return types, and disk interactions, making it complete even without an explicit output schema. The return value explanation is sufficiently detailed and aligns with the listed output schema.

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

Parameters5/5

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

Schema coverage is 0%, so the description is the sole source of parameter meaning. It provides rich semantics: file_url must be publicly accessible; output_dir must be an existing absolute path within an allowed dir and determines disk-saving path; include_images requires output_dir and triggers image saving plus markdown link rewriting. This fully compensates for the empty schema descriptions.

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

Purpose5/5

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

The description uses a specific verb and resource: 'Extract markdown text from a publicly accessible URL.' It clearly states it processes a PDF or image directly from a URL and contrasts with a local-file flow by saying 'without uploading a local file first,' distinguishing it from sibling extract_markdown.

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

Usage Guidelines4/5

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

The description clearly implies when to use this tool (for URL-based PDFs/images) and explains conditional behaviors for output_dir and include_images. It doesn't explicitly name alternatives or provide 'when not to use' exclusions, but the URL-vs-local context is enough to infer appropriate usage.

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

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/ORDIS-Co-Ltd/mistral-ocr-mcp'

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