Skip to main content
Glama
adexltd

MCP Google Suite

by adexltd

docs_get_content

Retrieve content from Google Docs using document ID to access and work with text data in Google Workspace.

Instructions

Get the contents of a Google Doc

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesID of the document

Implementation Reference

  • The handler function that implements the 'docs_get_content' tool logic. It validates the document_id argument and delegates to DocsService.get_document_content to fetch the document content.
    async def _handle_docs_get_content(
        self, context: GoogleWorkspaceContext, arguments: dict
    ) -> Dict[str, Any]:
        """Handle docs get content requests."""
        document_id = arguments.get("document_id")
    
        if not document_id:
            raise ValueError("Document ID is required")
    
        logger.debug(f"Getting document content - ID: {document_id}")
        result = await context.docs.get_document_content(document_id=document_id)
        logger.debug("Document content retrieved successfully")
        return result
  • Input schema definition for the 'docs_get_content' tool, requiring a 'document_id' string parameter.
    types.Tool(
        name="docs_get_content",
        description="Get the contents of a Google Doc",
        inputSchema={
            "type": "object",
            "properties": {
                "document_id": {"type": "string", "description": "ID of the document"}
            },
            "required": ["document_id"],
        },
    ),
  • Code block that dynamically registers the handler for 'docs_get_content' (and other tools) by matching _handle_{tool.name} and adding to _tool_registry.
    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}")

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