From 3fd3d3814c671fc1f5d0cfd2e266ace322ff0f13 Mon Sep 17 00:00:00 2001 From: AOJDevStudio Date: Sat, 28 Mar 2026 14:02:00 -0500 Subject: [PATCH 1/2] =?UTF-8?q?fix(forms):=20align=20addQuestion=20spec=20?= =?UTF-8?q?with=20handler=20=E2=80=94=20flat=20args=20+=20correct=20type?= =?UTF-8?q?=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug 1: Spec advertised nested { formId, question: { title, type } } but handler expects flat { formId, title, type, required, ... }. Fixed spec to match handler. Bug 2: Spec used SHORT_ANSWER/PARAGRAPH/SCALE but handler expects TEXT/PARAGRAPH_TEXT/LINEAR_SCALE. Fixed spec to use correct type names. Also fixed listTools.ts which used 'questionType' (wrong param name) and 'SCALE'. Added Linear team ID to CLAUDE.md for future reference. --- CLAUDE.md | 2 ++ src/sdk/spec.ts | 17 ++++++++++++----- src/tools/listTools.ts | 6 +++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3bc1f40..34de8c7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,6 +4,8 @@ MCP server for Google Workspace integration (Drive, Sheets, Forms, Docs, Gmail, Calendar). Version 3.3.0. +**Linear:** Team "Google Drive" (ID: `9fd7c68d-cf3f-4ac0-a0d7-42605c079da1`) — issues prefixed `GDRIVE-` + - 6 operation-based tools with 47 total operations - Redis caching (optional, graceful fallback) - Token encryption with key rotation diff --git a/src/sdk/spec.ts b/src/sdk/spec.ts index 004a514..fbed571 100644 --- a/src/sdk/spec.ts +++ b/src/sdk/spec.ts @@ -297,14 +297,21 @@ export const SDK_SPEC: SDKSpec = { returns: "{ formId, title, description, questions: Question[], responderUri, editUri }", }, addQuestion: { - signature: "addQuestion(options: { formId: string, question: QuestionSpec }): Promise<{ formId, questionId, title, type }>", + signature: "addQuestion(options: { formId: string, title: string, type: QuestionType, required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number, scaleMinLabel?: string, scaleMaxLabel?: string }): Promise<{ formId, title, type, message }>", description: "Add a question to an existing form.", - example: "await sdk.forms.addQuestion({\n formId: '1FAIpQLSf...',\n question: {\n title: 'Rate your experience',\n type: 'SCALE',\n required: true,\n scaleMin: 1, scaleMax: 5\n }\n});", + example: "await sdk.forms.addQuestion({\n formId: '1FAIpQLSf...',\n title: 'Rate your experience',\n type: 'LINEAR_SCALE',\n required: true,\n scaleMin: 1,\n scaleMax: 5,\n scaleMinLabel: 'Poor',\n scaleMaxLabel: 'Excellent'\n});", params: { formId: "string (required)", - "question": "QuestionSpec — { title: string, type: 'SHORT_ANSWER' | 'PARAGRAPH' | 'MULTIPLE_CHOICE' | 'CHECKBOX' | 'DROPDOWN' | 'SCALE' | 'DATE' | 'TIME', required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number }", - }, - returns: "{ formId, questionId, title, type }", + title: "string (required) — question title/text", + type: "QuestionType — 'TEXT' | 'PARAGRAPH_TEXT' | 'MULTIPLE_CHOICE' | 'CHECKBOX' | 'DROPDOWN' | 'LINEAR_SCALE' | 'DATE' | 'TIME'", + required: "boolean (optional, default false) — whether answer is required", + options: "string[] (optional) — choices for MULTIPLE_CHOICE, CHECKBOX, DROPDOWN", + scaleMin: "number (optional, default 1) — minimum for LINEAR_SCALE", + scaleMax: "number (optional, default 5) — maximum for LINEAR_SCALE", + scaleMinLabel: "string (optional) — label for minimum scale value", + scaleMaxLabel: "string (optional) — label for maximum scale value", + }, + returns: "{ formId, title, type, message }", }, listResponses: { signature: "listResponses(options: { formId: string, pageSize?: number, pageToken?: string }): Promise<{ formId, totalResponses, responses: FormResponse[] }>", diff --git a/src/tools/listTools.ts b/src/tools/listTools.ts index cbaf198..2279ae3 100644 --- a/src/tools/listTools.ts +++ b/src/tools/listTools.ts @@ -139,9 +139,9 @@ export async function generateToolStructure(): Promise { }, { name: 'addQuestion', - signature: 'addQuestion({ formId: string, title: string, questionType: string, ... })', - description: 'Add a question to a form', - example: 'forms.addQuestion({ formId: "abc123", title: "Your rating", questionType: "SCALE" })', + signature: 'addQuestion({ formId: string, title: string, type: QuestionType, required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number })', + description: 'Add a question to a form. QuestionType: TEXT | PARAGRAPH_TEXT | MULTIPLE_CHOICE | CHECKBOX | DROPDOWN | LINEAR_SCALE | DATE | TIME', + example: 'forms.addQuestion({ formId: "abc123", title: "Your rating", type: "LINEAR_SCALE", scaleMin: 1, scaleMax: 5 })', }, { name: 'listResponses', From 263c6c24d37f7ae7146506577932d36ff0f12d4b Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sun, 29 Mar 2026 00:47:37 +0000 Subject: [PATCH 2/2] fix: apply CodeRabbit auto-fixes Fixed 3 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit --- package-lock.json | 6 +++--- src/tools/listTools.ts | 4 ++-- tsconfig.json | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index df8a337..3387419 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@modelcontextprotocol/server-gdrive", - "version": "3.3.0", + "version": "4.0.0-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@modelcontextprotocol/server-gdrive", - "version": "3.3.0", + "version": "4.0.0-alpha", "license": "MIT", "dependencies": { "@google-cloud/local-auth": "^3.0.1", @@ -8640,4 +8640,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/tools/listTools.ts b/src/tools/listTools.ts index 2279ae3..a0d5495 100644 --- a/src/tools/listTools.ts +++ b/src/tools/listTools.ts @@ -139,7 +139,7 @@ export async function generateToolStructure(): Promise { }, { name: 'addQuestion', - signature: 'addQuestion({ formId: string, title: string, type: QuestionType, required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number })', + signature: 'addQuestion({ formId: string, title: string, type: QuestionType, required?: boolean, options?: string[], scaleMin?: number, scaleMax?: number, scaleMinLabel?: string, scaleMaxLabel?: string })', description: 'Add a question to a form. QuestionType: TEXT | PARAGRAPH_TEXT | MULTIPLE_CHOICE | CHECKBOX | DROPDOWN | LINEAR_SCALE | DATE | TIME', example: 'forms.addQuestion({ formId: "abc123", title: "Your rating", type: "LINEAR_SCALE", scaleMin: 1, scaleMax: 5 })', }, @@ -368,4 +368,4 @@ export async function getToolDefinition( ): Promise { const moduleTools = await getModuleTools(moduleName); return moduleTools.find(tool => tool.name === toolName); -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index ce5ceb0..9b58c69 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "noUncheckedIndexedAccess": true, - "exactOptionalPropertyTypes": true + "exactOptionalPropertyTypes": true, + "ignoreDeprecations": "5.0" }, "include": [ "./**/*.ts" @@ -33,4 +34,4 @@ "**/*.test.ts", "**/*.spec.ts" ] -} +} \ No newline at end of file