@lmdat/google-sheets-oauth-mcp
A local MCP server that lets you manage Google Sheets via OAuth (acting as the logged-in Google user), eliminating the need to manually share files like with a Service Account.
Find Spreadsheets (
drive_list_spreadsheets): Search for Google Sheets in your Drive by name; returns file name, ID, URL, modified time, and owner.Create a New Spreadsheet (
sheets_create): Create a new Google Sheet with a custom title, optionally place it in a specific Drive folder, and pre-create multiple named tabs.Read Sheet Data (
sheets_read): Read values from a specific range (A1 notation), returning a 2D array of rows and columns.Write/Overwrite Data (
sheets_write): Write data into a specific range, with support for raw or user-entered value parsing (formulas, dates, etc.).Append Rows (
sheets_append): Append new rows to the end of an existing data table without overwriting existing data.Clear a Range (
sheets_clear): Clear values from a range while preserving formatting and borders.List Tabs (
sheets_list_tabs): List all tabs and their IDs within a spreadsheet.Create Standard Charts (
sheets_create_chart): Create COLUMN, BAR, LINE, AREA, SCATTER, or PIE charts from existing data, with support for stacked charts and custom placement.Create Candlestick Charts (
sheets_create_candlestick_chart): Create OHLC candlestick charts using a 5-column Date-Open-High-Low-Close range.Write JSON Data (
sheets_write_json): Write JSON data directly into a Google Sheet.Append JSON Data (
sheets_append_json): Append JSON data to a Google Sheet, creating the file or tab if it doesn't exist yet.
Provides tools for reading, writing, creating Google Sheets, including chart creation and spreadsheet management, using OAuth authentication. Also supports listing spreadsheets via the Google Drive API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@lmdat/google-sheets-oauth-mcpCreate a new sheet named 'Expenses' with columns for date, category, amount."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@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
Vào console.cloud.google.com, tạo hoặc chọn 1 project.
APIs & Services → Library → enable Google Sheets API và Google Drive API.
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.
APIs & Services → Credentials → Create Credentials → OAuth client ID:
Application type: Desktop app (không chọn Web application).
Lưu lại
Client IDvàClient secrethiện ra sau khi tạo.
2. Cài đặt
npm install3. Build
Lệnh | Output | Dùng khi nào |
|
| Phát triển/debug, code dễ đọc |
|
| Dùng để chạy thật / publish |
|
| 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 |
|
| Port bị chương trình khác chiếm dụng |
|
| 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ẽ:
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).
Đăng nhập Google và bấm Allow.
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-run9. Danh sách tool
Tool | Chức năng |
| Tìm sheet theo tên (Drive API), không cần biết ID trước |
| Tạo sheet mới, tùy chọn đặt vào folder cụ thể và tạo sẵn nhiều tab |
| Đọc 1 range, trả về mảng 2 chiều |
| Ghi đè giá trị trong 1 range |
| Thêm hàng vào cuối bảng dữ liệu hiện có |
| Xóa giá trị trong 1 range (giữ nguyên format) |
| Liệt kê tên các tab trong file |
| Tạo chart COLUMN/BAR/LINE/AREA/SCATTER/PIE từ dữ liệu có sẵn |
| Tạo chart nến (OHLC) cho dữ liệu giá |
| Ghi dữ liệu JSON vào Google Sheet |
| 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_spreadsheets và sheets_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_chartyêu cầudata_rangecó đú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:E5012. 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ó, qua |
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 toolsdrive_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}.
| Name | Required | Description | Default |
|---|---|---|---|
| max_results | No | ||
| name_contains | No | Lọ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
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.
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.
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.
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.
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.
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ũ).
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | Range 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. | |
| values | Yes | Mảng 2 chiều, mỗi mảng con là 1 hàng cần thêm. | |
| spreadsheet_id | Yes | ID 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_option | No | USER_ENTERED |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | Range theo A1 notation, ví dụ "Sheet1!A2:D100". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet. | |
| spreadsheet_id | Yes | ID 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
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.
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.
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.
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.
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.
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ể.
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Tên file Google Sheet mới. | |
| folder_id | No | ID 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_titles | No | Tên các tab muốn tạo sẵn, ví dụ ["Thu","Chi"]. Bỏ trống -> 1 tab mặc định "Sheet1". |
TDQS
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.
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.
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.
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.
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.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Tiêu đề chart. | |
| data_range | Yes | Range 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_cell | No | Vị trí đặt chart, dạng "TenSheet!G2". Bỏ trống -> tự đặt bên phải data_range. | |
| spreadsheet_id | Yes | ID 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
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Tiêu đề chart. | |
| stacked | No | Chỉ có ý nghĩa với COLUMN/BAR/AREA. true = stacked chart. | |
| chart_type | Yes | ||
| anchor_cell | No | Vị 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_range | Yes | Range nhãn trục X (category/labels), dạng "TenSheet!A2:A10". Với PIE đây là nhãn từng phần. | |
| series_ranges | Yes | Range giá trị, mỗi string là 1 series, dạng "TenSheet!B2:B10". PIE chỉ nhận đúng 1 series. | |
| spreadsheet_id | Yes | ID 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
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| spreadsheet_id | Yes | ID 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
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.
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.
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.
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.
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.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | Range theo A1 notation, ví dụ "Sheet1!A1:D10". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet. | |
| spreadsheet_id | Yes | ID 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
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | Range theo A1 notation, ví dụ "Sheet1!A1:C3". Có thể chỉ ghi tên sheet (vd "Sheet1") để lấy/ghi cả sheet. | |
| values | Yes | Mảng 2 chiều, mỗi mảng con là 1 hàng. Ví dụ: [["Tên","Tuổi"],["Đạt",30]] | |
| spreadsheet_id | Yes | ID 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_option | No | USER_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
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.
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.
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.
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.
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.
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
Each tool has a clearly distinct purpose: listing, appending, clearing, creating, charting, reading, writing, and managing tabs. No two tools overlap in functionality.
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).
With 9 tools, the server covers essential Google Sheets operations without being overwhelming. Each tool serves a distinct and necessary function.
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
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
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
OAuth-protected, read-only-by-default MCP server for provenance-labeled QuillCaddie project memory.
MCP server for Nylas — read email, calendars, events and contacts, and send email or create events.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP Server for Google Services, with the ability to define your own scopes and bring your own oauth key.3MIT
- AlicenseAqualityDmaintenanceMCP server for Google Workspace APIs - Docs, Sheets, Drive, Gmail, and Calendar. Enables reading, creating, and editing Google Docs and Sheets, managing comments, reading emails, and viewing calendar events.343917MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Docs and Sheets that enables AI assistants to read, create, edit, style, export, and collaborate on documents using local OAuth authentication.42MIT
- AlicenseNot gradedqualityCmaintenanceMCP server to read, write, create, and format Google Sheets via OAuth2 authentication, providing tools for spreadsheet management.606MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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