Skip to main content
Glama
by adexltd

docs_update_content

Update content within a Google Doc by specifying the document ID and new text, enabling efficient content management and integration with Google Workspace via the MCP Google Suite server.

Instructions

Update the content of a Google Doc

Input Schema

NameRequiredDescriptionDefault
contentYesNew content
document_idYesID of the document

Input Schema (JSON Schema)

{ "properties": { "content": { "description": "New content", "type": "string" }, "document_id": { "description": "ID of the document", "type": "string" } }, "required": [ "document_id", "content" ], "type": "object" }

Implementation Reference

  • The MCP tool handler function that extracts arguments, validates them, calls DocsService.update_document_content, and returns the result.
    async def _handle_docs_update_content( self, context: GoogleWorkspaceContext, arguments: dict ) -> Dict[str, Any]: """Handle docs update content requests.""" document_id = arguments.get("document_id") content = arguments.get("content") if not document_id or content is None: raise ValueError("Both document_id and content are required") logger.debug(f"Updating document - ID: {document_id}, Content length: {len(content)}") result = await context.docs.update_document_content( document_id=document_id, content=content ) logger.debug("Document content updated successfully") return result
  • The input schema definition for the docs_update_content tool, defining properties and required fields for document_id and content.
    types.Tool( name="docs_update_content", description="Update the content of a Google Doc", inputSchema={ "type": "object", "properties": { "document_id": {"type": "string", "description": "ID of the document"}, "content": {"type": "string", "description": "New content"}, }, "required": ["document_id", "content"], }, ),
  • Dynamic registration loop that adds the tool handler to the internal registry based on the tools list and existence of _handle_<name> method.
    # Register tool handlers for tool in self._get_tools_list(): 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}")

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/adexltd/mcp-google-suite'

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