Skip to main content
Glama

read_google_document

Extract content from a Google Docs document using its unique document ID. Enables AI models to retrieve text and data for processing or analysis through the Google Docs MCP Server.

Input Schema

NameRequiredDescriptionDefault
documentIdYes読み取るGoogle DocsドキュメントのID

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "documentId": { "description": "読み取るGoogle DocsドキュメントのID", "type": "string" } }, "required": [ "documentId" ], "type": "object" }

Implementation Reference

  • The executeInternal method implements the tool's core logic: validates args, logs, fetches GoogleDocsService, reads document content, logs success, returns response or throws error.
    protected async executeInternal(args: { documentId: string; }): Promise<McpToolResponse> { // 引数検証 this.validateArgs(args, ["documentId"]); const { documentId } = args; this.logger.info(`ドキュメント読み取り開始: ${documentId}`); try { // Google Docsサービスを取得 const docsService = await this.serviceContainer.getGoogleDocsService(); // ドキュメント内容を取得 const content = await docsService.readDocumentContent(documentId); this.logger.info( `ドキュメント読み取り完了: ${documentId}, 文字数: ${content.length}`, ); return this.createSuccessResponse(content); } catch (error) { this.logger.error(`ドキュメント読み取りエラー: ${documentId}`, error); throw error; // BaseMcpToolでエラーハンドリング } }
  • Defines the input schema using Zod for the documentId parameter.
    get schema() { return { documentId: z.string().describe("読み取るGoogle DocsドキュメントのID"), }; }
  • Registers the ReadDocumentTool instance in the ToolRegistry's registerDefaultTools method.
    this.registerTool(new ReadDocumentTool(this.serviceContainer));
  • The class constructor sets the tool name 'read_google_document' via BaseMcpTool super call.
    export class ReadDocumentTool extends BaseMcpTool { constructor(serviceContainer: IServiceContainer) { super("read_google_document", serviceContainer); }

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/penysho/docs-mcp'

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