Skip to main content
Glama
by adexltd

sheets_create

Generate a new Google Sheet with a specified title and optional sheet names using MCP Google Suite, enabling direct integration with Google Workspace for efficient spreadsheet creation.

Instructions

Create a new Google Sheet

Input Schema

NameRequiredDescriptionDefault
sheetsNoSheet names
titleYesTitle of the spreadsheet

Input Schema (JSON Schema)

{ "properties": { "sheets": { "description": "Sheet names", "items": { "type": "string" }, "type": "array" }, "title": { "description": "Title of the spreadsheet", "type": "string" } }, "required": [ "title" ], "type": "object" }

Implementation Reference

  • MCP tool handler that extracts title and sheets from arguments and delegates to SheetsService.create_spreadsheet
    async def _handle_sheets_create( self, context: GoogleWorkspaceContext, arguments: dict ) -> Dict[str, Any]: """Handle sheets create requests.""" title = arguments.get("title") sheets = arguments.get("sheets", []) if not title: raise ValueError("Spreadsheet title is required") logger.debug(f"Creating spreadsheet - Title: {title}, Sheets: {sheets}") result = await context.sheets.create_spreadsheet(title=title, sheets=sheets) logger.debug(f"Spreadsheet created - ID: {result.get('spreadsheetId')}") return result
  • Tool schema defining input parameters for sheets_create: title (required), sheets (optional array of sheet names)
    types.Tool( name="sheets_create", description="Create a new Google Sheet", inputSchema={ "type": "object", "properties": { "title": {"type": "string", "description": "Title of the spreadsheet"}, "sheets": { "type": "array", "items": {"type": "string"}, "description": "Sheet names", }, }, "required": ["title"], }, ),
  • Implements spreadsheet creation using Google Sheets API v4, constructing body with title and optional sheets
    def create_spreadsheet(self, title: str, sheets: Optional[List[str]] = None) -> Dict[str, Any]: """Create a new Google Spreadsheet with optional sheets.""" try: spreadsheet_body = {"properties": {"title": title}} if sheets: spreadsheet_body["sheets"] = [ {"properties": {"title": sheet_name}} for sheet_name in sheets ] spreadsheet = self.service.spreadsheets().create(body=spreadsheet_body).execute() return {"success": True, "spreadsheet": spreadsheet} except HttpError as error: return {"success": False, **self.handle_error(error)}

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