MCPcopy
hub / github.com/codeaashu/claude-code / getParseError

Function getParseError

src/tools/AgentTool/loadAgentsDir.ts:403–416  ·  view source on GitHub ↗

* Helper to determine the specific parsing error for an agent file

(frontmatter: Record<string, unknown>)

Source from the content-addressed store, hash-verified

401 * Helper to determine the specific parsing error for an agent file
402 */
403function getParseError(frontmatter: Record<string, unknown>): string {
404 const agentType = frontmatter['name']
405 const description = frontmatter['description']
406
407 if (!agentType || typeof agentType !== 'string') {
408 return 'Missing required "name" field in frontmatter'
409 }
410
411 if (!description || typeof description !== 'string') {
412 return 'Missing required "description" field in frontmatter'
413 }
414
415 return 'Unknown parsing error'
416}
417
418/**
419 * Parse hooks from frontmatter using the HooksSchema

Callers 1

loadAgentsDir.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected