Skip to main content
Glama
lmdat

@lmdat/google-sheets-oauth-mcp

by lmdat

@lmdat/google-sheets-oauth-mcp

Local MCP server (Node.js + TypeScript) đọc/ghi/tạo Google Sheets, kèm tạo chart, thông qua OAuth — server hoạt động đại diện chính tài khoản Google đang đăng nhập, không cần share thủ công từng file như cách dùng Service Account.

Yêu cầu

  • Node.js 18+

  • Tài khoản Google (cá nhân hoặc Workspace)

  • 1 project trên Google Cloud Console

Related MCP server: google-workspace-mcp-server

1. Setup Google Cloud Console

  1. Vào console.cloud.google.com, tạo hoặc chọn 1 project.

  2. APIs & Services → Library → enable Google Sheets APIGoogle Drive API.

  3. APIs & Services → OAuth consent screen:

    • User type: chọn External (tài khoản Gmail cá nhân chỉ có lựa chọn này; Internal chỉ dành cho tài khoản Google Workspace).

    • Điền App name và support email (giá trị tùy ý, không ảnh hưởng chức năng).

    • Sau khi tạo, vào tab Audience → bấm Publish App → Confirm. Bước này nên làm ngay từ đầu — nếu bỏ qua, app ở trạng thái Testing và refresh token sẽ tự hết hạn sau 7 ngày.

  4. APIs & Services → Credentials → Create Credentials → OAuth client ID:

    • Application type: Desktop app (không chọn Web application).

    • Lưu lại Client IDClient secret hiện ra sau khi tạo.

2. Cài đặt

npm install

3. Build

Lệnh

Output

Dùng khi nào

npm run build

build/index.js + build/auth.js

Phát triển/debug, code dễ đọc

npm run build:min

dist/index.js (1 file, đã gộp + minify)

Dùng để chạy thật / publish

npm run build:obfuscate

dist/index.js (đã obfuscate)

Muốn code khó đọc hơn khi chia sẻ (không phải mã hóa, chỉ gây khó đọc)

Build tối thiểu 1 lần trước khi cấu hình opencode ở bước tiếp theo.

4. Cấu hình credential

export GOOGLE_OAUTH_CLIENT_ID="xxx.apps.googleusercontent.com"
export GOOGLE_OAUTH_CLIENT_SECRET="GOCSPX-xxx"

Hoặc khai báo trực tiếp trong config opencode ở bước 5 (mục environment), không cần export ra shell.

Biến môi trường optional:

Var

Default

Khi nào cần đổi

GOOGLE_OAUTH_REDIRECT_PORT

53682

Port bị chương trình khác chiếm dụng

MCP_GSHEETS_TOKEN_DIR

~/.mcp-google-sheets

Muốn lưu file token ở vị trí khác

5. Cấu hình trong opencode

Có 2 cách trỏ tới MCP server, chọn 1 trong 2.

Cách 1 — Trỏ trực tiếp đến file (đơn giản, không cần publish)

"google-sheets": {
  "type": "local",
  "command": [
    "node",
    "/duong-dan-tuyet-doi/google-sheets-oauth-mcp/dist/index.js"
  ],
  "enabled": true,
  "environment": {
    "GOOGLE_OAUTH_CLIENT_ID": "xxx.apps.googleusercontent.com",
    "GOOGLE_OAUTH_CLIENT_SECRET": "GOCSPX-xxx"
  }
}

Thay /duong-dan-tuyet-doi/... bằng đường dẫn thật trên máy đang chạy opencode. Phù hợp khi chỉ dùng trên 1 máy, không cần chia sẻ cho người khác.

Cách 2 — Dùng qua npm package (cần publish trước)

Nếu package đã được publish lên npm registry (xem mục 8), cấu hình gọn hơn, không cần biết đường dẫn cụ thể trên máy:

"google-sheets": {
  "type": "local",
  "command": [
    "npx",
    "-y",
    "@lmdat/google-sheets-oauth-mcp@latest"
  ],
  "enabled": true,
  "environment": {
    "GOOGLE_OAUTH_CLIENT_ID": "xxx.apps.googleusercontent.com",
    "GOOGLE_OAUTH_CLIENT_SECRET": "GOCSPX-xxx"
  }
}

6. Lần đầu sử dụng — cần đăng nhập 1 lần

