Skip to content

Commit 6718bb3

Browse files
committed
fix(linear): align tool outputs, queries, and pagination with API (#3150)
* fix(linear): align tool outputs, queries, and pagination with API * fix(linear): coerce first param to number, remove duplicate conditions, add null guard
1 parent f23741c commit 6718bb3

34 files changed

+717
-148
lines changed

apps/docs/content/docs/en/tools/linear.mdx

Lines changed: 198 additions & 21 deletions
Large diffs are not rendered by default.

apps/sim/blocks/blocks/linear.ts

Lines changed: 99 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,29 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
810810
placeholder: 'Number of items to return (default: 50)',
811811
condition: {
812812
field: 'operation',
813-
value: ['linear_list_favorites'],
813+
value: [
814+
'linear_read_issues',
815+
'linear_search_issues',
816+
'linear_list_comments',
817+
'linear_list_projects',
818+
'linear_list_users',
819+
'linear_list_teams',
820+
'linear_list_labels',
821+
'linear_list_workflow_states',
822+
'linear_list_cycles',
823+
'linear_list_attachments',
824+
'linear_list_issue_relations',
825+
'linear_list_favorites',
826+
'linear_list_project_updates',
827+
'linear_list_notifications',
828+
'linear_list_customer_statuses',
829+
'linear_list_customer_tiers',
830+
'linear_list_customers',
831+
'linear_list_customer_requests',
832+
'linear_list_project_labels',
833+
'linear_list_project_milestones',
834+
'linear_list_project_statuses',
835+
],
814836
},
815837
},
816838
// Pagination - After (for list operations)
@@ -821,7 +843,29 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
821843
placeholder: 'Cursor for pagination',
822844
condition: {
823845
field: 'operation',
824-
value: ['linear_list_favorites'],
846+
value: [
847+
'linear_read_issues',
848+
'linear_search_issues',
849+
'linear_list_comments',
850+
'linear_list_projects',
851+
'linear_list_users',
852+
'linear_list_teams',
853+
'linear_list_labels',
854+
'linear_list_workflow_states',
855+
'linear_list_cycles',
856+
'linear_list_attachments',
857+
'linear_list_issue_relations',
858+
'linear_list_favorites',
859+
'linear_list_project_updates',
860+
'linear_list_notifications',
861+
'linear_list_customers',
862+
'linear_list_customer_requests',
863+
'linear_list_customer_statuses',
864+
'linear_list_customer_tiers',
865+
'linear_list_project_labels',
866+
'linear_list_project_milestones',
867+
'linear_list_project_statuses',
868+
],
825869
},
826870
},
827871
// Project health (for project updates)
@@ -1053,28 +1097,6 @@ Return ONLY the description text - no explanations.`,
10531097
value: ['linear_create_customer_request', 'linear_update_customer_request'],
10541098
},
10551099
},
1056-
// Pagination - first
1057-
{
1058-
id: 'first',
1059-
title: 'Limit',
1060-
type: 'short-input',
1061-
placeholder: 'Number of items (default: 50)',
1062-
condition: {
1063-
field: 'operation',
1064-
value: ['linear_list_customers', 'linear_list_customer_requests'],
1065-
},
1066-
},
1067-
// Pagination - after
1068-
{
1069-
id: 'after',
1070-
title: 'After Cursor',
1071-
type: 'short-input',
1072-
placeholder: 'Cursor for pagination',
1073-
condition: {
1074-
field: 'operation',
1075-
value: ['linear_list_customers', 'linear_list_customer_requests'],
1076-
},
1077-
},
10781100
// Customer ID for get/update/delete/merge operations
10791101
{
10801102
id: 'customerIdTarget',
@@ -1493,6 +1515,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
14931515
teamId: effectiveTeamId || undefined,
14941516
projectId: effectiveProjectId || undefined,
14951517
includeArchived: params.includeArchived,
1518+
first: params.first ? Number(params.first) : undefined,
1519+
after: params.after,
14961520
}
14971521

14981522
case 'linear_get_issue':
@@ -1558,6 +1582,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
15581582
query: params.query.trim(),
15591583
teamId: effectiveTeamId,
15601584
includeArchived: params.includeArchived,
1585+
first: params.first ? Number(params.first) : undefined,
1586+
after: params.after,
15611587
}
15621588

15631589
case 'linear_add_label_to_issue':
@@ -1607,13 +1633,17 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
16071633
return {
16081634
...baseParams,
16091635
issueId: params.issueId.trim(),
1636+
first: params.first ? Number(params.first) : undefined,
1637+
after: params.after,
16101638
}
16111639

16121640
case 'linear_list_projects':
16131641
return {
16141642
...baseParams,
16151643
teamId: effectiveTeamId,
16161644
includeArchived: params.includeArchived,
1645+
first: params.first ? Number(params.first) : undefined,
1646+
after: params.after,
16171647
}
16181648

16191649
case 'linear_get_project':
@@ -1665,13 +1695,21 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
16651695

16661696
case 'linear_list_users':
16671697
case 'linear_list_teams':
1698+
return {
1699+
...baseParams,
1700+
first: params.first ? Number(params.first) : undefined,
1701+
after: params.after,
1702+
}
1703+
16681704
case 'linear_get_viewer':
16691705
return baseParams
16701706

16711707
case 'linear_list_labels':
16721708
return {
16731709
...baseParams,
16741710
teamId: effectiveTeamId,
1711+
first: params.first ? Number(params.first) : undefined,
1712+
after: params.after,
16751713
}
16761714

16771715
case 'linear_create_label':
@@ -1709,6 +1747,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
17091747
return {
17101748
...baseParams,
17111749
teamId: effectiveTeamId,
1750+
first: params.first ? Number(params.first) : undefined,
1751+
after: params.after,
17121752
}
17131753

17141754
case 'linear_create_workflow_state':
@@ -1738,6 +1778,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
17381778
return {
17391779
...baseParams,
17401780
teamId: effectiveTeamId,
1781+
first: params.first ? Number(params.first) : undefined,
1782+
after: params.after,
17411783
}
17421784

17431785
case 'linear_get_cycle':
@@ -1801,6 +1843,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
18011843
return {
18021844
...baseParams,
18031845
issueId: params.issueId.trim(),
1846+
first: params.first ? Number(params.first) : undefined,
1847+
after: params.after,
18041848
}
18051849

18061850
case 'linear_update_attachment':
@@ -1840,6 +1884,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
18401884
return {
18411885
...baseParams,
18421886
issueId: params.issueId.trim(),
1887+
first: params.first ? Number(params.first) : undefined,
1888+
after: params.after,
18431889
}
18441890

18451891
case 'linear_delete_issue_relation':
@@ -1886,10 +1932,16 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
18861932
return {
18871933
...baseParams,
18881934
projectId: effectiveProjectId,
1935+
first: params.first ? Number(params.first) : undefined,
1936+
after: params.after,
18891937
}
18901938

18911939
case 'linear_list_notifications':
1892-
return baseParams
1940+
return {
1941+
...baseParams,
1942+
first: params.first ? Number(params.first) : undefined,
1943+
after: params.after,
1944+
}
18931945

18941946
case 'linear_update_notification':
18951947
if (!params.notificationId?.trim()) {
@@ -2018,9 +2070,9 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20182070
return {
20192071
...baseParams,
20202072
name: params.statusName.trim(),
2021-
displayName: params.statusDisplayName?.trim() || params.statusName.trim(),
20222073
color: params.statusColor.trim(),
20232074
description: params.statusDescription?.trim() || undefined,
2075+
displayName: params.statusDisplayName?.trim() || undefined,
20242076
}
20252077

20262078
case 'linear_update_customer_status':
@@ -2031,9 +2083,9 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20312083
...baseParams,
20322084
statusId: params.statusId.trim(),
20332085
name: params.statusName?.trim() || undefined,
2034-
displayName: params.statusDisplayName?.trim() || undefined,
20352086
color: params.statusColor?.trim() || undefined,
20362087
description: params.statusDescription?.trim() || undefined,
2088+
displayName: params.statusDisplayName?.trim() || undefined,
20372089
}
20382090

20392091
case 'linear_delete_customer_status':
@@ -2046,7 +2098,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20462098
}
20472099

20482100
case 'linear_list_customer_statuses':
2049-
return baseParams
2101+
return {
2102+
...baseParams,
2103+
first: params.first ? Number(params.first) : undefined,
2104+
after: params.after,
2105+
}
20502106

20512107
// Customer Tier Operations
20522108
case 'linear_create_customer_tier':
@@ -2084,7 +2140,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20842140
}
20852141

20862142
case 'linear_list_customer_tiers':
2087-
return baseParams
2143+
return {
2144+
...baseParams,
2145+
first: params.first ? Number(params.first) : undefined,
2146+
after: params.after,
2147+
}
20882148

20892149
// Project Management Operations
20902150
case 'linear_delete_project':
@@ -2135,6 +2195,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
21352195
return {
21362196
...baseParams,
21372197
projectId: effectiveProjectId || undefined,
2198+
first: params.first ? Number(params.first) : undefined,
2199+
after: params.after,
21382200
}
21392201

21402202
case 'linear_add_label_to_project':
@@ -2198,6 +2260,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
21982260
return {
21992261
...baseParams,
22002262
projectId: params.projectIdForMilestone.trim(),
2263+
first: params.first ? Number(params.first) : undefined,
2264+
after: params.after,
22012265
}
22022266

22032267
// Project Status Operations
@@ -2245,7 +2309,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
22452309
}
22462310

22472311
case 'linear_list_project_statuses':
2248-
return baseParams
2312+
return {
2313+
...baseParams,
2314+
first: params.first ? Number(params.first) : undefined,
2315+
after: params.after,
2316+
}
22492317

22502318
default:
22512319
return baseParams
@@ -2321,9 +2389,9 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
23212389
// Customer status and tier inputs
23222390
statusId: { type: 'string', description: 'Status identifier' },
23232391
statusName: { type: 'string', description: 'Status name' },
2324-
statusDisplayName: { type: 'string', description: 'Status display name' },
23252392
statusColor: { type: 'string', description: 'Status color in hex format' },
23262393
statusDescription: { type: 'string', description: 'Status description' },
2394+
statusDisplayName: { type: 'string', description: 'Status display name' },
23272395
tierId: { type: 'string', description: 'Tier identifier' },
23282396
tierName: { type: 'string', description: 'Tier name' },
23292397
tierDisplayName: { type: 'string', description: 'Tier display name' },

apps/sim/tools/linear/create_customer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,12 @@ export const linearCreateCustomerTool: ToolConfig<
131131
domains
132132
externalIds
133133
logoUrl
134+
slugId
134135
approximateNeedCount
136+
revenue
137+
size
135138
createdAt
139+
updatedAt
136140
archivedAt
137141
}
138142
}

apps/sim/tools/linear/create_customer_status.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ export const linearCreateCustomerStatusTool: ToolConfig<
3232
visibility: 'user-or-llm',
3333
description: 'Status color (hex code)',
3434
},
35-
displayName: {
35+
description: {
3636
type: 'string',
3737
required: false,
3838
visibility: 'user-or-llm',
39-
description: 'Display name for the status',
39+
description: 'Status description',
4040
},
41-
description: {
41+
displayName: {
4242
type: 'string',
4343
required: false,
4444
visibility: 'user-or-llm',
45-
description: 'Status description',
45+
description: 'Display name for the status',
4646
},
4747
position: {
4848
type: 'number',
@@ -70,12 +70,12 @@ export const linearCreateCustomerStatusTool: ToolConfig<
7070
color: params.color,
7171
}
7272

73-
if (params.displayName != null && params.displayName !== '') {
74-
input.displayName = params.displayName
75-
}
7673
if (params.description != null && params.description !== '') {
7774
input.description = params.description
7875
}
76+
if (params.displayName != null && params.displayName !== '') {
77+
input.displayName = params.displayName
78+
}
7979
if (params.position != null) {
8080
input.position = params.position
8181
}
@@ -88,11 +88,12 @@ export const linearCreateCustomerStatusTool: ToolConfig<
8888
status {
8989
id
9090
name
91-
displayName
9291
description
9392
color
9493
position
94+
type
9595
createdAt
96+
updatedAt
9697
archivedAt
9798
}
9899
}

apps/sim/tools/linear/create_cycle.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { LinearCreateCycleParams, LinearCreateCycleResponse } from '@/tools/linear/types'
2+
import { CYCLE_FULL_OUTPUT_PROPERTIES } from '@/tools/linear/types'
23
import type { ToolConfig } from '@/tools/types'
34

45
export const linearCreateCycleTool: ToolConfig<LinearCreateCycleParams, LinearCreateCycleResponse> =
@@ -72,7 +73,9 @@ export const linearCreateCycleTool: ToolConfig<LinearCreateCycleParams, LinearCr
7273
name
7374
startsAt
7475
endsAt
76+
completedAt
7577
progress
78+
createdAt
7679
team {
7780
id
7881
name
@@ -120,14 +123,7 @@ export const linearCreateCycleTool: ToolConfig<LinearCreateCycleParams, LinearCr
120123
cycle: {
121124
type: 'object',
122125
description: 'The created cycle',
123-
properties: {
124-
id: { type: 'string', description: 'Cycle ID' },
125-
number: { type: 'number', description: 'Cycle number' },
126-
name: { type: 'string', description: 'Cycle name' },
127-
startsAt: { type: 'string', description: 'Start date' },
128-
endsAt: { type: 'string', description: 'End date' },
129-
team: { type: 'object', description: 'Team this cycle belongs to' },
130-
},
126+
properties: CYCLE_FULL_OUTPUT_PROPERTIES,
131127
},
132128
},
133129
}

0 commit comments

Comments
 (0)