Skip to content

Commit 3961cea

Browse files
committed
improvement(google-tasks): destructure task and taskList outputs with typed schemas
1 parent 7d32cd5 commit 3961cea

File tree

3 files changed

+81
-5
lines changed

3 files changed

+81
-5
lines changed

apps/sim/tools/google_tasks/list.ts

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,21 @@ export const listTool: ToolConfig<GoogleTasksListParams, GoogleTasksListResponse
132132
notes: (item.notes as string) ?? null,
133133
status: (item.status as string) ?? null,
134134
due: (item.due as string) ?? null,
135+
completed: (item.completed as string) ?? null,
135136
updated: (item.updated as string) ?? null,
137+
selfLink: (item.selfLink as string) ?? null,
136138
webViewLink: (item.webViewLink as string) ?? null,
137139
parent: (item.parent as string) ?? null,
138140
position: (item.position as string) ?? null,
141+
hidden: (item.hidden as boolean) ?? null,
142+
deleted: (item.deleted as boolean) ?? null,
143+
links: Array.isArray(item.links)
144+
? (item.links as Array<Record<string, string>>).map((link) => ({
145+
type: link.type ?? '',
146+
description: link.description ?? '',
147+
link: link.link ?? '',
148+
}))
149+
: [],
139150
})),
140151
nextPageToken: data.nextPageToken ?? null,
141152
},
@@ -144,8 +155,56 @@ export const listTool: ToolConfig<GoogleTasksListParams, GoogleTasksListResponse
144155

145156
outputs: {
146157
tasks: {
147-
type: 'json',
148-
description: 'Array of tasks with id, title, notes, status, due, updated, and more',
158+
type: 'array',
159+
description: 'List of tasks',
160+
items: {
161+
type: 'object',
162+
properties: {
163+
id: { type: 'string', description: 'Task identifier' },
164+
title: { type: 'string', description: 'Title of the task' },
165+
notes: { type: 'string', description: 'Notes/description for the task', optional: true },
166+
status: {
167+
type: 'string',
168+
description: 'Task status: "needsAction" or "completed"',
169+
},
170+
due: { type: 'string', description: 'Due date (RFC 3339 timestamp)', optional: true },
171+
completed: {
172+
type: 'string',
173+
description: 'Completion date (RFC 3339 timestamp)',
174+
optional: true,
175+
},
176+
updated: { type: 'string', description: 'Last modification time (RFC 3339 timestamp)' },
177+
selfLink: { type: 'string', description: 'URL pointing to this task' },
178+
webViewLink: {
179+
type: 'string',
180+
description: 'Link to task in Google Tasks UI',
181+
optional: true,
182+
},
183+
parent: { type: 'string', description: 'Parent task identifier', optional: true },
184+
position: {
185+
type: 'string',
186+
description: 'Position among sibling tasks (string-based ordering)',
187+
},
188+
hidden: { type: 'boolean', description: 'Whether the task is hidden', optional: true },
189+
deleted: { type: 'boolean', description: 'Whether the task is deleted', optional: true },
190+
links: {
191+
type: 'array',
192+
description: 'Collection of links associated with the task',
193+
optional: true,
194+
items: {
195+
type: 'object',
196+
properties: {
197+
type: {
198+
type: 'string',
199+
description: 'Link type (e.g., "email", "generic", "chat_message")',
200+
},
201+
description: { type: 'string', description: 'Link description' },
202+
link: { type: 'string', description: 'The URL' },
203+
},
204+
},
205+
},
206+
},
207+
},
149208
},
150209
nextPageToken: {
151210
type: 'string',

apps/sim/tools/google_tasks/list_task_lists.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const listTaskListsTool: ToolConfig<
2727
type: 'number',
2828
required: false,
2929
visibility: 'user-or-llm',
30-
description: 'Maximum number of task lists to return (default 1000, max 1000)',
30+
description: 'Maximum number of task lists to return (default 20, max 100)',
3131
},
3232
pageToken: {
3333
type: 'string',
@@ -76,8 +76,20 @@ export const listTaskListsTool: ToolConfig<
7676

7777
outputs: {
7878
taskLists: {
79-
type: 'json',
80-
description: 'Array of task lists with id, title, updated, and selfLink',
79+
type: 'array',
80+
description: 'List of task lists',
81+
items: {
82+
type: 'object',
83+
properties: {
84+
id: { type: 'string', description: 'Task list identifier' },
85+
title: { type: 'string', description: 'Title of the task list' },
86+
updated: {
87+
type: 'string',
88+
description: 'Last modification time (RFC 3339 timestamp)',
89+
},
90+
selfLink: { type: 'string', description: 'URL pointing to this task list' },
91+
},
92+
},
8193
},
8294
nextPageToken: {
8395
type: 'string',

apps/sim/tools/google_tasks/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,15 @@ export interface GoogleTasksListResponse extends ToolResponse {
7979
notes: string | null
8080
status: string | null
8181
due: string | null
82+
completed: string | null
8283
updated: string | null
84+
selfLink: string | null
8385
webViewLink: string | null
8486
parent: string | null
8587
position: string | null
88+
hidden: boolean | null
89+
deleted: boolean | null
90+
links: Array<{ type: string; description: string; link: string }>
8691
}>
8792
nextPageToken: string | null
8893
}

0 commit comments

Comments
 (0)