Skip to main content
Glama
penysho

Google Docs MCP Server

by penysho

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

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

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);
    	}
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

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

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