How to Implement accepts() Correctly in MarkItDown Converters

The accepts() method in MarkItDown must return a boolean indicating whether a converter can handle a given binary stream, using only fast metadata checks from StreamInfo and optional byte-peeking with mandatory stream-position restoration.

When extending the microsoft/markitdown library with custom document converters, implementing accepts() correctly is essential for maintaining the performance and reliability of the document processing pipeline. The core engine calls this method—defined in the abstract DocumentConverter class located in src/markitdown/_base_converter.py—before attempting any expensive

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →