Skip to main content
Glama
ZatesloFL

Google Workspace MCP Server

by ZatesloFL

create_doc

Generate a new Google Doc with a specified title and optional initial content. Returns a confirmation message including the document ID and link for easy 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
titleYes
user_google_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'create_doc' MCP tool. It creates a new Google Document using the Docs API with the given title and optional initial content, then returns the document ID and edit link.
    @server.tool()
    @handle_http_errors("create_doc", service_type="docs")
    @require_google_service("docs", "docs_write")
    async def create_doc(
        service,
        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()
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral context. It mentions the creation action and optional content insertion, but doesn't disclose permissions needed (Google Docs API access), whether the document is created in a specific location (Drive root vs. folder), rate limits, or what happens if creation fails. The return format is mentioned but without details about error cases.

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 concise sentences that efficiently state the core functionality and return value. The first sentence clearly states the primary action with optional feature, and the second describes the return format. No wasted words, though it could be slightly more structured with bullet points for parameters.

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?

Given a mutation tool with no annotations, 3 parameters with 0% schema coverage, and an output schema present, the description provides basic completeness but with significant gaps. It covers the core action and return format (output schema handles details), but misses important context about permissions, error handling, and parameter semantics that would be needed for reliable tool invocation.

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 description coverage is 0%, so the description must compensate but only partially does. It explains that 'content' is 'optional initial content' which adds meaning beyond the schema's generic 'Content' title, but provides no context for 'title' or 'user_google_email' parameters. With 3 parameters and low schema coverage, this leaves significant gaps in understanding parameter purposes.

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 action ('Creates a new Google Doc') and resource ('Google Doc'), with additional detail about optional content insertion. It distinguishes from siblings like 'create_drive_file' by specifying document type, though not explicitly contrasting with 'create_spreadsheet' or 'create_presentation' which are also Google Workspace creation tools.

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?

No guidance on when to use this tool versus alternatives like 'create_drive_file' (general file creation) or other Google Doc-specific tools. The description mentions optional content insertion but doesn't provide context about when this is preferable over creating an empty document and using 'insert_doc_elements' later.

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

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/ZatesloFL/google_workspace_mcp'

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