{"record":{"id":"5bb9bbd48d206a98","repo":"mastra-ai/mastra","slug":"skill-name-is-required","errorCode":null,"errorMessage":"Skill name is required","messagePattern":"Skill name is required","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"warning","filePath":"packages/server/src/server/handlers/workspace.ts","lineNumber":957,"sourceCode":"  },\n});\n\nexport const WORKSPACE_GET_SKILL_ROUTE = createRoute({\n  method: 'GET',\n  path: '/workspaces/:workspaceId/skills/:skillName',\n  responseType: 'json',\n  pathParamSchema: skillNamePathParams,\n  queryParamSchema: skillDisambiguationQuerySchema,\n  responseSchema: getSkillResponseSchema,\n  summary: 'Get skill details',\n  description: 'Returns the full details of a specific skill including instructions and file lists',\n  tags: ['Workspace', 'Skills'],\n  handler: async ({ mastra, skillName, path, workspaceId, requestContext }) => {\n    try {\n      requireWorkspaceV1Support();\n\n      if (!skillName) {\n        throw new HTTPException(400, { message: 'Skill name is required' });\n      }\n\n      // Use the optional ?path= query param for disambiguation, otherwise fall back to name\n      const identifier = path ? decodeURIComponent(path) : skillName;\n\n      const skills = await getSkillsById(mastra, workspaceId);\n      if (!skills) {\n        throw new HTTPException(404, { message: 'No workspace with skills configured' });\n      }\n\n      // Refresh skills with request context (handles dynamic skill resolvers)\n      await skills.maybeRefresh({ requestContext });\n\n      const skill = await skills.get(identifier);\n      if (!skill) {\n        throw new HTTPException(404, { message: `Skill \"${identifier}\" not found` });\n      }\n","sourceCodeStart":939,"sourceCodeEnd":975,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/workspace.ts#L939-L975","documentation":"The get-skill-details handler (GET /workspaces/:workspaceId/skills/:skillName) throws this 400 when the `skillName` path parameter is missing/empty. The route contract requires a skill name to resolve the skill (optionally disambiguated via the ?path= query param). Practically this fires when the client requests a URL where the :skillName segment resolves to nothing.","triggerScenarios":"Requesting /workspaces/:id/skills/ (trailing slash, empty segment); a client template with an undefined skillName variable; proxy rewriting that drops the path segment; calling the underlying handler programmatically without skillName.","commonSituations":"URL builders that interpolate undefined names; encoded/empty names stripped by middleware; docs examples copy-pasted without substituting the skill name; redirects that lose the last path segment.","solutions":["Request /workspaces/:workspaceId/skills/<skillName> with a real, non-empty skill name.","URL-encode the skill name if it contains special characters.","Fix client code interpolating an undefined variable into the path.","If you don't know the name, list skills first via GET /workspaces/:id/skills."],"exampleFix":"// before\nconst url = `/api/workspaces/ws1/skills/${name}`; // name === undefined\n// after\nconst url = `/api/workspaces/ws1/skills/${encodeURIComponent('code-reviewer')}`;","handlingStrategy":"validation","validationCode":"function assertSkillName(name: string | undefined): asserts name is string {\n  if (!name) throw new Error('skillName must be provided before requesting skill details');\n}","typeGuard":"function hasSkillName(n: unknown): n is string {\n  return typeof n === 'string' && n.trim().length > 0;\n}","tryCatchPattern":"try {\n  const skill = await getSkill(wsId, name);\n} catch (e) {\n  if (isHTTPException(e, 400) && e.message === 'Skill name is required') {\n    // fix URL construction; fall back to listing skills\n  } else throw e;\n}","preventionTips":["Interpolate skill names only from verified non-empty values","encodeURIComponent the skill name segment","Catch undefined path params at build time with strict TypeScript","List skills first when the name is not hardcoded"],"tags":["http-400","skills","missing-parameter","rest-api"],"backgroundTag":"missing-required-parameter","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}