Khi opencode gọi tool đầu tiên (ví dụ drive_list_spreadsheets), server sẽ:

  1. Tự mở browser (hoặc in URL ra log nếu máy không tự mở được trình duyệt — copy URL đó dán vào browser thủ công).

  2. Đăng nhập Google và bấm Allow.

  3. Browser hiện thông báo đăng nhập thành công → token được lưu vào ~/.mcp-google-sheets/token.json.

Từ lần sau không cần đăng nhập lại — token tự refresh ngầm.

Flow này cần trình duyệt trên cùng máy đang chạy MCP server, vì server mở 1 HTTP server tạm trên 127.0.0.1 để nhận redirect từ Google. Nếu server được chạy trên môi trường không có giao diện (ví dụ VPS headless), flow này sẽ không hoạt động và cần cách xác thực khác.

7. Đổi scope sau này → phải đăng nhập lại

Nếu chỉnh sửa danh sách scope trong src/auth.ts, cần xóa file token cũ (~/.mcp-google-sheets/token.json) rồi chạy lại để đăng nhập lại. Google gắn cố định scope vào thời điểm cấp quyền — token cũ không tự nhận thêm quyền mới.

8. (Tùy chọn) Publish lên npm để dùng theo Cách 2

npm login                       # nếu chưa đăng nhập npm
npm run build:min
npm publish --access public     # bắt buộc thêm flag này nếu dùng scoped package (@username/...)

Kiểm tra trước khi publish thật:

npm run build:min && npm pack --dry-run

9. Danh sách tool

Tool

Chức năng

drive_list_spreadsheets

Tìm sheet theo tên (Drive API), không cần biết ID trước

sheets_create

Tạo sheet mới, tùy chọn đặt vào folder cụ thể và tạo sẵn nhiều tab

sheets_read

Đọc 1 range, trả về mảng 2 chiều

sheets_write

Ghi đè giá trị trong 1 range

sheets_append

Thêm hàng vào cuối bảng dữ liệu hiện có

sheets_clear

Xóa giá trị trong 1 range (giữ nguyên format)

sheets_list_tabs

Liệt kê tên các tab trong file

sheets_create_chart

Tạo chart COLUMN/BAR/LINE/AREA/SCATTER/PIE từ dữ liệu có sẵn

sheets_create_candlestick_chart

Tạo chart nến (OHLC) cho dữ liệu giá

sheets_write_json

Ghi dữ liệu JSON vào Google Sheet

sheets_append_json

Tự động append dữ liệu JSON vào Google Sheet (tự tạo file/tab nếu chưa có)

Mọi tool đọc/ghi (trừ drive_list_spreadsheetssheets_create) đều cần spreadsheet_id — lấy từ URL của sheet hoặc dùng drive_list_spreadsheets để tìm theo tên.

Lưu ý khi dùng 2 tool tạo chart

  • Mọi range truyền vào phải ghi đủ tên sheet, theo dạng "TenSheet!A2:E50". Range thiếu tên sheet không được hỗ trợ.

  • sheets_create_candlestick_chart yêu cầu data_rangeđúng 5 cột liên tiếp, theo thứ tự cố định: Date, Open, High, Low, Close — đúng convention chuẩn của Google Sheets khi chọn data bằng tay qua Insert > Chart. Sai thứ tự cột (ví dụ đảo Open/Close) không gây ra lỗi — chart vẫn được tạo nhưng màu nến hiển thị ngược nghĩa, cần tự kiểm tra bằng mắt sau khi tạo.

  • anchor_cell (vị trí đặt chart) là optional ở cả 2 tool — nếu không truyền, chart tự đặt ngay bên phải vùng dữ liệu nguồn.

10. Scope OAuth đang sử dụng

const SCOPES = [
  "https://www.googleapis.com/auth/spreadsheets",    // đọc/ghi/tạo sheet
  "https://www.googleapis.com/auth/drive.readonly",  // tìm/list toàn bộ sheet user có quyền
  "https://www.googleapis.com/auth/drive.file",       // move file mới tạo vào folder
];

drive.file chỉ cho phép truy cập file do chính app này tạo ra (hoặc do user chọn qua Picker) — không đủ để di chuyển hay sửa file cũ không phải do app tạo. Vì vậy cần thêm drive.readonly riêng cho việc tìm/list sheet có sẵn. Scope drive (toàn quyền) không được sử dụng vì rộng hơn mức cần thiết.

