Skip to content

Commit 033e09c

Browse files
feat: allow switching between tool selection modes in dashboard (#839)
- Adds a section to the MCP details page that allows for switching between the various tool selection modes - Bonus: changes the toolset page tabs to use fragments so the tabs can be navigated to <img width="1648" height="520" alt="CleanShot 2025-11-12 at 11 13 54@2x" src="https://github.com/user-attachments/assets/608aafdf-f634-4849-b421-e65899b969e1" />
1 parent 0ed2383 commit 033e09c

File tree

301 files changed

+28896
-12286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+28896
-12286
lines changed

.speakeasy/out.openapi.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6538,6 +6538,13 @@ paths:
65386538
schema:
65396539
description: Session header
65406540
type: string
6541+
- allowEmptyValue: true
6542+
description: API Key header
6543+
in: header
6544+
name: Gram-Key
6545+
schema:
6546+
description: API Key header
6547+
type: string
65416548
- allowEmptyValue: true
65426549
description: project header
65436550
in: header
@@ -6615,6 +6622,8 @@ paths:
66156622
security:
66166623
- project_slug_header_Gram-Project: []
66176624
session_header_Gram-Session: []
6625+
- apikey_header_Gram-Key: []
6626+
project_slug_header_Gram-Project: []
66186627
- {}
66196628
summary: addExternalOAuthServer toolsets
66206629
tags:
@@ -6644,6 +6653,13 @@ paths:
66446653
schema:
66456654
description: Session header
66466655
type: string
6656+
- allowEmptyValue: true
6657+
description: API Key header
6658+
in: header
6659+
name: Gram-Key
6660+
schema:
6661+
description: API Key header
6662+
type: string
66476663
- allowEmptyValue: true
66486664
description: project header
66496665
in: header
@@ -6715,6 +6731,8 @@ paths:
67156731
security:
67166732
- project_slug_header_Gram-Project: []
67176733
session_header_Gram-Session: []
6734+
- apikey_header_Gram-Key: []
6735+
project_slug_header_Gram-Project: []
67186736
- {}
67196737
summary: checkMCPSlugAvailability toolsets
67206738
tags:
@@ -6815,6 +6833,8 @@ paths:
68156833
security:
68166834
- project_slug_header_Gram-Project: []
68176835
session_header_Gram-Session: []
6836+
- apikey_header_Authorization: []
6837+
project_slug_header_Gram-Project: []
68186838
- {}
68196839
summary: cloneToolset toolsets
68206840
tags:
@@ -6834,6 +6854,13 @@ paths:
68346854
schema:
68356855
description: Session header
68366856
type: string
6857+
- allowEmptyValue: true
6858+
description: API Key header
6859+
in: header
6860+
name: Gram-Key
6861+
schema:
6862+
description: API Key header
6863+
type: string
68376864
- allowEmptyValue: true
68386865
description: project header
68396866
in: header
@@ -6911,6 +6938,8 @@ paths:
69116938
security:
69126939
- project_slug_header_Gram-Project: []
69136940
session_header_Gram-Session: []
6941+
- apikey_header_Gram-Key: []
6942+
project_slug_header_Gram-Project: []
69146943
- {}
69156944
summary: createToolset toolsets
69166945
tags:
@@ -6940,6 +6969,13 @@ paths:
69406969
schema:
69416970
description: Session header
69426971
type: string
6972+
- allowEmptyValue: true
6973+
description: API Key header
6974+
in: header
6975+
name: Gram-Key
6976+
schema:
6977+
description: API Key header
6978+
type: string
69436979
- allowEmptyValue: true
69446980
description: project header
69456981
in: header
@@ -7007,6 +7043,8 @@ paths:
70077043
security:
70087044
- project_slug_header_Gram-Project: []
70097045
session_header_Gram-Session: []
7046+
- apikey_header_Gram-Key: []
7047+
project_slug_header_Gram-Project: []
70107048
- {}
70117049
summary: deleteToolset toolsets
70127050
tags:
@@ -7036,6 +7074,13 @@ paths:
70367074
schema:
70377075
description: Session header
70387076
type: string
7077+
- allowEmptyValue: true
7078+
description: API Key header
7079+
in: header
7080+
name: Gram-Key
7081+
schema:
7082+
description: API Key header
7083+
type: string
70397084
- allowEmptyValue: true
70407085
description: project header
70417086
in: header
@@ -7107,6 +7152,8 @@ paths:
71077152
security:
71087153
- project_slug_header_Gram-Project: []
71097154
session_header_Gram-Session: []
7155+
- apikey_header_Gram-Key: []
7156+
project_slug_header_Gram-Project: []
71107157
- {}
71117158
summary: getToolset toolsets
71127159
tags:
@@ -7126,6 +7173,13 @@ paths:
71267173
schema:
71277174
description: Session header
71287175
type: string
7176+
- allowEmptyValue: true
7177+
description: API Key header
7178+
in: header
7179+
name: Gram-Key
7180+
schema:
7181+
description: API Key header
7182+
type: string
71297183
- allowEmptyValue: true
71307184
description: project header
71317185
in: header
@@ -7197,6 +7251,8 @@ paths:
71977251
security:
71987252
- project_slug_header_Gram-Project: []
71997253
session_header_Gram-Session: []
7254+
- apikey_header_Gram-Key: []
7255+
project_slug_header_Gram-Project: []
72007256
- {}
72017257
summary: listToolsets toolsets
72027258
tags:
@@ -7226,6 +7282,13 @@ paths:
72267282
schema:
72277283
description: Session header
72287284
type: string
7285+
- allowEmptyValue: true
7286+
description: API Key header
7287+
in: header
7288+
name: Gram-Key
7289+
schema:
7290+
description: API Key header
7291+
type: string
72297292
- allowEmptyValue: true
72307293
description: project header
72317294
in: header
@@ -7297,6 +7360,8 @@ paths:
72977360
security:
72987361
- project_slug_header_Gram-Project: []
72997362
session_header_Gram-Session: []
7363+
- apikey_header_Gram-Key: []
7364+
project_slug_header_Gram-Project: []
73007365
- {}
73017366
summary: removeOAuthServer toolsets
73027367
tags:
@@ -7326,6 +7391,13 @@ paths:
73267391
schema:
73277392
description: Session header
73287393
type: string
7394+
- allowEmptyValue: true
7395+
description: API Key header
7396+
in: header
7397+
name: Gram-Key
7398+
schema:
7399+
description: API Key header
7400+
type: string
73297401
- allowEmptyValue: true
73307402
description: project header
73317403
in: header
@@ -7403,6 +7475,8 @@ paths:
74037475
security:
74047476
- project_slug_header_Gram-Project: []
74057477
session_header_Gram-Session: []
7478+
- apikey_header_Gram-Key: []
7479+
project_slug_header_Gram-Project: []
74067480
- {}
74077481
summary: updateToolset toolsets
74087482
tags:
@@ -11256,6 +11330,9 @@ components:
1125611330
description: A short url-friendly label that uniquely identifies a resource.
1125711331
pattern: ^[a-z0-9_-]{1,128}$
1125811332
maxLength: 40
11333+
tool_selection_mode:
11334+
type: string
11335+
description: The mode to use for tool selection
1125911336
tool_urns:
1126011337
type: array
1126111338
items:
@@ -11266,6 +11343,10 @@ components:
1126611343
items:
1126711344
$ref: '#/components/schemas/Tool'
1126811345
description: The tools in this toolset
11346+
toolset_version:
11347+
type: integer
11348+
description: The version of the toolset (will be 0 if none exists)
11349+
format: int64
1126911350
updated_at:
1127011351
type: string
1127111352
description: When the toolset was last updated.
@@ -11278,6 +11359,8 @@ components:
1127811359
- name
1127911360
- slug
1128011361
- tools
11362+
- tool_selection_mode
11363+
- toolset_version
1128111364
- prompt_templates
1128211365
- tool_urns
1128311366
- resources
@@ -11360,6 +11443,9 @@ components:
1136011443
description: A short url-friendly label that uniquely identifies a resource.
1136111444
pattern: ^[a-z0-9_-]{1,128}$
1136211445
maxLength: 40
11446+
tool_selection_mode:
11447+
type: string
11448+
description: The mode to use for tool selection
1136311449
tool_urns:
1136411450
type: array
1136511451
items:
@@ -11381,6 +11467,7 @@ components:
1138111467
- name
1138211468
- slug
1138311469
- tools
11470+
- tool_selection_mode
1138411471
- prompt_templates
1138511472
- tool_urns
1138611473
- resources
@@ -11584,6 +11671,9 @@ components:
1158411671
description: A short url-friendly label that uniquely identifies a resource.
1158511672
pattern: ^[a-z0-9_-]{1,128}$
1158611673
maxLength: 40
11674+
tool_selection_mode:
11675+
type: string
11676+
description: The mode to use for tool selection
1158711677
tool_urns:
1158811678
type: array
1158911679
items:
@@ -11629,6 +11719,9 @@ components:
1162911719
items:
1163011720
type: string
1163111721
description: List of resource URNs to include in the toolset
11722+
tool_selection_mode:
11723+
type: string
11724+
description: The mode to use for tool selection
1163211725
tool_urns:
1163311726
type: array
1163411727
items:
@@ -11817,6 +11910,11 @@ components:
1181711910
- projects
1181811911
- scopes
1181911912
securitySchemes:
11913+
apikey_header_Authorization:
11914+
type: apiKey
11915+
description: key based auth.
11916+
name: Authorization
11917+
in: header
1182011918
apikey_header_Gram-Key:
1182111919
type: apiKey
1182211920
description: key based auth.

.speakeasy/workflow.lock

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.650.0
1+
speakeasyVersion: 1.641.1
22
sources:
33
Gram-Internal:
44
sourceNamespace: gram-api-description
@@ -13,8 +13,6 @@ targets:
1313
sourceNamespace: gram-api-description
1414
sourceRevisionDigest: sha256:2158f3c904977ad3bfaa18264fe75ca2be862f30a0cba535203c5db9d45c8465
1515
sourceBlobDigest: sha256:ba3c32ef977c109649e6cb42f48a38f8276ede046a478fe0b80ebe351c0a1d29
16-
codeSamplesNamespace: gram-api-description-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:0c50c19b4abbba32277e64138c18bae85150930922bd62a7c7ea03458de1723c
1816
workflow:
1917
workflowVersion: 1.0.0
2018
speakeasyVersion: pinned
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import { Button, cn, Icon, IconName, Stack } from "@speakeasy-api/moonshine";
2+
import { Type } from "./type";
3+
4+
export interface BigToggleOption {
5+
value: string;
6+
icon?: IconName;
7+
label: string;
8+
description?: string;
9+
}
10+
11+
export const BigToggle = ({
12+
options,
13+
selectedValue,
14+
onSelect,
15+
align = "center",
16+
}: {
17+
options: BigToggleOption[];
18+
selectedValue: string;
19+
onSelect: (value: string) => void;
20+
align?: "center" | "start" | "end";
21+
}) => {
22+
const classes = {
23+
both: "px-2 py-1 rounded-sm border-1 w-full",
24+
active: "border-border bg-card text-foreground",
25+
inactive:
26+
"border-transparent text-muted-foreground hover:bg-card hover:cursor-pointer hover:border-border hover:text-foreground",
27+
activeText: "text-foreground!",
28+
inactiveText: "text-muted-foreground! italic",
29+
align: {
30+
center: "justify-center",
31+
start: "justify-start",
32+
end: "justify-end",
33+
},
34+
};
35+
36+
const toggle = (
37+
<Stack gap={1} className="border rounded-md p-1 w-fit bg-background">
38+
{options.map((option) => {
39+
const isActive = selectedValue === option.value;
40+
return (
41+
<Button
42+
key={option.value}
43+
variant="tertiary"
44+
size="sm"
45+
className={cn(
46+
classes.align[align],
47+
classes.both,
48+
isActive ? classes.active : classes.inactive,
49+
)}
50+
{...(!isActive ? { onClick: () => onSelect(option.value) } : {})}
51+
>
52+
{option.icon && (
53+
<Button.LeftIcon>
54+
<Icon name={option.icon} className="h-4 w-4" />
55+
</Button.LeftIcon>
56+
)}
57+
<Button.Text>{option.label}</Button.Text>
58+
</Button>
59+
);
60+
})}
61+
</Stack>
62+
);
63+
64+
return (
65+
<Stack direction="horizontal" align="center" gap={3} className="mt-2">
66+
{toggle}
67+
{options.some((o) => o.description) && (
68+
<Stack className="gap-4.5">
69+
{options.map((option) =>
70+
option.description ? (
71+
<Type
72+
key={option.value}
73+
small
74+
className={cn(
75+
selectedValue === option.value
76+
? classes.activeText
77+
: classes.inactiveText,
78+
)}
79+
>
80+
{option.description}
81+
</Type>
82+
) : null,
83+
)}
84+
</Stack>
85+
)}
86+
</Stack>
87+
);
88+
};

0 commit comments

Comments
 (0)