Skip to main content
Glama

create_sheet

Add a new sheet to an existing Google Spreadsheet by specifying the spreadsheet ID and desired sheet name.

Instructions

新しいシートを作成します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spreadsheetIdYesスプレッドシートのID
sheetNameYes作成するシート名

Implementation Reference

  • The core handler function that executes the creation of a new sheet in the specified Google Spreadsheet using the Google Sheets API's batchUpdate method with an addSheet request.
    async function createSheet(spreadsheetId: string, sheetName: string) {
      const authClient = await auth.getClient();
      const sheets = google.sheets({ version: "v4", auth: authClient as any });
    
      const response = await sheets.spreadsheets.batchUpdate({
        spreadsheetId,
        requestBody: {
          requests: [
            {
              addSheet: {
                properties: {
                  title: sheetName,
                },
              },
            },
          ],
        },
      });
    
      return {
        content: [
          {
            type: "text",
            text: `シート "${sheetName}" が正常に作成されました。`,
          },
        ],
      };
    }
  • Defines the tool schema for 'create_sheet', including the name, description, and inputSchema with required parameters spreadsheetId (string) and sheetName (string). This is part of the tools array used for tool listing.
    {
      name: "create_sheet",
      description: "新しいシートを作成します",
      inputSchema: {
        type: "object",
        properties: {
          spreadsheetId: {
            type: "string",
            description: "スプレッドシートのID",
          },
          sheetName: {
            type: "string",
            description: "作成するシート名",
          },
        },
        required: ["spreadsheetId", "sheetName"],
      },
    },
  • src/index.ts:180-182 (registration)
    The switch case in the main CallToolRequestSchema handler that registers and dispatches the 'create_sheet' tool call to the createSheet function.
    case "create_sheet":
      return await createSheet(args.spreadsheetId as string, args.sheetName as string);

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/Kyohei-9841/google-spreadsheet-MCP'

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