11. Ví dụ câu lệnh trong opencode

Tìm sheet có chữ "Ngân sách"
Tạo sheet mới tên "Theo dõi cổ phiếu 2026" với 2 tab: Giao dịch, Tổng hợp
Đọc A1:E20 trong tab Giao dịch của sheet [tên/id vừa tạo]
Append 1 hàng vào tab Giao dịch: 2026-06-25, VNM, Buy, 1000, 42500
Tạo candlestick chart "Giá VNM Q2 2026" từ range Data!A2:E50

12. So sánh với bản dùng Service Account

Service Account

OAuth (bản này)

Truy cập sheet có sẵn

Phải share thủ công email service account

Tự thấy mọi sheet user đã có quyền

Tìm sheet theo tên

Không hỗ trợ

Có, quadrive_list_spreadsheets

File mới tạo

Thuộc Drive của service account

Thuộc Drive của chính user

Setup ban đầu

Nhanh, không cần đăng nhập trình duyệt

Cần đăng nhập trình duyệt 1 lần, cấu hình OAuth consent screen

Phù hợp

Vài sheet cố định, biết trước ID

Cần linh hoạt nhiều sheet, tạo/tìm theo tên

Available Tools

9 tools
drive_list_spreadsheetsTìm Google Sheet theo tênB

List các Google Sheet trong Drive của chính user đang login (không cần share thủ công, vì OAuth đại diện chính user đó). Dùng để tìm spreadsheet_id theo tên thay vì copy URL. Trả về JSON array, mỗi item: {name, id, url, modifiedTime, owner}.

ParametersJSON Schema
NameRequiredDescriptionDefault
max_resultsNo
name_containsNoLọc theo tên file chứa chuỗi này (vd "Ngân sách"). Bỏ trống để lấy gần đây nhất.

TDQS

B3.2/5.0
Behavior3/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. It discloses that the tool lists only the current user's Drive and returns a JSON array with specific fields. However, it does not mention limitations like pagination, error handling, or behavior when no results.

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

Conciseness4/5

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

The description is concise, consisting of three sentences that flow logically: scope, use case, and return format. No unnecessary words, but it could be better structured with explicit parameter details.

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

Completeness3/5

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

For a simple listing tool with two optional parameters and no output schema, the description covers scope, return fields, and use case. However, it omits details on max_results behavior, filtering semantics (e.g., case sensitivity), and ordering, which are needed for full completeness.

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

Parameters2/5

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

Schema description coverage is 50% (only name_contains has a schema description). The tool description adds overall purpose but does not explain the max_results parameter (e.g., default, max, or ordering). The description does not significantly enhance parameter understanding beyond the schema.

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 tool lists Google Sheets in the user's own Drive and is used to find spreadsheet_id by name. It differentiates from copying URLs, but does not explicitly distinguish from sibling tools, though no other listing tool exists among siblings.

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

Usage Guidelines3/5

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

The description provides a specific use case (finding spreadsheet_id by name) but no explicit guidance on when not to use or alternatives. Sibling tools are different actions, so confusion is low, but the guidance is limited.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_appendAppend hàng mới vào Google SheetA

Thêm hàng mới vào cuối bảng dữ liệu hiện có (không đè dữ liệu cũ).

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeYesRange theo A1 notation, ví dụ "Sheet1 (chỉ cần tên sheet)". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet.
valuesYesMảng 2 chiều, mỗi mảng con là 1 hàng cần thêm.
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.
value_input_optionNoUSER_ENTERED

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the non-destructive nature (does not overwrite), but fails to disclose other behavioral traits like authentication needs, error conditions, or performance implications.

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, well-structured sentence that front-loads the key action and constraint, containing no unnecessary words.

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

Completeness3/5

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

Given the tool's simplicity and absence of output schema, the description provides the essential behavior but lacks details on error handling, prerequisites, or response format, leaving some gaps.

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?

With 75% schema description coverage, the description adds no additional meaning beyond the schema. It does not explain parameter relationships or usage context, so baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the verb 'Thêm' (append) and resource 'hàng mới vào cuối bảng dữ liệu hiện có' (new rows to the end of existing data), and explicitly distinguishes from overwriting by saying 'không đè dữ liệu cũ'.

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

