Skip to content

Commit e29ee89

Browse files
committed
fix(linear): align tool outputs, queries, and pagination with API
1 parent 9dcf92b commit e29ee89

32 files changed

+706
-143
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: 101 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,31 @@ 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_customer_statuses',
833+
'linear_list_customer_tiers',
834+
'linear_list_project_labels',
835+
'linear_list_project_milestones',
836+
'linear_list_project_statuses',
837+
],
814838
},
815839
},
816840
// Pagination - After (for list operations)
@@ -821,7 +845,29 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
821845
placeholder: 'Cursor for pagination',
822846
condition: {
823847
field: 'operation',
824-
value: ['linear_list_favorites'],
848+
value: [
849+
'linear_read_issues',
850+
'linear_search_issues',
851+
'linear_list_comments',
852+
'linear_list_projects',
853+
'linear_list_users',
854+
'linear_list_teams',
855+
'linear_list_labels',
856+
'linear_list_workflow_states',
857+
'linear_list_cycles',
858+
'linear_list_attachments',
859+
'linear_list_issue_relations',
860+
'linear_list_favorites',
861+
'linear_list_project_updates',
862+
'linear_list_notifications',
863+
'linear_list_customers',
864+
'linear_list_customer_requests',
865+
'linear_list_customer_statuses',
866+
'linear_list_customer_tiers',
867+
'linear_list_project_labels',
868+
'linear_list_project_milestones',
869+
'linear_list_project_statuses',
870+
],
825871
},
826872
},
827873
// Project health (for project updates)
@@ -1053,28 +1099,6 @@ Return ONLY the description text - no explanations.`,
10531099
value: ['linear_create_customer_request', 'linear_update_customer_request'],
10541100
},
10551101
},
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-
},
10781102
// Customer ID for get/update/delete/merge operations
10791103
{
10801104
id: 'customerIdTarget',
@@ -1493,6 +1517,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
14931517
teamId: effectiveTeamId || undefined,
14941518
projectId: effectiveProjectId || undefined,
14951519
includeArchived: params.includeArchived,
1520+
first: params.first ? Number(params.first) : undefined,
1521+
after: params.after,
14961522
}
14971523

14981524
case 'linear_get_issue':
@@ -1558,6 +1584,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
15581584
query: params.query.trim(),
15591585
teamId: effectiveTeamId,
15601586
includeArchived: params.includeArchived,
1587+
first: params.first ? Number(params.first) : undefined,
1588+
after: params.after,
15611589
}
15621590

15631591
case 'linear_add_label_to_issue':
@@ -1607,13 +1635,17 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
16071635
return {
16081636
...baseParams,
16091637
issueId: params.issueId.trim(),
1638+
first: params.first ? Number(params.first) : undefined,
1639+
after: params.after,
16101640
}
16111641

16121642
case 'linear_list_projects':
16131643
return {
16141644
...baseParams,
16151645
teamId: effectiveTeamId,
16161646
includeArchived: params.includeArchived,
1647+
first: params.first ? Number(params.first) : undefined,
1648+
after: params.after,
16171649
}
16181650

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

16661698
case 'linear_list_users':
16671699
case 'linear_list_teams':
1700+
return {
1701+
...baseParams,
1702+
first: params.first ? Number(params.first) : undefined,
1703+
after: params.after,
1704+
}
1705+
16681706
case 'linear_get_viewer':
16691707
return baseParams
16701708

16711709
case 'linear_list_labels':
16721710
return {
16731711
...baseParams,
16741712
teamId: effectiveTeamId,
1713+
first: params.first ? Number(params.first) : undefined,
1714+
after: params.after,
16751715
}
16761716

16771717
case 'linear_create_label':
@@ -1709,6 +1749,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
17091749
return {
17101750
...baseParams,
17111751
teamId: effectiveTeamId,
1752+
first: params.first ? Number(params.first) : undefined,
1753+
after: params.after,
17121754
}
17131755

17141756
case 'linear_create_workflow_state':
@@ -1738,6 +1780,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
17381780
return {
17391781
...baseParams,
17401782
teamId: effectiveTeamId,
1783+
first: params.first ? Number(params.first) : undefined,
1784+
after: params.after,
17411785
}
17421786

17431787
case 'linear_get_cycle':
@@ -1801,6 +1845,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
18011845
return {
18021846
...baseParams,
18031847
issueId: params.issueId.trim(),
1848+
first: params.first ? Number(params.first) : undefined,
1849+
after: params.after,
18041850
}
18051851

18061852
case 'linear_update_attachment':
@@ -1840,6 +1886,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
18401886
return {
18411887
...baseParams,
18421888
issueId: params.issueId.trim(),
1889+
first: params.first ? Number(params.first) : undefined,
1890+
after: params.after,
18431891
}
18441892

18451893
case 'linear_delete_issue_relation':
@@ -1886,10 +1934,16 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
18861934
return {
18871935
...baseParams,
18881936
projectId: effectiveProjectId,
1937+
first: params.first ? Number(params.first) : undefined,
1938+
after: params.after,
18891939
}
18901940

18911941
case 'linear_list_notifications':
1892-
return baseParams
1942+
return {
1943+
...baseParams,
1944+
first: params.first ? Number(params.first) : undefined,
1945+
after: params.after,
1946+
}
18931947

18941948
case 'linear_update_notification':
18951949
if (!params.notificationId?.trim()) {
@@ -2018,9 +2072,9 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20182072
return {
20192073
...baseParams,
20202074
name: params.statusName.trim(),
2021-
displayName: params.statusDisplayName?.trim() || params.statusName.trim(),
20222075
color: params.statusColor.trim(),
20232076
description: params.statusDescription?.trim() || undefined,
2077+
displayName: params.statusDisplayName?.trim() || undefined,
20242078
}
20252079

20262080
case 'linear_update_customer_status':
@@ -2031,9 +2085,9 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20312085
...baseParams,
20322086
statusId: params.statusId.trim(),
20332087
name: params.statusName?.trim() || undefined,
2034-
displayName: params.statusDisplayName?.trim() || undefined,
20352088
color: params.statusColor?.trim() || undefined,
20362089
description: params.statusDescription?.trim() || undefined,
2090+
displayName: params.statusDisplayName?.trim() || undefined,
20372091
}
20382092

20392093
case 'linear_delete_customer_status':
@@ -2046,7 +2100,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20462100
}
20472101

20482102
case 'linear_list_customer_statuses':
2049-
return baseParams
2103+
return {
2104+
...baseParams,
2105+
first: params.first ? Number(params.first) : undefined,
2106+
after: params.after,
2107+
}
20502108

20512109
// Customer Tier Operations
20522110
case 'linear_create_customer_tier':
@@ -2084,7 +2142,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20842142
}
20852143

20862144
case 'linear_list_customer_tiers':
2087-
return baseParams
2145+
return {
2146+
...baseParams,
2147+
first: params.first ? Number(params.first) : undefined,
2148+
after: params.after,
2149+
}
20882150

20892151
// Project Management Operations
20902152
case 'linear_delete_project':
@@ -2135,6 +2197,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
21352197
return {
21362198
...baseParams,
21372199
projectId: effectiveProjectId || undefined,
2200+
first: params.first ? Number(params.first) : undefined,
2201+
after: params.after,
21382202
}
21392203

21402204
case 'linear_add_label_to_project':
@@ -2198,6 +2262,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
21982262
return {
21992263
...baseParams,
22002264
projectId: params.projectIdForMilestone.trim(),
2265+
first: params.first ? Number(params.first) : undefined,
2266+
after: params.after,
22012267
}
22022268

22032269
// Project Status Operations
@@ -2245,7 +2311,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
22452311
}
22462312

22472313
case 'linear_list_project_statuses':
2248-
return baseParams
2314+
return {
2315+
...baseParams,
2316+
first: params.first ? Number(params.first) : undefined,
2317+
after: params.after,
2318+
}
22492319

22502320
default:
22512321
return baseParams
@@ -2321,9 +2391,9 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
23212391
// Customer status and tier inputs
23222392
statusId: { type: 'string', description: 'Status identifier' },
23232393
statusName: { type: 'string', description: 'Status name' },
2324-
statusDisplayName: { type: 'string', description: 'Status display name' },
23252394
statusColor: { type: 'string', description: 'Status color in hex format' },
23262395
statusDescription: { type: 'string', description: 'Status description' },
2396+
statusDisplayName: { type: 'string', description: 'Status display name' },
23272397
tierId: { type: 'string', description: 'Tier identifier' },
23282398
tierName: { type: 'string', description: 'Tier name' },
23292399
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)