Skip to main content
Glama

get_sheet_info

Retrieve basic information about a Google Spreadsheet using its ID, including sheet details and metadata.

Instructions

スプレッドシートの基本情報を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spreadsheetIdYesスプレッドシートのID

Implementation Reference

  • The handler function `getSheetInfo` that fetches spreadsheet metadata including title and list of sheets with their properties using Google Sheets API v4.
    async function getSheetInfo(spreadsheetId: string) { const authClient = await auth.getClient(); const sheets = google.sheets({ version: "v4", auth: authClient as any }); const response = await sheets.spreadsheets.get({ spreadsheetId, }); const sheetsInfo = response.data.sheets?.map((sheet) => ({ title: sheet.properties?.title, sheetId: sheet.properties?.sheetId, rowCount: sheet.properties?.gridProperties?.rowCount, columnCount: sheet.properties?.gridProperties?.columnCount, })); return { content: [ { type: "text", text: JSON.stringify( { title: response.data.properties?.title, sheets: sheetsInfo, }, null, 2 ), }, ], }; }
  • src/index.ts:109-122 (registration)
    Tool registration in the `tools` array used by ListToolsRequestHandler, defining name, description, and input schema.
    { name: "get_sheet_info", description: "スプレッドシートの基本情報を取得します", inputSchema: { type: "object", properties: { spreadsheetId: { type: "string", description: "スプレッドシートのID", }, }, required: ["spreadsheetId"], }, },
  • src/index.ts:177-178 (registration)
    Dispatch case in the CallToolRequestHandler switch statement that invokes the getSheetInfo handler.
    case "get_sheet_info": return await getSheetInfo(args.spreadsheetId as string);
  • Input schema definition for the get_sheet_info tool, specifying the required spreadsheetId parameter.
    inputSchema: { type: "object", properties: { spreadsheetId: { type: "string", description: "スプレッドシートのID", }, }, required: ["spreadsheetId"], },

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