Usage Guidelines3/5

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

The description implies usage for appending without overwriting, which helps differentiate from sheets_write, but lacks explicit when-to-use or when-not-to-use guidance and does not mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_clearXóa giá trị trong 1 rangeA

Xóa nội dung (giá trị) trong 1 range, không xóa format/border.

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeYesRange theo A1 notation, ví dụ "Sheet1!A2:D100". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet.
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that only values are cleared and formatting is preserved, which is a key behavioral trait. However, it omits details about error handling, return values, or side effects like clearing formulas.

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 concise sentence that front-loads the action. Every word contributes meaning, and there is no redundancy or irrelevant detail.

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

Completeness3/5

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

For a simple two-parameter clear operation, the description covers the core functionality. However, it does not clarify what the tool returns upon success or failure, which could be important for an agent despite the lack of an output schema.

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?

Schema coverage is 100%, so the description adds no new parameter information beyond what the schema already provides. The description simply restates the overall action without enhancing parameter understanding.

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

Purpose5/5

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

The description clearly states that the tool clears values in a range without affecting format/border, and the verb 'Xóa' (clear) is specific. It distinguishes itself from siblings like sheets_write and sheets_append by focusing on clearing content only.

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

Usage Guidelines3/5

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

The description implies usage for clearing values while preserving formatting, but it does not explicitly state when to use this tool versus alternatives like sheets_write or sheets_append. No prerequisites or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_createTạo Google Sheet mớiA

Tạo 1 spreadsheet mới (rỗng). Mặc định nằm ở root My Drive của account đang login. Truyền folder_id nếu muốn đặt luôn vào 1 folder cụ thể.

ParametersJSON Schema
NameRequiredDescriptionDefault
titleYesTên file Google Sheet mới.
folder_idNoID folder Drive muốn đặt file vào (lấy từ URL folder trên Drive). Bỏ trống -> file nằm ở root My Drive.
sheet_titlesNoTên các tab muốn tạo sẵn, ví dụ ["Thu","Chi"]. Bỏ trống -> 1 tab mặc định "Sheet1".

TDQS

A3.8/5.0
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states the spreadsheet is created empty. No details on auth needs, rate limits, or effects on existing data (though creation is safe). Minimal transparency.

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?

Two sentences, no fluff. The main action is front-loaded in the first sentence. Every word earns its place.

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

Completeness4/5

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

For a simple creation tool with 3 parameters and no output schema, the description covers purpose, default behavior, and parameter usage. It doesn't detail the return value, but that's acceptable given the tool's simplicity.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by specifying default root location, how to obtain folder_id, and an example for sheet_titles. This enhances understanding beyond the schema.

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

Purpose5/5

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

The title and description clearly state it creates a new Google Sheet. The verb 'Tạo' (Create) and resource 'spreadsheet mới' are specific. Among sibling tools like sheets_append, sheets_read, etc., it uniquely serves creation, so it's well-distinguished.

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

Usage Guidelines3/5

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

The description explains default placement in root My Drive and when to use folder_id for alternative location. However, it doesn't provide when-not-to-use, alternatives, or prerequisites, limiting guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_create_candlestick_chartTạo candlestick chart (nến) trong Google SheetA

Tạo chart nến cho dữ liệu giá (OHLC). data_range PHẢI có ĐÚNG 5 cột liên tiếp theo thứ tự cố định: Date, Open, High, Low, Close — đúng convention chuẩn của Google Sheets (giống khi tự chọn data trên Insert > Chart bằng tay). Ví dụ: "Data!A2:E50" (không gồm dòng header).

ParametersJSON Schema
NameRequiredDescriptionDefault
titleYesTiêu đề chart.
data_rangeYesRange 5 cột liên tiếp, thứ tự CỐ ĐỊNH Date-Open-High-Low-Close, dạng "TenSheet!A2:E50". Không gồm dòng header.
anchor_cellNoVị trí đặt chart, dạng "TenSheet!G2". Bỏ trống -> tự đặt bên phải data_range.
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It specifies the required data range format but omits important details such as error handling for invalid input, permissions needed, whether the chart is immediately visible, or if the sheet is modified in any other way (e.g., adding new sheets). The lack of such information leaves significant gaps.

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 consists of two sentences front-loaded with the purpose and followed by a key constraint and example. Every sentence adds necessary information without redundancy, making it concise and well-structured.

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?

