improvement(google-chat): validate tools, set optional fields to advanced mode

This commit is contained in:
Waleed Latif
2026-02-27 11:02:41 -08:00
parent 8d7d484355
commit 15c3fa4fb7
3 changed files with 6 additions and 3 deletions

View File

@@ -70,6 +70,7 @@ export const GoogleChatBlock: BlockConfig<GoogleChatResponse> = {
type: 'short-input',
placeholder: 'Optional thread key for threaded replies',
condition: { field: 'operation', value: 'send_message' },
mode: 'advanced',
},
{
id: 'filter',
@@ -77,6 +78,7 @@ export const GoogleChatBlock: BlockConfig<GoogleChatResponse> = {
type: 'short-input',
placeholder: 'e.g., spaceType = "SPACE"',
condition: { field: 'operation', value: 'list_spaces' },
mode: 'advanced',
},
{
id: 'pageSize',
@@ -84,6 +86,7 @@ export const GoogleChatBlock: BlockConfig<GoogleChatResponse> = {
type: 'short-input',
placeholder: 'Maximum spaces to return (default 100)',
condition: { field: 'operation', value: 'list_spaces' },
mode: 'advanced',
},
],
tools: {
@@ -137,7 +140,7 @@ export const GoogleChatBlock: BlockConfig<GoogleChatResponse> = {
threadName: { type: 'string', description: 'Thread resource name' },
text: { type: 'string', description: 'Message text that was sent' },
createTime: { type: 'string', description: 'Message creation timestamp' },
spaces: { type: 'json', description: 'Array of Google Chat space objects' },
spaces: { type: 'json', description: 'Array of Google Chat space objects (name, displayName, spaceType, singleUserBotDm, threaded, type)' },
nextPageToken: { type: 'string', description: 'Token for next page of results' },
},
}

View File

@@ -3,3 +3,4 @@ import { sendMessageTool } from './send_message'
export const googleChatSendMessageTool = sendMessageTool
export const googleChatListSpacesTool = listSpacesTool
export * from './types'

View File

@@ -57,7 +57,6 @@ export const listSpacesTool: ToolConfig<GoogleChatListSpacesParams, GoogleChatRe
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
'Content-Type': 'application/json',
}),
},
@@ -78,7 +77,7 @@ export const listSpacesTool: ToolConfig<GoogleChatListSpacesParams, GoogleChatRe
outputs: {
spaces: {
type: 'json',
description: 'Array of Google Chat space objects',
description: 'Array of Google Chat space objects (name, displayName, spaceType, singleUserBotDm, threaded, type)',
},
nextPageToken: {
type: 'string',