Skip to main content
Glama
adexltd

MCP Google Suite

by adexltd

docs_create

Create a new Google Doc with a title and optional initial content through Google Workspace integration.

Instructions

Create a new Google Doc

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the document
contentNoInitial content

Implementation Reference

  • The primary MCP tool handler for 'docs_create'. Extracts title and optional content from input arguments, validates title, logs the action, calls DocsService.create_document, and returns the result.
    async def _handle_docs_create(
        self, context: GoogleWorkspaceContext, arguments: dict
    ) -> Dict[str, Any]:
        """Handle docs create requests."""
        title = arguments.get("title")
        content = arguments.get("content")
    
        if not title:
            raise ValueError("Document title is required")
    
        logger.debug(f"Creating document - Title: {title}, Content length: {len(content or '')}")
        result = await context.docs.create_document(title=title, content=content)
        logger.debug(f"Document created - ID: {result.get('documentId')}")
        return result
  • Input schema definition for the 'docs_create' tool, specifying title as required string and content as optional string.
    types.Tool(
        name="docs_create",
        description="Create a new Google Doc",
        inputSchema={
            "type": "object",
            "properties": {
                "title": {"type": "string", "description": "Title of the document"},
                "content": {"type": "string", "description": "Initial content"},
            },
            "required": ["title"],
        },
    ),
  • Dynamic registration code that maps the 'docs_create' tool name to its handler '_handle_docs_create' in the tool registry.
    handler_name = f"_handle_{tool.name}"
    if hasattr(self, handler_name):
        handler = getattr(self, handler_name)
        self._tool_registry[tool.name] = handler
        logger.debug(f"Registered handler for {tool.name}")
  • Helper method in DocsService that performs the actual Google Docs API call to create a new document and optionally updates it with initial content.
    async def create_document(self, title: str, content: Optional[str] = None) -> Dict[str, Any]:
        """Create a new Google Doc with optional initial content."""
        try:
            service = await self.get_service()
            doc = await asyncio.to_thread(service.documents().create(body={"title": title}).execute)
    
            if content:
                await self.update_document_content(doc["documentId"], content)
    
            return {"success": True, "document": doc}
        except HttpError as error:
            return {"success": False, **self.handle_error(error)}

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create' which implies a write/mutation operation, but doesn't mention authentication requirements, rate limits, whether the operation is idempotent, or what happens on success/failure. This leaves significant behavioral gaps for a mutation tool.

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

Conciseness5/5

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

The description is a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized for a simple creation tool and gets straight to the point.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation (e.g., returns a document ID, URL, or metadata), error conditions, or integration with sibling tools. The agent lacks critical context for proper 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 100%, so the schema already documents both parameters ('content' and 'title') adequately. The description doesn't add any parameter-specific context beyond what's in the schema, such as formatting examples or constraints, meeting the baseline for high schema coverage.

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 verb ('Create') and resource ('Google Doc'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'sheets_create' or 'drive_create_folder' beyond specifying the resource type, which prevents a perfect score.

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 like 'sheets_create' or 'drive_create_folder'. There's no mention of prerequisites, context for creation, or comparison with sibling tools, leaving the agent with minimal usage direction.

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