Skip to main content
Glama

createDocumentFromTemplate

Create a new Google Doc from an existing template, optionally replacing placeholder text with key-value pairs and choosing an output folder.

Instructions

Creates a new document by copying an existing template and optionally replacing placeholder text. Provide key-value pairs in the replacements parameter to substitute template variables.

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": {
      "templateId": "<templateId>",
      "newTitle": "<newTitle>"
    },
    "name": "createDocumentFromTemplate"
  }
}

Input Schema

NameRequiredDescriptionDefault
newTitleYesTitle for the new document.
templateIdYesID of the template document to copy from.
replacementsNoKey-value pairs for text replacements in the template (e.g., {"{{NAME}}": "John Doe", "{{DATE}}": "2024-01-01"}).
parentFolderIdNoID of folder where document should be created. If not provided, creates in Drive root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose key behavior: the source template is copied rather than modified, and replacements are optional. It omits whether the new document inherits sharing/permissions from the template, what happens to placeholders that are not supplied, and what the operation returns (there is no output schema). These are meaningful gaps for a mutating tool but the core semantics are conveyed.

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?

Two short sentences, front-loaded with the core action, and no filler. The second sentence is close to redundant with the schema's replacements description, but it usefully signals the parameter at skim level.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-parameter mutation with a nested object and no annotations or output schema, the definition covers the copy-and-substitute model but leaves return values, permission inheritance, and missing-placeholder behavior unspecified. It is minimally sufficient to invoke correctly but not fully complete.

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?

Schema coverage is 100%, including per-parameter descriptions and an example object for replacements, so the schema does the heavy lifting. The description's sentence about key-value pairs restates the schema's replacements description rather than adding new meaning such as escaping rules or case sensitivity. Baseline 3 applies.

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?

The description gives a specific verb and resource combination: 'Creates a new document by copying an existing template' plus optional placeholder substitution. That is unambiguous about what the tool does. It does not, however, differentiate itself from siblings such as createDocument or copyFile, which overlap in domain and would be the natural confusion points.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the mention of template variables suggests this is for templated document generation. There is no explicit when-to-use versus createDocument/copyFile, and no prerequisites (for example template accessibility) are described. The guidance is adequate but requires the agent to infer the selection criteria.

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