{"record":{"id":"51bdb0d10818d682","repo":"mastra-ai/mastra","slug":"deprecated-endpoint","errorCode":"DEPRECATED_ENDPOINT","errorMessage":"This endpoint is deprecated. Please use the @mastra/ai-sdk package to for uiMessage transformations","messagePattern":"This endpoint is deprecated\\. Please use the @mastra/ai-sdk package to for uiMessage transformations","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"warning","filePath":"packages/server/src/server/handlers/agents.ts","lineNumber":3574,"sourceCode":"  },\n});\n\nexport const STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE = createRoute({\n  method: 'POST',\n  path: '/agents/:agentId/stream/vnext/ui',\n  responseType: 'stream',\n  pathParamSchema: agentIdPathParams,\n  bodySchema: agentExecutionBodySchema,\n  responseSchema: streamResponseSchema,\n  summary: 'Stream UI messages from an agent',\n  description:\n    '[DEPRECATED] This endpoint is deprecated. Please use the @mastra/ai-sdk package for uiMessage transformations',\n  tags: ['Agents'],\n  requiresAuth: true,\n  deprecated: true,\n  handler: async () => {\n    try {\n      throw new MastraError({\n        category: ErrorCategory.USER,\n        domain: ErrorDomain.MASTRA_SERVER,\n        id: 'DEPRECATED_ENDPOINT',\n        text: 'This endpoint is deprecated. Please use the @mastra/ai-sdk package to for uiMessage transformations',\n      });\n    } catch (error) {\n      return handleError(error, 'error streaming agent response');\n    }\n  },\n});\n\nexport const STREAM_UI_MESSAGE_DEPRECATED_ROUTE = createRoute({\n  method: 'POST',\n  path: '/agents/:agentId/stream/ui',\n  responseType: 'stream',\n  pathParamSchema: agentIdPathParams,\n  bodySchema: agentExecutionBodySchema,\n  responseSchema: streamResponseSchema,","sourceCodeStart":3556,"sourceCodeEnd":3592,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/agents.ts#L3556-L3592","documentation":"This HTTP error (with MastraError id DEPRECATED_ENDPOINT) is thrown by a deprecated uiMessage transformation route. The transformation was moved into the @mastra/ai-sdk package, so the server-side route now refuses to execute and instructs callers to do the transformation client-side with that package.","triggerScenarios":"POSTing to the deprecated uiMessage transformation endpoint (route marked `deprecated: true` at packages/server/src/server/handlers/agents.ts:3574).","commonSituations":"Applications relying on the old server-side UI-message conversion after the logic was extracted to @mastra/ai-sdk; upgrading the server without updating client transformation code.","solutions":["Install @mastra/ai-sdk and perform the uiMessage transformation in your client code (e.g. `toUIMessageStreamResponse`-style helpers it exports).","Update client code to stop calling the deprecated endpoint.","Check the @mastra/ai-sdk docs for the exact replacement function for your former endpoint usage."],"exampleFix":"// before\nconst res = await fetch(`/api/agents/${id}/ui`, { method: 'POST', body });\n// after\nimport { toUIMessageStream } from '@mastra/ai-sdk';\nconst stream = toUIMessageStream(agentStream);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const res = await fetch(`/api/agents/${id}/ui`, { method: 'POST', body });\n  if (res.status === 410) {\n    throw new Error('Use @mastra/ai-sdk for uiMessage transformations instead of this endpoint');\n  }\n} catch (e) {\n  // fall back to client-side transformation via @mastra/ai-sdk\n}","preventionTips":["Adopt @mastra/ai-sdk for uiMessage transformations instead of server endpoints.","Avoid hand-rolled fetch calls to internal transformation routes; use the client SDK.","Read deprecation notices in API docs before upgrading servers."],"tags":["http-410","deprecated-endpoint","ai-sdk","migration"],"backgroundTag":"endpoint-deprecated","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}