Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

create_doc

Generate and customize Google Docs by specifying a title and optional content using the Google Workspace MCP Server, returning a document ID and link for immediate access.

Instructions

Creates a new Google Doc and optionally inserts initial content.

Returns:
    str: Confirmation message with document ID and link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNo
serviceYes
titleYes
user_google_emailYes

Implementation Reference

  • The core handler function for the 'create_doc' tool. It creates a new Google Document using the Google Docs API, optionally inserts initial content at index 1, generates a shareable link, and returns a confirmation message with the document ID.
    async def create_doc(
        service: Any,
        user_google_email: str,
        title: str,
        content: str = '',
    ) -> str:
        """
        Creates a new Google Doc and optionally inserts initial content.
    
        Returns:
            str: Confirmation message with document ID and link.
        """
        logger.info(f"[create_doc] Invoked. Email: '{user_google_email}', Title='{title}'")
    
        doc = await asyncio.to_thread(service.documents().create(body={'title': title}).execute)
        doc_id = doc.get('documentId')
        if content:
            requests = [{'insertText': {'location': {'index': 1}, 'text': content}}]
            await asyncio.to_thread(service.documents().batchUpdate(documentId=doc_id, body={'requests': requests}).execute)
        link = f"https://docs.google.com/document/d/{doc_id}/edit"
        msg = f"Created Google Doc '{title}' (ID: {doc_id}) for {user_google_email}. Link: {link}"
        logger.info(f"Successfully created Google Doc '{title}' (ID: {doc_id}) for {user_google_email}. Link: {link}")
        return msg
  • The @server.tool() decorator registers the create_doc function as an MCP tool.
    @server.tool()
  • Decorators for error handling specific to 'create_doc' tool and required auth scopes for Docs API write access.
    @handle_http_errors("create_doc", service_type="docs")
    @require_google_service("docs", "docs_write")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the creation action and return format ('Confirmation message with document ID and link'), but lacks critical details: permissions required (e.g., Google Drive access), whether the document is shared or private, error conditions, or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 appropriately sized and front-loaded: the first sentence states the core functionality, and the second provides return value information. Both sentences earn their place by adding value. However, it could be slightly more structured by separating usage notes from return details.

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

Completeness2/5

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

Given the complexity (a mutation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema), the description is incomplete. It covers the basic action and return format but misses parameter explanations, behavioral context (e.g., authentication, error handling), and usage guidelines. For a tool that creates resources in a Google ecosystem, this leaves too many gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter details. The description only vaguely references 'initial content' for the 'content' parameter, but doesn't explain the purpose of 'service', 'title', or 'user_google_email'. It fails to compensate for the lack of schema documentation, leaving most parameters semantically unclear.

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 clearly states the tool's purpose: 'Creates a new Google Doc and optionally inserts initial content.' It specifies the verb ('Creates') and resource ('Google Doc'), and distinguishes it from sibling tools like 'create_sheet' or 'create_spreadsheet' by focusing on document creation. However, it doesn't explicitly differentiate from 'create_form' or 'create_event' beyond the resource type.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication needs), compare it to similar tools like 'create_sheet', or indicate scenarios where it's preferred. The only implied usage is for creating Google Docs with optional content, but no explicit context or exclusions are provided.

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

Related 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/taylorwilsdon/google_workspace_mcp'

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