Skip to main content
Glama

read_sheet

Extract data from specific ranges in Google Sheets to access spreadsheet information for analysis or integration.

Instructions

スプレッドシートの指定された範囲のデータを読み取ります

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spreadsheetIdYesスプレッドシートのID
rangeYes読み取る範囲(例: 'Sheet1!A1:C10')

Implementation Reference

  • The main handler function that executes the read_sheet tool by fetching the specified range of values from a Google Spreadsheet using the Google Sheets API v4 and returning the data as JSON.
    async function readSheet(spreadsheetId: string, range: string) {
      const authClient = await auth.getClient();
      const sheets = google.sheets({ version: "v4", auth: authClient as any });
    
      const response = await sheets.spreadsheets.values.get({
        spreadsheetId,
        range,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(response.data.values || [], null, 2),
          },
        ],
      };
    }
  • The tool definition including name, description, and input schema for validating parameters spreadsheetId and range.
    {
      name: "read_sheet",
      description: "スプレッドシートの指定された範囲のデータを読み取ります",
      inputSchema: {
        type: "object",
        properties: {
          spreadsheetId: {
            type: "string",
            description: "スプレッドシートのID",
          },
          range: {
            type: "string",
            description: "読み取る範囲(例: 'Sheet1!A1:C10')",
          },
        },
        required: ["spreadsheetId", "range"],
      },
    },
  • src/index.ts:160-162 (registration)
    The dispatch case in the CallToolRequestSchema handler that registers and invokes the readSheet function for the 'read_sheet' tool.
    case "read_sheet":
      return await readSheet(args.spreadsheetId as string, args.range as string);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states the tool reads data, it doesn't describe what happens on errors (e.g., invalid spreadsheetId or range), whether it requires specific permissions, the format of returned data, or any rate limits. For a read operation with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is a single, efficient sentence in Japanese that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple read operation and front-loads the core functionality.

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

Completeness2/5

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

Given the tool has no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't address what data is returned (e.g., array of values, formatting), error handling, or usage context compared to siblings. For a read tool with 2 parameters, more behavioral context would be helpful.

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

Parameters3/5

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

The schema description coverage is 100%, with both parameters clearly documented in the input schema (spreadsheetId and range with examples). The description adds no additional semantic context beyond what's in the schema, such as explaining range syntax variations or spreadsheetId sourcing. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('読み取ります' - reads) and resource ('スプレッドシートの指定された範囲のデータ' - data from a specified range in a spreadsheet). It distinguishes from siblings like 'append_row' or 'write_sheet' by focusing on reading rather than modifying data. However, it doesn't explicitly differentiate from 'get_sheet_info' which might also retrieve spreadsheet data.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_sheet_info' (which might retrieve metadata rather than cell data) or 'write_sheet' (for writing data). There's no mention of prerequisites, error conditions, or typical use cases beyond the basic function.

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

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