Skip to main content
Glama

create_doc

Destructive

Create a new Google Doc with optional HTML or Markdown content, images, tables, and links, and optionally place it in a specific Drive folder.

Instructions

Create a new Google Doc, optionally with initial content.

Content is interpreted as HTML by default. Pass content_format='markdown' to supply Markdown instead (headings, bold, italic, lists, links, tables, fenced code blocks, task list items, and images are all supported). Each table is inserted where it appears in the content. A table nested inside a table cell needs HTML content; Markdown has no syntax for one. In HTML, a line break inside a tag's text is a space, as a browser shows it: use or (or Markdown) for line structure. Plain text with no tags at all keeps each line as its own paragraph.

Images: a markdown "alt" (or an HTML ) is embedded inline. src may be a local filesystem path (uploaded to Drive automatically), a "drive:<file_id>" reference to an already-uploaded file, or a public http(s) URL (used directly). A local-path or drive: image is temporarily shared anyone-with- link/reader — required, since the Docs backend fetches inline images as an anonymous HTTP request — then, by default, that share is revoked again once the image is actually embedded (revoke_sharing=False leaves it shared instead; see insert_local_images for the same tradeoff). Images inside table cells, nested tables included, are embedded the same way. A local-path image is uploaded to folder_id, else the server's default folder, else the new doc's own folder. Per-image outcomes (including any resolution or sharing failure) are returned under "images" when the content had any.

An image that can't be embedded (Docs can't fetch it, e.g. an SVG badge or an unreachable URL, or its source couldn't be resolved) is written as its alt text instead, keeping its link, or as its file name when the alt is empty. Its "images" entry then has an "error" and a "fallback_text" with that text. In a heading it's left out instead, so the heading's text, and a "#slug" link to it, stay as written; its entry has only the "error". A data: URI image can't be embedded (Docs takes an image only by URL).

A local-path or drive: image over Google Docs' ~25-megapixel or ~50MB inline-image limit fails with a clear error naming the limit it exceeds and its actual dimensions or file size, before any upload/share happens — set auto_downscale=True to resize it instead (see that arg's own docs). A public http(s) image can't be pre-validated this way; an oversized one instead fails at the embed step with a rewritten error explaining the likely cause.

Args: title: The title of the new document content: Optional content for the document body folder_id: Optional Google Drive folder ID where the document should be created. If not provided, creates in the root of My Drive. content_format: 'html' (default) or 'markdown' autolink_urls: When content_format='markdown', whether a bare http(s):// URL, www. address or email address (not already wrapped in a Markdown link or angle brackets) becomes a real hyperlink, as in GitHub Markdown (default True). Set False to leave them as plain text; to suppress just one instead of the whole call, wrap it in backticks. 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). A drive: source gets a new " (resized)" copy created alongside the original (left untouched); a local-path source uploads the resized bytes directly instead of the original file. No effect on a public http(s) image source (see above).

Returns: Information about the newly created document including its ID and web link. Includes "images" (per-image outcomes) when content contained any images. Includes "dropped_links" when a link was written as plain text instead: a list of {"url", "reason"}, where reason is "no_scheme" for a target Docs can't store as a link (a relative path such as ./guide.md or /guide.md), or "no_matching_heading" for a "#slug" anchor that no heading matches. A scheme-less target that names a host is linked over https instead: //host/x as https://host/x, www.host as https://www.host. 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). Works on Shared Drives regardless of auth method. Workaround for service accounts: create the file manually in Drive, then use write_doc_content to populate it. 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": {
      "title": "<title>"
    },
    "name": "create_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleYes
contentNo
folder_idNo
autolink_urlsNo
auto_downscaleNo
content_formatNohtml
revoke_sharingNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes far beyond the single destructiveHint annotation: it discloses the temporary anyone-with-link share required for inline images, the default revocation, the ~25MP/~50MB limit and pre-upload vs. embed-step failure behavior, per-image fallback to alt text, partial-failure returns with docId already created, and OAuth/ADC constraints for service accounts. These are exactly the side effects an agent needs before invoking a mutation.

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

Conciseness3/5

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

Front-loaded with purpose and format choice, but then runs several hundred words on nested tables, data: URIs, heading-image omission, and link dropping — much of it restating behavior that belongs to insert_local_images and to the existing output schema. The Returns section also duplicates what the output schema already provides. Information-dense but noticeably over-long for a create tool.

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 7-parameter, mutation-heavy tool with real side effects, the description covers auth requirements, sharing lifecycle, size limits, failure modes with partial results, and where setup is deferred to sibling tools. An agent has everything needed to call it correctly or to know it should not.

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%, but the Args block fully compensates: every one of the 7 parameters gets meaning, defaults and edge-case behavior (autolink_urls suppression via backticks, revoke_sharing/already_shared, auto_downscale producing a ' (resized)' copy for drive: sources but no effect on http(s), folder_id fallback chain). Nothing in the schema is left unexplained.

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

Purpose4/5

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

Opens with a specific verb+resource: 'Create a new Google Doc, optionally with initial content.' An agent immediately knows what it does and that content is optional. It does not distinguish itself from the close sibling create_doc_from_file, so a small amount of inference is left to the caller.

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?

Gives concrete routing guidance: pass content_format='markdown' to use Markdown, see insert_local_images for the same share/revoke tradeoff, and the Note explicitly redirects service accounts to create+write_doc_content. No explicit 'do not use this when' exclusion against create_doc_from_file, so it stops short of a 5.

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