From 376f2ea6ae30219f7526edd3d4064af8b2803035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZhuoYang=20Wu=28=E9=98=BF=E7=A6=BB=29?= Date: Wed, 22 Jul 2026 20:18:23 +0800 Subject: [PATCH] fix(mcp): clarify create_document HTML media handling in tool schema (#13093) * fix(mcp): clarify create_document HTML media handling in tool schema * Integrate the prompt into the instructions --- server/routes/mcp/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/routes/mcp/index.ts b/server/routes/mcp/index.ts index 907159f6f5..0fe219bb96 100644 --- a/server/routes/mcp/index.ts +++ b/server/routes/mcp/index.ts @@ -67,6 +67,8 @@ Document and collection markdown support @mentions using the syntax: @[Display N Read images and attachments with the "fetch" tool by setting resource to "attachment" and passing either the attachment ID or an /api/attachments.redirect?id=... URL; the tool will return a signed URL for download. +Base64-encoded images are supported in document content for all formats. When creating a document from HTML that includes images or videos, pass the markup with format "html" — remote URLs and base64 media are imported as attachments automatically. Do not convert such HTML to markdown, and do not upload the HTML file itself as an attachment. + When asked to create a document that follows a template, use the "list_templates" tool to find a matching template; each result already includes the template body as markdown. To use it unchanged, pass its ID as templateId to "create_document" and the new document is pre-filled from it. To adapt it first, modify the returned body and pass the result as the text parameter to "create_document". Either way no separate fetch is needed.`; /**