There is no output schema, and the description does not mention what the tool returns (e.g., chart ID or URL). It also lacks information on potential errors, performance implications, or how the chart is placed relative to the data. This incompleteness is significant for a tool that creates a new object.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds valuable context for the 'data_range' parameter by specifying the exact column order and providing an example, going beyond the schema's description. For other parameters, the schema descriptions are sufficient.

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

Purpose5/5

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

The description states 'Tạo chart nến cho dữ liệu giá (OHLC)' which clearly identifies the tool's purpose as creating a candlestick chart for OHLC data. The title also specifies candlestick chart, distinguishing it from the general 'sheets_create_chart' sibling.

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

Usage Guidelines3/5

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

The description implies usage when OHLC data is available and provides strict formatting rules for data_range. However, it does not explicitly mention when to use this tool versus the sibling 'sheets_create_chart' for other chart types, nor does it provide when-not-to-use or alternative scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_create_chartTạo chart cơ bản trong Google SheetA

Tạo 1 chart COLUMN/BAR/LINE/AREA/SCATTER/PIE từ data có sẵn, chart được embed thẳng vào tab. Mọi range PHẢI ghi đủ tên sheet, dạng "TenSheet!A2:A10" — không hỗ trợ range thiếu tên sheet.

ParametersJSON Schema
NameRequiredDescriptionDefault
titleYesTiêu đề chart.
stackedNoChỉ có ý nghĩa với COLUMN/BAR/AREA. true = stacked chart.
chart_typeYes
anchor_cellNoVị trí góc trên-trái đặt chart, dạng "TenSheet!F2". Bỏ trống -> tự đặt ngay bên phải domain_range.
domain_rangeYesRange nhãn trục X (category/labels), dạng "TenSheet!A2:A10". Với PIE đây là nhãn từng phần.
series_rangesYesRange giá trị, mỗi string là 1 series, dạng "TenSheet!B2:B10". PIE chỉ nhận đúng 1 series.
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.

TDQS

A4.2/5.0
Behavior3/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. It discloses that charts are embedded directly into tabs, that stacked only applies to certain types, and that PIE accepts exactly one series. However, it does not mention potential destructive behavior, permissions, or output details.

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 two sentences with no fluff. It front-loads the main purpose and immediately provides critical usage guidance on range format.

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

Completeness4/5

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

For a creation tool with 7 parameters and no output schema, the description covers the key behavioral aspects and parameter constraints. It could mention return values (e.g., chart ID) or error handling, but it is sufficient for an AI agent to use correctly.

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

Parameters4/5

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

Schema description coverage is high (86%), so baseline is 3. The description adds value by specifying that ranges must include sheet names and clarifying type-specific constraints (stacked only for COLUMN/BAR/AREA, PIE one series). This goes beyond the schema.

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

Purpose5/5

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

The description clearly states it creates basic charts (COLUMN/BAR/LINE/AREA/SCATTER/PIE) from existing data and embeds them into a sheet. It distinguishes from the sibling 'sheets_create_candlestick_chart' by listing supported chart types.

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

Usage Guidelines4/5

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

The description explicitly requires ranges to include sheet names, providing a concrete usage guideline. It does not explicitly mention when to avoid using this tool, but the sibling list implies alternatives exist for candlestick charts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_list_tabsList các tab/sheet trong fileA

Liệt kê tên + ID các tab (sheet con) trong 1 Google Sheet file.

ParametersJSON Schema
NameRequiredDescriptionDefault
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the burden. It indicates a read-only listing operation, which is accurate. However, it doesn't disclose any behavioral traits like authentication requirements or performance implications, though for a simple listing tool this is adequate.

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, well-structured sentence that conveys the core function without unnecessary words. Every word earns its place.

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

Completeness4/5

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

Given the tool's simplicity, the description adequately covers what it does. Although there is no output schema, the description mentions it returns names and IDs, which is sufficient. Slightly enhanced completeness would include what data is returned, but not essential.

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?

Schema coverage is 100% for the single parameter, and the schema already explains spreadsheet_id in detail. The description adds no new parameter meaning beyond what the schema provides, so baseline 3 is appropriate.

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

Purpose5/5

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

