Skip to main content
Glama

create_doc_from_file

Destructive

Turn a local .md or .html file into a Google Doc, parsing Markdown features and embedding referenced images inline.

Instructions

Create a Google Doc from a local .md or .html file. Not available when the server runs with LOCAL_FILE_ACCESS=off.

The file format is inferred from the extension: .md files are parsed as Markdown, .html / .htm files as HTML. The document title defaults to the filename without extension if not supplied.

Images referenced from the file (markdown "alt" or HTML ) are embedded inline the same way create_doc's own content_format='markdown' path handles them — see that tool's docstring for the src conventions, the revoke_sharing tradeoff, the auto_downscale size-limit behavior, and the alt-text fallback. A relative local image path is relative to the file's own folder, as in a README.

For .md files specifically, upload_local_file(convert=True) is a Drive-native alternative: one API call using Drive's own import converter, versus this tool's local parse-and-rebuild pipeline. This tool supports more Markdown features (tables, nested lists, task items, fenced code blocks, inline images) at the cost of more Docs API calls; Drive's importer is a single call but its fidelity is whatever Drive's own converter does.

Args: local_path: Absolute or relative path to the local file. title: Document title. Defaults to the filename stem. folder_id: Optional Google Drive folder ID for the doc and its local images. Defaults to the server's default folder, else the root of My Drive. autolink_urls: For .md files, whether a bare http(s):// URL, www. address or email address becomes a real hyperlink (default True). Set False to leave them as plain text; to suppress just one, wrap it in backticks instead. No effect on .html files. revoke_sharing: Whether a local-path/drive: image's temporary anyone:reader share is revoked again after it's embedded (default True). An image file that was already link-shared before the call keeps its link and is reported with already_shared: true. auto_downscale: Resize an oversized local-path/drive: image instead of failing it (default False) — see create_doc's own docstring.

Returns: Information about the newly created document including its ID and web link. Includes "images" (per-image outcomes) when the file contained any images. Includes "dropped_links" when a link was written as plain text instead (see create_doc). If the content can't be converted, returns {"error"} and creates no doc. If writing the content fails after the doc was created, returns {"error", "docId", "images", "dropped_links"} instead, with any temporary image share already revoked.

Note: Requires OAuth or ADC auth. Service accounts cannot create files in personal Drive (no storage quota). Check server://auth-status for your current auth method.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "local_path": "<local_path>"
    },
    "name": "create_doc_from_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNo
folder_idNo
local_pathYes
autolink_urlsNo
auto_downscaleNo
revoke_sharingNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.7/5.0
Behavior4/5

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

Annotations supply only destructiveHint=true, so the description carries the load and largely does: env-var gating, extension-based format inference, title defaulting, image embedding and temporary anyone:reader share lifecycle, auto_downscale behavior, auth requirements (OAuth/ADC; service accounts lack personal-Drive quota), and the partial-failure state where a doc exists but content writing failed with shares already revoked. It never explicitly frames the destructiveHint=true annotation (what is potentially destroyed, e.g. share state on already-shared images), leaving that inference to the reader.

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?

Front-loaded with purpose and availability gate, then alternatives, then Args, then Returns — a sensible order. It is long for a six-parameter tool and some of it delegates rather than explains ("see that tool's docstring for the src conventions... "), which forces a second lookup, and the Returns block restates what an existing output schema already provides.

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?

For a write tool with six parameters, a filesystem dependency, image side effects, and non-trivial failure modes, nothing an agent needs is missing: availability, format routing, title defaulting, share revocation, auth constraints, and both error shapes are stated. The output schema exists, so the Returns detail is surplus rather than required, but it is accurate and consistent with the described error cases.

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 description coverage is 0%, so the description must compensate, and it does with a full Args block covering all six parameters: defaults, conditional effects (autolink_urls has no effect on .html), a workaround (backtick-wrap to suppress a single link), folder_id fallback chain, and the already_shared:true reporting rule for revoke_sharing. This is meaning well beyond bare JSON types.

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?

Opens with a specific verb, resource, and input constraint: "Create a Google Doc from a local .md or .html file." It also states an availability gate (LOCAL_FILE_ACCESS=off) and explicitly distinguishes itself from create_doc's markdown path and upload_local_file(convert=True), so an agent can pick it out of a crowded sibling set without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use vs. when-to-use-something-else: upload_local_file(convert=True) is the Drive-native single-call alternative for .md, with a stated tradeoff (more Markdown feature support at the cost of more Docs API calls vs. importer fidelity). It also names the negative precondition (LOCAL_FILE_ACCESS=off) and points to create_doc for the shared image conventions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools