@@ -317,13 +317,14 @@ type GetWorkspaceArgs struct {
317317var GetWorkspace = Tool [GetWorkspaceArgs , codersdk.Workspace ]{
318318Tool : aisdk.Tool {
319319Name :ToolNameGetWorkspace ,
320- Description :`Get a workspace by ID.
320+ Description :`Get a workspace byname or ID.
321321
322322This returns more data than list_workspaces to reduce token usage.` ,
323323Schema : aisdk.Schema {
324324Properties :map [string ]any {
325325"workspace_id" :map [string ]any {
326- "type" :"string" ,
326+ "type" :"string" ,
327+ "description" :workspaceDescription ,
327328},
328329},
329330Required : []string {"workspace_id" },
@@ -332,7 +333,7 @@ This returns more data than list_workspaces to reduce token usage.`,
332333Handler :func (ctx context.Context ,deps Deps ,args GetWorkspaceArgs ) (codersdk.Workspace ,error ) {
333334wsID ,err := uuid .Parse (args .WorkspaceID )
334335if err != nil {
335- return codersdk. Workspace {}, xerrors . New ( "workspace_id must be a valid UUID" )
336+ return normalizedNamedWorkspace ( ctx , deps . coderClient , args . WorkspaceID )
336337}
337338return deps .coderClient .Workspace (ctx ,wsID )
338339},
@@ -1415,7 +1416,7 @@ var WorkspaceLS = Tool[WorkspaceLSArgs, WorkspaceLSResponse]{
14151416Properties :map [string ]any {
14161417"workspace" :map [string ]any {
14171418"type" :"string" ,
1418- "description" :workspaceDescription ,
1419+ "description" :workspaceAgentDescription ,
14191420},
14201421"path" :map [string ]any {
14211422"type" :"string" ,
@@ -1472,7 +1473,7 @@ var WorkspaceReadFile = Tool[WorkspaceReadFileArgs, WorkspaceReadFileResponse]{
14721473Properties :map [string ]any {
14731474"workspace" :map [string ]any {
14741475"type" :"string" ,
1475- "description" :workspaceDescription ,
1476+ "description" :workspaceAgentDescription ,
14761477},
14771478"path" :map [string ]any {
14781479"type" :"string" ,
@@ -1537,7 +1538,7 @@ var WorkspaceWriteFile = Tool[WorkspaceWriteFileArgs, codersdk.Response]{
15371538Properties :map [string ]any {
15381539"workspace" :map [string ]any {
15391540"type" :"string" ,
1540- "description" :workspaceDescription ,
1541+ "description" :workspaceAgentDescription ,
15411542},
15421543"path" :map [string ]any {
15431544"type" :"string" ,
@@ -1585,7 +1586,7 @@ var WorkspaceEditFile = Tool[WorkspaceEditFileArgs, codersdk.Response]{
15851586Properties :map [string ]any {
15861587"workspace" :map [string ]any {
15871588"type" :"string" ,
1588- "description" :workspaceDescription ,
1589+ "description" :workspaceAgentDescription ,
15891590},
15901591"path" :map [string ]any {
15911592"type" :"string" ,
@@ -1652,7 +1653,7 @@ var WorkspaceEditFiles = Tool[WorkspaceEditFilesArgs, codersdk.Response]{
16521653Properties :map [string ]any {
16531654"workspace" :map [string ]any {
16541655"type" :"string" ,
1655- "description" :workspaceDescription ,
1656+ "description" :workspaceAgentDescription ,
16561657},
16571658"files" :map [string ]any {
16581659"type" :"array" ,
@@ -1726,7 +1727,7 @@ var WorkspacePortForward = Tool[WorkspacePortForwardArgs, WorkspacePortForwardRe
17261727Properties :map [string ]any {
17271728"workspace" :map [string ]any {
17281729"type" :"string" ,
1729- "description" :workspaceDescription ,
1730+ "description" :workspaceAgentDescription ,
17301731},
17311732"port" :map [string ]any {
17321733"type" :"number" ,
@@ -1783,7 +1784,7 @@ var WorkspaceListApps = Tool[WorkspaceListAppsArgs, WorkspaceListAppsResponse]{
17831784Properties :map [string ]any {
17841785"workspace" :map [string ]any {
17851786"type" :"string" ,
1786- "description" :workspaceDescription ,
1787+ "description" :workspaceAgentDescription ,
17871788},
17881789},
17891790Required : []string {"workspace" },
@@ -2196,7 +2197,9 @@ func newAgentConn(ctx context.Context, client *codersdk.Client, workspace string
21962197return conn ,nil
21972198}
21982199
2199- const workspaceDescription = "The workspace name in the format [owner/]workspace[.agent]. If an owner is not specified, the authenticated user is used."
2200+ const workspaceDescription = "The workspace ID or name in the format [owner/]workspace. If an owner is not specified, the authenticated user is used."
2201+
2202+ const workspaceAgentDescription = "The workspace name in the format [owner/]workspace[.agent]. If an owner is not specified, the authenticated user is used."
22002203
22012204func taskIDDescription (action string )string {
22022205return 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 )