@@ -317,13 +317,14 @@ type GetWorkspaceArgs struct {
317317var GetWorkspace = Tool [GetWorkspaceArgs , codersdk.Workspace ]{
318318 Tool : aisdk.Tool {
319319 Name : ToolNameGetWorkspace ,
320- Description : `Get a workspace by ID.
320+ Description : `Get a workspace by name or ID.
321321
322322This returns more data than list_workspaces to reduce token usage.` ,
323323 Schema : aisdk.Schema {
324324 Properties : map [string ]any {
325325 "workspace_id" : map [string ]any {
326- "type" : "string" ,
326+ "type" : "string" ,
327+ "description" : workspaceDescription ,
327328 },
328329 },
329330 Required : []string {"workspace_id" },
@@ -332,7 +333,7 @@ This returns more data than list_workspaces to reduce token usage.`,
332333 Handler : func (ctx context.Context , deps Deps , args GetWorkspaceArgs ) (codersdk.Workspace , error ) {
333334 wsID , err := uuid .Parse (args .WorkspaceID )
334335 if err != nil {
335- return codersdk. Workspace {}, xerrors . New ( "workspace_id must be a valid UUID" )
336+ return namedWorkspace ( ctx , deps . coderClient , NormalizeWorkspaceInput ( args . WorkspaceID ) )
336337 }
337338 return deps .coderClient .Workspace (ctx , wsID )
338339 },
@@ -1432,7 +1433,7 @@ var WorkspaceLS = Tool[WorkspaceLSArgs, WorkspaceLSResponse]{
14321433 Properties : map [string ]any {
14331434 "workspace" : map [string ]any {
14341435 "type" : "string" ,
1435- "description" : workspaceDescription ,
1436+ "description" : workspaceAgentDescription ,
14361437 },
14371438 "path" : map [string ]any {
14381439 "type" : "string" ,
@@ -1489,7 +1490,7 @@ var WorkspaceReadFile = Tool[WorkspaceReadFileArgs, WorkspaceReadFileResponse]{
14891490 Properties : map [string ]any {
14901491 "workspace" : map [string ]any {
14911492 "type" : "string" ,
1492- "description" : workspaceDescription ,
1493+ "description" : workspaceAgentDescription ,
14931494 },
14941495 "path" : map [string ]any {
14951496 "type" : "string" ,
@@ -1566,7 +1567,7 @@ content you are trying to write, then re-encode it properly.
15661567 Properties : map [string ]any {
15671568 "workspace" : map [string ]any {
15681569 "type" : "string" ,
1569- "description" : workspaceDescription ,
1570+ "description" : workspaceAgentDescription ,
15701571 },
15711572 "path" : map [string ]any {
15721573 "type" : "string" ,
@@ -1614,7 +1615,7 @@ var WorkspaceEditFile = Tool[WorkspaceEditFileArgs, codersdk.Response]{
16141615 Properties : map [string ]any {
16151616 "workspace" : map [string ]any {
16161617 "type" : "string" ,
1617- "description" : workspaceDescription ,
1618+ "description" : workspaceAgentDescription ,
16181619 },
16191620 "path" : map [string ]any {
16201621 "type" : "string" ,
@@ -1681,7 +1682,7 @@ var WorkspaceEditFiles = Tool[WorkspaceEditFilesArgs, codersdk.Response]{
16811682 Properties : map [string ]any {
16821683 "workspace" : map [string ]any {
16831684 "type" : "string" ,
1684- "description" : workspaceDescription ,
1685+ "description" : workspaceAgentDescription ,
16851686 },
16861687 "files" : map [string ]any {
16871688 "type" : "array" ,
@@ -1755,7 +1756,7 @@ var WorkspacePortForward = Tool[WorkspacePortForwardArgs, WorkspacePortForwardRe
17551756 Properties : map [string ]any {
17561757 "workspace" : map [string ]any {
17571758 "type" : "string" ,
1758- "description" : workspaceDescription ,
1759+ "description" : workspaceAgentDescription ,
17591760 },
17601761 "port" : map [string ]any {
17611762 "type" : "number" ,
@@ -1812,7 +1813,7 @@ var WorkspaceListApps = Tool[WorkspaceListAppsArgs, WorkspaceListAppsResponse]{
18121813 Properties : map [string ]any {
18131814 "workspace" : map [string ]any {
18141815 "type" : "string" ,
1815- "description" : workspaceDescription ,
1816+ "description" : workspaceAgentDescription ,
18161817 },
18171818 },
18181819 Required : []string {"workspace" },
@@ -2199,7 +2200,9 @@ func newAgentConn(ctx context.Context, client *codersdk.Client, workspace string
21992200 return conn , nil
22002201}
22012202
2202- const workspaceDescription = "The workspace name in the format [owner/]workspace[.agent]. If an owner is not specified, the authenticated user is used."
2203+ const workspaceDescription = "The workspace ID or name in the format [owner/]workspace. If an owner is not specified, the authenticated user is used."
2204+
2205+ const workspaceAgentDescription = "The workspace name in the format [owner/]workspace[.agent]. If an owner is not specified, the authenticated user is used."
22032206
22042207func taskIDDescription (action string ) string {
22052208 return fmt .Sprintf ("ID or workspace identifier in the format [owner/]workspace[.agent] for the task to %s. If an owner is not specified, the authenticated user is used." , action )
0 commit comments