The description explicitly states the tool lists names and IDs of tabs in a Google Sheet file, with a specific verb and resource. It clearly distinguishes from sibling tools like sheets_read or sheets_write which deal with data, not metadata.

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?

No explicit guidance on when to use this tool versus alternatives. The schema parameter description hints at using drive_list_spreadsheets to find the ID, but the main description lacks direct usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_readĐọc dữ liệu từ Google SheetA

Đọc giá trị 1 vùng (range) trong Google Sheet, trả về dạng mảng 2 chiều (hàng x cột).

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeYesRange theo A1 notation, ví dụ "Sheet1!A1:D10". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet.
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the return format (2D array), which adds value. However, it does not mention behavioral traits such as handling of formulas, empty cells, or pagination. The description is minimal but not misleading.

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, front-loaded sentence with no wasted words. It conveys the essential information succinctly.

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

Completeness3/5

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

Given the tool is simple with 2 parameters and no output schema, the description is adequate but lacks context about potential edge cases (e.g., empty cells, formula values) or any behavioral details beyond the return format.

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?

Schema coverage is 100% with descriptions for both parameters. The tool description does not add additional meaning beyond the schema; it only states the overall action and return format. Baseline of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool reads a range from Google Sheet and returns a 2D array. The verb 'read' and resource 'Google Sheet' are specific, and the tool name aligns with the purpose. It is easily distinguishable from sibling tools like sheets_write or sheets_append.

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

Usage Guidelines3/5

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

The description implies the tool is used when you need to read data from a sheet, but it does not provide explicit guidance on when to use it versus alternatives, nor does it mention when not to use it or any prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_writeGhi đè dữ liệu vào Google SheetA

Ghi đè giá trị vào 1 range cụ thể. Dữ liệu cũ trong range sẽ bị thay thế hoàn toàn.

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeYesRange theo A1 notation, ví dụ "Sheet1!A1:C3". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet.
valuesYesMảng 2 chiều, mỗi mảng con là 1 hàng. Ví dụ: [["Tên","Tuổi"],["Đạt",30]]
spreadsheet_idYesID của Google Sheet — lấy từ URL (docs.google.com/spreadsheets/d/<ID>/edit) hoặc dùng tool drive_list_spreadsheets để tìm theo tên.
value_input_optionNoUSER_ENTERED: Sheet tự parse như khi anh gõ tay (công thức, ngày tháng...). RAW: giữ nguyên string.USER_ENTERED

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries full burden. It correctly discloses the key behavioral trait: old data is completely replaced. However, it lacks details on side effects (e.g., formatting preservation), error handling, permissions, or rate limits. The value_input_option behavior is in the schema but not described here.

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 extremely concise with two short sentences that cover the core functionality without any unnecessary words. It is front-loaded with the key action and effect.

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 4 parameters, no output schema, and no annotations, the description is too minimal. It fails to explain what happens if the range is invalid, whether the sheet is auto-created, error cases, or the return value. For a mutation tool, more context is needed to ensure safe and correct usage.

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?

Schema description coverage is 100% for the 4 parameters, so the schema already documents each parameter's purpose. The description adds no additional meaning beyond the schema, meeting the baseline of 3 per the guidelines.

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

Purpose5/5

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

The description clearly states the tool overwrites values in a specific range and that old data is completely replaced. The verb 'ghi đè' (overwrite) is specific, and the resource 'range trong Google Sheet' is identified. It distinguishes from sibling tools like sheets_append (appends) and sheets_clear (clears).

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

Usage Guidelines3/5

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

The description implies usage for overwriting data but does not explicitly state when to use this tool versus alternatives like sheets_append for appending. No conditions or exclusions are mentioned. Guidance is implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.8/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: listing, appending, clearing, creating, charting, reading, writing, and managing tabs. No two tools overlap in functionality.

Naming Consistency4/5

Most tools follow the 'sheets_<action>' pattern consistently. The only deviation is 'drive_list_spreadsheets' with a different prefix, which is acceptable given the different domain (Drive vs Sheets).

Tool Count5/5

With 9 tools, the server covers essential Google Sheets operations without being overwhelming. Each tool serves a distinct and necessary function.

Completeness4/5

The tool set covers core CRUD operations (create, read, write, clear) and includes chart creation and tab management. Minor gaps like lacking a delete spreadsheet tool are acceptable for the scope.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/lmdat/google-sheets-oauth-mcp'

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