Skip to main content
Glama
fabiolenine

mem0-mcp-selfhosted

add_document

Asynchronously ingest a PDF or image, extract text per page, chunk it, and extract memorable facts with document provenance. Returns a task ID for polling progress.

Instructions

Ingest a PDF or image asynchronously: extract text per page (digital PDF via poppler; scanned pages and images via a local vision model), chunk, and extract memorable facts with document/page provenance.

    Returns immediately with {"status": "queued", task_id, pages,
    chunks_estimate, estimated_wait_s} — a large document takes many
    minutes; poll memory_task_status(task_id) for chunks_done progress and
    the final memory_ids. Re-submitting the same file returns
    {"status": "already_ingested"} unless force=true. There is NO
    synchronous fallback: if the queue is unavailable the call errors.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoRe-ingest even if this exact document (same bytes + scope) was already ingested.
inferNoIf true (default), the LLM extracts facts from each chunk; if false, raw chunks are stored as-is.
run_idNoRun scope identifier.
user_idNoUser scope identifier. Defaults to MEM0_USER_ID.
agent_idNoAgent scope identifier.
filenameNoDisplay name stored as source_doc provenance. Defaults to the file's basename.
metadataNoExtra metadata stored on every memory extracted from this document.
file_pathYesAbsolute path on the server host (must live under MEM0_DOC_PATH_ALLOWLIST, default $HOME) of a PDF or an image (PNG/JPEG). Scanned PDFs and images need vision on (MEM0_ENABLE_VISION).
enable_graphNoGraph extraction per chunk. Defaults to FALSE for documents (expensive and noisy).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: asynchronous operation, immediate return with status, polling mechanism, deduplication logic, error conditions (queue unavailable), and technical details of text extraction (poppler, vision model).

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

Conciseness4/5

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

The description is concise (4-5 sentences) and front-loaded with the purpose. However, it includes some implementation details (poppler, vision model) that may not be essential for tool selection.

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?

Given the tool's complexity (9 parameters, async, polling, dedup), and absence of annotations and output schema (though return format is described), the description is complete. It covers inputs, process, response, polling, duplicate handling, and failure modes.

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, so the description adds minimal meaning beyond what the schema already provides. It mentions 'force=true' and 'file_path' but does not elaborate on other parameters.

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 clearly states the tool's purpose: ingest PDF or image, extract text per page, chunk, and extract facts. It specifies the types of inputs (PDF/image) and distinguishes from sibling tools like add_memory by focusing on document ingestion.

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 provides clear context on how to use the tool (asynchronous, poll results, handle duplicates) and mentions no synchronous fallback. However, it does not explicitly compare with sibling tools or specify when not to use it.

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/fabiolenine/mcp_deepmen0'

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